Skip to content

Commit

Permalink
Fix matching score (#33)
Browse files Browse the repository at this point in the history
  • Loading branch information
mako321 authored Mar 7, 2024
1 parent 36782df commit eae26d0
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/Strategies/MatchingQuestionStrategy.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public function checkAnswer(array $answer): CheckAnswerDto
return $result->setScore(0);
}

return $result->setScore(1);
return $result->setScore($this->questionModel->score);
}

private function getCorrectAnswers(): Collection
Expand Down
2 changes: 2 additions & 0 deletions tests/Api/AttemptAnswerSaveApiTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,8 @@ public function questionDataProvider(): array
'Japan' => 'Tokyo',
'India' => 'New Delhi',
]],
'score' => 4,
'resultScore' => 4,
],
[
'question' => 'Match the following countries with their corresponding capitals. {
Expand Down

0 comments on commit eae26d0

Please sign in to comment.