Skip to content

Commit

Permalink
[Path] fixes progression
Browse files Browse the repository at this point in the history
  • Loading branch information
Elorfin committed May 31, 2023
1 parent 7f3285e commit 42212a3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/plugin/path/Manager/EvaluationManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -154,10 +154,10 @@ public function compute(Path $path, User $user): ResourceEvaluation
$aggregator->addEvaluation(new GenericEvaluation($stepDone ? 100 : 0));

// store the step status in the path attempt
if ($stepDone && !in_array($step->getUuid(), $evaluationData['done'])) {
if ($stepDone && (empty($evaluationData['done']) || !in_array($step->getUuid(), $evaluationData['done']))) {
// mark the step as done if it has the correct status
$evaluationData['done'][] = $step->getUuid();
} elseif (!$stepDone && in_array($step->getUuid(), $evaluationData['done'])) {
} elseif (!$stepDone && !empty($evaluationData['done']) && in_array($step->getUuid(), $evaluationData['done'])) {
// mark the step as not done
array_splice($evaluationData['done'], array_search($step->getUuid(), $evaluationData['done']), 1);
}
Expand Down

0 comments on commit 42212a3

Please sign in to comment.