app/controllers/criteria_controller.rb
# Resets the total mark for all results for the given assignment with id +assessment_id+.
Resets the total mark for all results for the given assignment with id +assessment_id+.
Resets the total mark for all results for the given assignment with id + assessment_id + .
def reset_results_total_mark(assessment_id)
    Result.joins(submission: :grouping)
          .where('submissions.submission_version_used': true, 'groupings.assessment_id': assessment_id)
          .each do |result|
      result.update(marking_state: Result::MARKING_STATES[:incomplete])
      result.update_total_mark
    end
  end
def reset_results_total_mark ( assessment_id ) Result . joins ( submission : :grouping ) . where ( 'submissions.submission_version_used' : true , 'groupings.assessment_id' : assessment_id ) . each do | result | result . update ( marking_state : Result :: MARKING_STATES [ :incomplete ] ) result . update_total_mark end end
Resets the total mark for all results for the given assignment with id +assessment_id+.
Resets the total mark for all results for the given assignment with id + assessment_id + .
assessment_id
<not_specific>