Matching Question Not Evaluated in Quiz Results

Created on 20 May 2024, 4 months ago
Updated 11 September 2024, 9 days ago

**Description:**
I encountered an issue with the Quiz module when using matching questions. After taking a quiz that includes a matching question, the quiz results section displays an incorrect score with a question mark. Specifically, it shows: `Score: ? of 2`. Upon inspecting the code, I found that the `q-waiting` class is added when `$entity` is not evaluated. However, the overall score for the quiz is calculated correctly.

**Steps to Reproduce:**
1. Install and enable the Quiz module.
2. Create a new quiz and add a question of type "Matching".
3. Take the quiz and submit your answers.
4. Navigate to the quiz results section.

**Expected Behavior:**
The quiz results should display the correct score for the matching question.

**Actual Behavior:**
The quiz results display an incorrect score with a question mark: `Score: ? of 2`. The `q-waiting` class is added to the question when `$entity` is not evaluated.

**Code Inspection:**
In the code of the Quiz module, the `q-waiting` class is added when `$entity` is not evaluated. This is causing the issue with the score display for matching questions.

**Additional Information:**
- Drupal version: 9.5.11
- Quiz module version: 6.x-dev"
- PHP version: 8.1.27

Attached screenshot for your reference

πŸ› Bug report
Status

Active

Version

7.0

Component
OtherΒ  β†’

Last updated less than a minute ago

Created by

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @Vinaya96
  • πŸ‡ΊπŸ‡ΈUnited States cilefen
  • Status changed to Postponed: needs info about 2 months ago
  • πŸ‡ΊπŸ‡ΈUnited States smustgrave

    So I wasn't able to reproduce? Any additional info by chance?

  • Thank you for looking into this.

    I encountered the issue when using matching questions only. After taking a quiz that includes a matching question, the quiz results section displays an incorrect score with a question mark. ( Screenshot attached previously)

    Unfortunately, I don't have any additional information beyond this at the moment. If there's anything specific you'd like me to check or try, I'd be happy to provide more details or run further tests.

  • Rewriting steps I followed now,

    Drupal Version: 10.3
    Quiz Module Version: 7.0.0

    Step 1. Created new quiz by navigating to Quiz -> Quizzes -> Add Quiz -> ( Title and other details to create new quiz).
    Step 2. Create new question -> Matching question - > Title, Matching Question(questions,answer) -> Save (screenshot attached).
    Step 3. Submit the question to the quiz (screenshot attached).
    Step 4. Take the quiz and finish (screenshot attached).
    Step 5. Displayed score of each question and total score of the quiz. (Screenshot Attached).

    Expected behavior: Each question should display the correct score, such as 1 of 1 for a correct answer.

    Actual behavior: Individual question scores are displayed as ? of 1, although the total score is correctly calculated.

  • Status changed to Active 9 days ago
  • πŸ‡ΊπŸ‡ΈUnited States smustgrave
Production build 0.71.5 2024