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

Deleting a randomized sub-question in a preview gives a coding error

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Minor Minor
    • None
    • 2.9.2, 3.0, 3.7.1
    • Questions, Quiz
    • MOODLE_29_STABLE, MOODLE_30_STABLE, MOODLE_37_STABLE
    • MDL-51751-404
    • MDL-51751-405
    • MDL-51751-master
    • Hide

      Modify the quiz in some way to delete the corrupt preview. For example, adding and deleting a question will do this. Or even easier, Quiz administration -> Edit quiz settings, and Save without changing anything.

      Show
      Modify the quiz in some way to delete the corrupt preview. For example, adding and deleting a question will do this. Or even easier, Quiz administration -> Edit quiz settings, and Save without changing anything.
    • Hide

      Testing scenario :

      Case 1: 

      • Create a quiz
      • Go to Quiz -> Questions edit page
      • Add random question (Existing category)
      • Then add random question again, but using new category.
      • Go to question bank
      • Create a True/False question in quiz category
      • Create an Essay question in the sub category
      • Go to Quiz again and preview the quiz
      • Go back to question bank
      • Delete those two question in each category.
      • Create an Essay question in quiz category 
      • Create an True/False  question in sub category 
      • Go to Quiz again and go to the preview that is in progress

      Expected: The preview should be working normally.

      Case 2: 

      • Create a quiz
      • Go to Quiz -> Questions edit page
      • Add random question (Existing category)
      • Then add random question again, but using new category.
      • Go to question bank
      • Create a True/False question in quiz category
      • Create an Essay question in the sub category
      • Go to Quiz again and preview the quiz
      • Now we keep the preview in the current tab
      • Open the new tab 
      • Go back to question bank
      • Delete those two question in each category.
      • Create an Essay question in quiz category 
      • Create an True/False  question in sub category 
      • Now go back Quiz preview tab.
      • Refresh the page

      Expected: The preview should be working normally.

       

      Case 3:  

      • Create a quiz
      • Go to Quiz -> Questions edit page
      • Add 3 random question (Existing category)
      • Go to question bank
      • Create 3 question in quiz category
      • Go to Quiz again and preview the quiz
      • Go back to question bank
      • Delete those 3 questions in quiz category.
      • Go to Quiz again and go to the preview that is in progress
      • We should see an error "There are not enough questions in category"
      • Go to question bank
      • Create 2 question in quiz category
      • Go to Quiz again and preview the quiz again{}

      Expected: The preview should be working normally.

      Show
      Testing scenario : Case 1:  Create a quiz Go to Quiz -> Questions edit page Add random question (Existing category) Then add random question again, but using new category. Go to question bank Create a True/False question in quiz category Create an Essay question in the sub category Go to Quiz again and preview the quiz Go back to question bank Delete those two question in each category. Create an Essay question in quiz category  Create an True/False  question in sub category  Go to Quiz again and go to the preview that is in progress Expected : The preview should be working normally. Case 2:  Create a quiz Go to Quiz -> Questions edit page Add random question (Existing category) Then add random question again, but using new category. Go to question bank Create a True/False question in quiz category Create an Essay question in the sub category Go to Quiz again and preview the quiz Now we keep the preview in the current tab Open the new tab   Go back to question bank Delete those two question in each category. Create an Essay question in quiz category  Create an True/False  question in sub category  Now go back Quiz preview tab. Refresh the page Expected : The preview should be working normally.   Case 3:   Create a quiz Go to Quiz -> Questions edit page Add 3 random question (Existing category) Go to question bank Create 3 question in quiz category Go to Quiz again and preview the quiz Go back to question bank Delete those 3 questions in quiz category. Go to Quiz again and go to the preview that is in progress We should see an error "There are not enough questions in category" Go to question bank Create 2 question in quiz category Go to Quiz again and preview the quiz again { } Expected : The preview should be working normally.
    • Hide

      Code verified against automated checks.

      Checked MDL-51751 using repository: https://github.com/NashTechOpenUniversity/moodle

      More information about this report

      Built on: Tue Apr 1 02:48:30 UTC 2025

      Show
      Code verified against automated checks. Checked MDL-51751 using repository: https://github.com/NashTechOpenUniversity/moodle MOODLE_404_STABLE (0 errors / 0 warnings) [branch: MDL-51751-404 | CI Job ] MOODLE_405_STABLE (0 errors / 0 warnings) [branch: MDL-51751-405 | CI Job ] main (0 errors / 0 warnings) [branch: MDL-51751-master | CI Job ] More information about this report Built on: Tue Apr 1 02:48:30 UTC 2025
    • Hide

      Launching automatic jobs for branch MDL-51751-404

      Launching automatic jobs for branch MDL-51751-405

      Launching automatic jobs for branch MDL-51751-master

      Built on: Fri Mar 28 07:10:45 UTC 2025

      Show
      Launching automatic jobs for branch MDL-51751 -404 https://ci.moodle.org/view/Testing/job/DEV.01%20-%20Developer-requested%20Behat/64548/ Behat (NonJS - boost and classic / complete) Launching automatic jobs for branch MDL-51751 -405 https://ci.moodle.org/view/Testing/job/DEV.01%20-%20Developer-requested%20Behat/64549/ Behat (NonJS - boost and classic / complete) Launching automatic jobs for branch MDL-51751 -master https://ci.moodle.org/view/Testing/job/DEV.01%20-%20Developer-requested%20Behat/64550/ Behat (NonJS - boost and classic / complete) Built on: Fri Mar 28 07:10:45 UTC 2025

      The following steps result in a coding error while previewing a quiz:

      1. Create a new quiz with question behavior "Interactive with multiple tries"
      2. In the question bank, create a question category named "Test"
      3. Add a new Matching question to category "Test"
      4. In the quiz, add a Random question pulling from category "Test"
      5. Preview the quiz, but do not Finish the preview.
      6. In the question bank, delete the Matching question.
      7. Preview the quiz again.

      Expected:

      There will be no fatal error. Acceptable outcomes would be a notice of a missing question or a brand new preview.

      Actual:

      Moodle will respond with the coding error:

      Coding error detected, it must be fixed by a programmer: This behaviour (interactivecountback) cannot work with this question (qtype_missingtype_question)
      

      At this point the instructor is essentially locked-out from previewing the quiz and there is no obvious way to delete the corrupt preview.

            vuvanhieu143 Hieu Vu
            mpetrowi Matt Petro
            Anupama Sarjoshi Anupama Sarjoshi
            Tim Hunt Tim Hunt
            Votes:
            19 Vote for this issue
            Watchers:
            19 Start watching this issue

              Created:
              Updated:

                Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.