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

Random questions from empty categories with non-empty sub-categories throwing "not enough questions in category" error

XMLWordPrintable

    • MOODLE_403_STABLE
    • MOODLE_403_STABLE
    • MDL-79708-403
    • MDL-79708-main
    • Hide
      1. Restore attached backup (lets call it backup1) before applying the patch into new course1 (this ensures we have course with broekn filters - you won't be able to preview quiz)
      2. Backup your new course1 - lets call it backup2
      3. Apply the patch and make sure you can preview and submit attempts of the quiz in course1
      4. Restore backup1 again into a new course and make sure you can preview and submit attempts of the quiz
      5. Restore backup2 into new course and make sure you can preview and submit attempts of the quiz
      Show
      Restore attached backup (lets call it backup1 ) before applying the patch into new course1  (this ensures we have course with broekn filters - you won't be able to preview quiz) Backup your new course1 - lets call it backup2 Apply the patch and make sure you can preview and submit attempts of the quiz in course1 Restore backup1 again into a new course and make sure you can preview and submit attempts of the quiz Restore backup2 into new course and make sure you can preview and submit attempts of the quiz
    • 3
    • Team Alpha - Sprint 2 I4-2023

      Since my last upgrade from 4.2 to 4.3, all my quizzes using random questions from empty categories (but which contain non-empty sub-categories) don't work anymore.

      I get the following type of message:

      "There are not enough questions in category 19 to create the question Random question (6107)."

      I've tried creating new instances of the same quizzes with random questions from the same empty category and its non-empty subcategories, I find the selecting form a bit unpractical, but it works, and I noticed that the difference is in the mdl_question_set_references, more precisely the last field "filterconditions"

      When it's from an old quiz, it contains things like:

      {"questioncategoryid":"19","includingsubcategories":"1"}

      and it doesn't work (see above error message)

      When it's a new one, with questions randomly selected from the same category, it says:

      {"filter":{"category":{"name":"category","jointype":1,"values":["19"],"filteroptions":

      {"includesubcategories":true}

      }},"cmid":4582,"courseid":68,"jointype":2,"qpage":0,"qperpage":1000,"sortdata":[],"cat":"19,25","tabname":"questions"}

      And this time it works...

      I hope this information helps fix the problem, as I will have to recreate manually a lot of quizzes!

        1. randomquiz0.png
          41 kB
          Levinch
        2. randomquiz1.png
          123 kB
          Levinch
        3. randomquiz2.png
          262 kB
          Levinch
        4. backup-moodle2-course-3-qqq-20231130-1500-nu.mbz
          8 kB
          Ilya Tregubov
        5. MDL-79708_Step 1.png
          71 kB
          Angelia Dela Cruz
        6. MDL-79708_Step 4-2.png
          67 kB
          Angelia Dela Cruz
        7. MDL-79708_Step 5-1.png
          70 kB
          Angelia Dela Cruz
        8. MDL-79708_Step 3-1.png
          68 kB
          Angelia Dela Cruz
        9. MDL-79708_Step 3-2.png
          77 kB
          Angelia Dela Cruz
        10. MDL-79708_Step 4-1.png
          70 kB
          Angelia Dela Cruz
        11. MDL-79708_Step 5-2.png
          68 kB
          Angelia Dela Cruz

            ilyatregubov Ilya Tregubov
            jerome451 Jerome Decuq
            Mihail Geshoski Mihail Geshoski
            Glyn (Mathew) May Glyn (Mathew) May
            Angelia Dela Cruz Angelia Dela Cruz
            Votes:
            9 Vote for this issue
            Watchers:
            28 Start watching this issue

              Created:
              Updated:
              Resolved:

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 2 days, 5 hours, 10 minutes
                2d 5h 10m

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