@@ -357,7 +357,7 @@ export class AutoScoreService extends Service {
357357
358358 // 使用AND/OR逻辑评估触发器
359359 const matchedStudents = this . evaluateTriggersWithLogic ( rule , studentsToScore )
360-
360+
361361 if ( matchedStudents . length > 0 ) {
362362 for ( const action of rule . actions || [ ] ) {
363363 await this . executeAction ( action , matchedStudents , rule . name )
@@ -387,7 +387,7 @@ export class AutoScoreService extends Service {
387387 for ( let i = 0 ; i < rule . triggers . length ; i ++ ) {
388388 const trigger = rule . triggers [ i ]
389389 const logic = getTriggerLogic ( trigger . event )
390-
390+
391391 if ( ! logic ?. check ) {
392392 continue
393393 }
@@ -404,9 +404,9 @@ export class AutoScoreService extends Service {
404404 } ,
405405 now : new Date ( )
406406 }
407-
407+
408408 const result = logic . check ( context , trigger . value || '' )
409-
409+
410410 if ( ! result . matchedStudents || result . matchedStudents . length === 0 ) {
411411 // 当前触发器没有匹配的学生
412412 if ( currentRelation === 'AND' ) {
@@ -418,13 +418,13 @@ export class AutoScoreService extends Service {
418418 // 当前触发器有匹配的学生
419419 if ( currentRelation === 'AND' ) {
420420 // AND关系下,取交集
421- currentGroup = currentGroup . filter ( student =>
422- result . matchedStudents ! . some ( matched => matched . id === student . id )
421+ currentGroup = currentGroup . filter ( ( student ) =>
422+ result . matchedStudents ! . some ( ( matched ) => matched . id === student . id )
423423 )
424424 } else {
425425 // OR关系下,取并集
426- const newStudents = result . matchedStudents . filter ( matched =>
427- ! currentGroup . some ( student => student . id === matched . id )
426+ const newStudents = result . matchedStudents . filter (
427+ ( matched ) => ! currentGroup . some ( ( student ) => student . id === matched . id )
428428 )
429429 currentGroup = [ ...currentGroup , ...newStudents ]
430430 }
@@ -433,27 +433,28 @@ export class AutoScoreService extends Service {
433433 // 处理下一个关系(如果存在)
434434 if ( i < rule . triggers . length - 1 ) {
435435 const nextRelation = rule . triggers [ i + 1 ] . relation || 'AND'
436-
436+
437437 if ( nextRelation !== currentRelation ) {
438438 // 关系发生变化,处理当前组的结果
439439 if ( currentRelation === 'AND' ) {
440440 // AND组结束,如果当前组不为空,则合并到结果
441441 if ( currentGroup . length > 0 ) {
442- resultStudents = resultStudents . filter ( student =>
443- currentGroup . some ( groupStudent => groupStudent . id === student . id )
442+ resultStudents = resultStudents . filter ( ( student ) =>
443+ currentGroup . some ( ( groupStudent ) => groupStudent . id === student . id )
444444 )
445445 } else {
446446 // AND组为空,整个规则不匹配
447447 return [ ]
448448 }
449449 } else {
450450 // OR组结束,合并当前组到结果
451- const newStudents = currentGroup . filter ( groupStudent =>
452- ! resultStudents . some ( resultStudent => resultStudent . id === groupStudent . id )
451+ const newStudents = currentGroup . filter (
452+ ( groupStudent ) =>
453+ ! resultStudents . some ( ( resultStudent ) => resultStudent . id === groupStudent . id )
453454 )
454455 resultStudents = [ ...resultStudents , ...newStudents ]
455456 }
456-
457+
457458 // 重置当前组为所有学生,开始新的关系组
458459 currentGroup = [ ...initialStudents ]
459460 currentRelation = nextRelation
@@ -465,17 +466,18 @@ export class AutoScoreService extends Service {
465466 if ( currentRelation === 'AND' ) {
466467 // AND组结束,如果当前组不为空,则合并到结果
467468 if ( currentGroup . length > 0 ) {
468- resultStudents = resultStudents . filter ( student =>
469- currentGroup . some ( groupStudent => groupStudent . id === student . id )
469+ resultStudents = resultStudents . filter ( ( student ) =>
470+ currentGroup . some ( ( groupStudent ) => groupStudent . id === student . id )
470471 )
471472 } else {
472473 // AND组为空,整个规则不匹配
473474 return [ ]
474475 }
475476 } else {
476477 // OR组结束,合并当前组到结果
477- const newStudents = currentGroup . filter ( groupStudent =>
478- ! resultStudents . some ( resultStudent => resultStudent . id === groupStudent . id )
478+ const newStudents = currentGroup . filter (
479+ ( groupStudent ) =>
480+ ! resultStudents . some ( ( resultStudent ) => resultStudent . id === groupStudent . id )
479481 )
480482 resultStudents = [ ...resultStudents , ...newStudents ]
481483 }
0 commit comments