Moodle
  1. Moodle
  2. MDL-26520

Quiz attempt: random questions are marked as answered even if they have not been

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.0.1
    • Fix Version/s: 2.0.3
    • Component/s: Questions, Quiz
    • Labels:
    • Difficulty:
      Moderate
    • Affected Branches:
      MOODLE_20_STABLE
    • Fixed Branches:
      MOODLE_20_STABLE
    • Rank:
      16257

      Description

      Some questions are automatically marked as "answered" when going to next page in one attempt, not matter they have not been introduced by the user at all.

      To reproduce:

      1) restore the attached backup file.
      2) Got to "Quiz One" and start one attempt.
      3) Without introducing any response, press next.
      4) Some questions appear as answered in the "summary box" upper left.
      5) Press next again, the "Summary of attempt" is shown. It shows two answered questions and the user hasn't introduced them.

      Ciao

      PS: Both questions seem to be truefalse ones

        Issue Links

          Activity

          Hide
          Tim Hunt added a comment -

          Grrr! I thought I had fixed this before the 2.0 release: MDL-22658. I wonder what has gone wrong.

          Show
          Tim Hunt added a comment - Grrr! I thought I had fixed this before the 2.0 release: MDL-22658 . I wonder what has gone wrong.
          Hide
          Tim Hunt added a comment -

          That is really weird. When I make a test quiz, I can't reproduce this. When I restore your course from backup, I can reproduce this with questions 6 and 7.

          Show
          Tim Hunt added a comment - That is really weird. When I make a test quiz, I can't reproduce this. When I restore your course from backup, I can reproduce this with questions 6 and 7.
          Hide
          Tim Hunt added a comment -

          Well, that quiz is set to shuffle the question order, so mentioning specific question numbers is not helpful. Anyway, the problem is to do with random questions. Steps to reproduce:

          1. Create a category called 'Variants of Q1'. Create two truefalse questions in that category.
          2. Create a third truefalse questions in the default category.
          3. Add one random question picking from the 'Variants of Q1' category, and the question from step 2. to make a 2-question quiz.
          4. Preview the quiz. Click next without putting in any answers. The random question is marked in Answered even though it has not been. The non-random question is correctly marked as Not answered.

          Show
          Tim Hunt added a comment - Well, that quiz is set to shuffle the question order, so mentioning specific question numbers is not helpful. Anyway, the problem is to do with random questions. Steps to reproduce: 1. Create a category called 'Variants of Q1'. Create two truefalse questions in that category. 2. Create a third truefalse questions in the default category. 3. Add one random question picking from the 'Variants of Q1' category, and the question from step 2. to make a 2-question quiz. 4. Preview the quiz. Click next without putting in any answers. The random question is marked in Answered even though it has not been. The non-random question is correctly marked as Not answered.
          Hide
          Tim Hunt added a comment -

          This is a regression from MDL-26236, caused by some typically insane PHP behaviour.

          substr($response, strlen($response)) returns false, not ''.

          Show
          Tim Hunt added a comment - This is a regression from MDL-26236 , caused by some typically insane PHP behaviour. substr($response, strlen($response)) returns false, not ''.
          Hide
          David Mudrak added a comment -

          Tested. Thanks Eloy and Tim.

          Show
          David Mudrak added a comment - Tested. Thanks Eloy and Tim.

            People

            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: