Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-50373

Cloze questions not properly displayed in random quiz

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Critical
    • Resolution: Fixed
    • 2.9, 3.0
    • 2.9.1
    • Questions
    • MOODLE_29_STABLE, MOODLE_30_STABLE
    • MOODLE_29_STABLE
    • Hide

      The unit tests are already sufficient, I think, but best to test through the UI too.

      1. Create a quiz in a new course.
      2. Add one Cloze question to the question bank (There is one you can copy and paste in the docs https://docs.moodle.org/29/en/Embedded_Answers_(Cloze)_question_type#Examples)
      3. Add one random question to the quiz, picking from the category where you added the Cloze question.
      4. Preview the quiz a few times, and verify that each time you get the whole cloze question, not something weird.
      5. Go back to the Edit quiz page.
      6. Add the Cloze question directly to the quiz.
      7. Go to the question bank and 'delete' the question.
      8. Go back to the edit quiz page, and remove the Cloze question from the quiz, but leave the random question there.
      9. Now try to preview the quiz, and verify that you get an error telling you that there are not enough questions in that category.

      (Steps 6-8 may seem weird, but what is going on is that if you try to delete a question that is in use, then it is not really deleted, it is just marked hidden. We want to test this, so we make the question used by adding it to the quiz, then delete it, then remove it from the quiz again to get back to the state we want to test.)

      Show
      The unit tests are already sufficient, I think, but best to test through the UI too. Create a quiz in a new course. Add one Cloze question to the question bank (There is one you can copy and paste in the docs https://docs.moodle.org/29/en/Embedded_Answers_(Cloze)_question_type#Examples ) Add one random question to the quiz, picking from the category where you added the Cloze question. Preview the quiz a few times, and verify that each time you get the whole cloze question, not something weird. Go back to the Edit quiz page. Add the Cloze question directly to the quiz. Go to the question bank and 'delete' the question. Go back to the edit quiz page, and remove the Cloze question from the quiz, but leave the random question there. Now try to preview the quiz, and verify that you get an error telling you that there are not enough questions in that category. (Steps 6-8 may seem weird, but what is going on is that if you try to delete a question that is in use, then it is not really deleted, it is just marked hidden. We want to test this, so we make the question used by adding it to the quiz, then delete it, then remove it from the quiz again to get back to the state we want to test.)

    Description

      Version : 2.9
      Cloze questions are properly displayed when previewed in the question bank.
      They are also properly displayed if selected for a quiz.

      The bug appears when they are randomly taken out of a category. In the quiz, they appear like a shortanswer question, with the code of the cloze question as the wording of what is asked.

      There were no such problem in 2.8 in the same situation with the same questions.

      Example (both questions in the same category)

      • code of question 1:
        Who was Louis Armstrong ? {1:MC:=a jazzman~an astronaut~a cyclist}
      • code of question 2 :
        What's the capital of France ? {1:SA:=Paris}

      Both questions in a non-random quiz :

      Quiz with one randomly chosen question in the category :

      Attachments

        1. jira 1.jpg
          jira 1.jpg
          108 kB
        2. jira2.png
          jira2.png
          49 kB
        3. quiz2.jpg
          quiz2.jpg
          25 kB
        4. screenshot-1.png
          screenshot-1.png
          100 kB

        Issue Links

          Activity

            People

              timhunt Tim Hunt
              didier.jodin didier jodin
              Eloy Lafuente (stronk7) Eloy Lafuente (stronk7)
              David Monllaó David Monllaó
              David Monllaó David Monllaó
              Safat Shahin, Tim Hunt, Ilya Tregubov, Kevin Percy, Mathew May, Mihail Geshoski, Shamim Rezaie
              Votes:
              1 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:
                6/Jul/15