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

Add random question to quiz gives get_in_or_equal()+empty array error if the user does not have moodle/question:useall

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Critical
    • Resolution: Fixed
    • Affects Version/s: 3.6.1, 3.7, 3.8
    • Fix Version/s: 3.6.5, 3.7.1
    • Component/s: Quiz
    • Labels:
    • Sprint:
      Internationals - 3.8 Sprint 2

      Description

      Edit/override the teacher role so that it only has moodle/question:usemine, but not moodle/question:useall.

      On the edit quiz page, choose Add -> a random questions.

      Actual result: 

      Error code: codingerror

      • line 770 of /lib/dml/moodle_database.php: coding_exception thrown
      • line 1311 of /lib/questionlib.php: call to moodle_database->get_in_or_equal()
      • line 58 of /mod/quiz/addrandomform.php: call to question_get_top_categories_for_contexts()
      • line 204 of /lib/formslib.php: call to quiz_add_random_form->definition()
      • line 2504 of /mod/quiz/lib.php: call to moodleform->__construct()
      • line 7775 of /lib/moodlelib.php: call to mod_quiz_output_fragment_add_random_question_form()
      • line 415 of /lib/external/externallib.php: call to component_callback()
      • line 244 of /lib/externallib.php: call to core_external::get_fragment()
      • line 59 of /lib/ajax/service.php: call to external_api::call_external_function()

      Expected result: ... well, either the menu option should not appear in this case, or the pop-up needs to show a user-friendly message about why you can't do it.

        Attachments

          Activity

            People

            Assignee:
            rezaie9 Shamim Rezaie
            Reporter:
            bmontaru bill monte
            Peer reviewer:
            Tim Hunt
            Integrator:
            Eloy Lafuente (stronk7)
            Tester:
            CiBoT
            Participants:
            Component watchers:
            Tim Hunt, Andrew Nicols, Jun Pataleta, Michael Hawkins, Shamim Rezaie, Simey Lameze
            Votes:
            1 Vote for this issue
            Watchers:
            5 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Fix Release Date:
              8/Jul/19

                Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 5 hours, 30 minutes
                5h 30m