@@ -522,7 +522,7 @@ def ensured_group_submission
522522 group . create_submission self , '' , group . projects . map { |proj | { project : proj , pct : 100 / group . projects . count } }
523523 end
524524
525- def trigger_transition ( trigger : '' , by_user : nil , bulk : false , group_transition : false , quality : 1 )
525+ def trigger_transition ( trigger : '' , by_user : nil , bulk : false , group_transition : false , quality : 1 , recursive_fix : false )
526526 #
527527 # Ensure that assessor is allowed to update the task in the indicated way
528528 #
@@ -594,7 +594,7 @@ def trigger_transition(trigger: '', by_user: nil, bulk: false, group_transition:
594594 lc = comments . last
595595 # Prevent duplicate status comments during feedback
596596 unless lc && lc . user == by_user && lc . comment == status . name && ( lc . content_type != 'status' || lc . task_status == status )
597- assess status , by_user
597+ assess status , by_user , Time . zone . now , recursive_fix
598598
599599 # Add a status comment for new assessments - only recorded on submitter's task in groups
600600 add_status_comment ( by_user , status )
@@ -674,7 +674,7 @@ def grade_task(new_grade, ui = nil, grading_group = false)
674674 end
675675 end
676676
677- def assess ( task_status , assessor , assess_date = Time . zone . now )
677+ def assess ( task_status , assessor , assess_date = Time . zone . now , recursive_fix = false )
678678 # Set the task's status to the assessment outcome status
679679 # and flag it as no longer awaiting signoff
680680 self . task_status = task_status
@@ -725,7 +725,7 @@ def assess(task_status, assessor, assess_date = Time.zone.now)
725725 end
726726 end
727727
728- if task_status == TaskStatus . fix_and_resubmit
728+ if task_status == TaskStatus . fix_and_resubmit && recursive_fix
729729 # Look for other submitted tasks from this student that has this task as a prerequisite
730730 # If they are ready for feedback, automatically assess them to fix and resubmit
731731 dependents = TaskPrerequisite . where ( prerequisite_id : task_definition . id )
@@ -738,7 +738,7 @@ def assess(task_status, assessor, assess_date = Time.zone.now)
738738
739739 next unless task . task_status == TaskStatus . ready_for_feedback
740740 # Since we are calling this assess method again, we recursively check for more dependent tasks that need to be updated
741- task . assess ( TaskStatus . fix_and_resubmit , assessor , assess_date )
741+ task . assess ( TaskStatus . fix_and_resubmit , assessor , assess_date , recursive_fix )
742742 task . add_status_comment ( assessor , TaskStatus . fix_and_resubmit )
743743 task . add_text_comment ( assessor , "**Automated comment**: A prerequisite task was updated to Fix and Resubmit, so this task was updated as well. You may need to review and update the prerequisite before resubmitting." )
744744 end
0 commit comments