Skip to content

fix(quiz): ensure quiz summary total marks uses get_quiz_total_marks - #2990

Merged
shewa12 merged 1 commit into
devfrom
fix/quiz-attempt
Sep 7, 2026
Merged

fix(quiz): ensure quiz summary total marks uses get_quiz_total_marks#2990
shewa12 merged 1 commit into
devfrom
fix/quiz-attempt

Conversation

@b-l-i-n-d

Copy link
Copy Markdown
Collaborator

Summary of Changes

  • In templates/learning-area/quiz/content.php, ensure $total_marks is always determined by Quiz::get_quiz_total_marks( $quiz_id ).
  • Previously, if a prior quiz attempt existed, $total_marks was overwritten with $quiz_attempt->total_marks, causing randomized quizzes with question limits to display total marks in the quiz summary instead of omitting them.
  • Earned grade percentage continues to be calculated accurately from the previous attempt object via QuizModel::calculate_attempt_earned_percentage( $quiz_attempt ).

Testing

  • Tested with newly created and existing quizzes with attempts.
  • Verified PHP syntax and ran WordPress coding standards sniff with 0 errors/warnings.

@b-l-i-n-d
b-l-i-n-d requested a review from shewa12 September 7, 2026 10:27
@b-l-i-n-d b-l-i-n-d self-assigned this Sep 7, 2026
@b-l-i-n-d b-l-i-n-d added the 4.0.8 Tutor v4.0.8 label Sep 7, 2026
@shewa12
shewa12 merged commit d02f82d into dev Sep 7, 2026
11 of 13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

4.0.8 Tutor v4.0.8

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants