Skip to content

Commit

Permalink
Merge pull request #1612 from clpetersonucf/issue/1611-fix-for-score-…
Browse files Browse the repository at this point in the history
…module-attempt-limit-validation

Fix for score module attempt limit validation
  • Loading branch information
clpetersonucf authored Oct 21, 2024
2 parents 7b4655a + 58421ff commit 69f00dc
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion fuel/app/classes/materia/score/module.php
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,8 @@ public function validate_scores($timestamp=false)
// Check for attempt limit prior to submission, but only for actual plays (not previews)
if ($this->play_id != -1)
{
$attempts_used = count(\Materia\Score_Manager::get_instance_score_history($this->inst->id, $this->play->context_id));
$semester = Semester::get_current_semester();
$attempts_used = count(\Materia\Score_Manager::get_instance_score_history($this->inst->id, $this->play->context_id, $semester));
if ($this->inst->attempts != -1 && $attempts_used >= $this->inst->attempts)
{
throw new Score_Exception('Attempt Limit Met', 'You have already met the attempt limit for this widget and cannot submit additional scores.');
Expand Down

0 comments on commit 69f00dc

Please sign in to comment.