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

Exception "min(): Argument #1 ($value) must contain at least one element" when attempting a Quiz

XMLWordPrintable

    • MOODLE_404_STABLE, MOODLE_500_STABLE

      Discovered while testing MDLQA-19414

      Steps to replicate

      1. Restore the attached backup
      2. Log in as student and go to the Quiz activity
      3. Click "Start attempt" button.
      4. The following exception is displayed:

      Debug info

      Exception - min(): Argument #1 ($value) must contain at least one element
       
      More information about this error
      Debug info:
      Error code: generalexceptionmessage
      Stack trace:
       
          line 119 of /question/classes/engine/variants/least_used_strategy.php: ValueError thrown
          line 119 of /question/classes/engine/variants/least_used_strategy.php: call to min()
          line 1022 of /question/engine/questionattempt.php: call to core_question\engine\variants\least_used_strategy->choose_variant()
          line 604 of /question/engine/questionusage.php: call to question_attempt->select_variant()
          line 269 of /mod/quiz/locallib.php: call to question_usage_by_activity->start_all_questions()
          line 2059 of /mod/quiz/locallib.php: call to quiz_start_new_attempt()
          line 110 of /mod/quiz/startattempt.php: call to quiz_prepare_and_start_new_attempt()
       
      Output buffer: <div class="notifytiny debuggingmessage" data-rel="debugging">Variant requested for unknown seed localhost+241204052432+GJxjhx. You must add all questions to the usage before creating the least_used_strategy. Continuing, but the variant choses may not actually be least used.<ul style="text-align: left" data-rel="backtrace"><li>line 95 of /question/classes/engine/variants/least_used_strategy.php: call to debugging()</li><li>line 1022 of /question/engine/questionattempt.php: call to core_question\engine\variants\least_used_strategy->choose_variant()</li><li>line 604 of /question/engine/questionusage.php: call to question_attempt->select_variant()</li><li>line 269 of /mod/quiz/locallib.php: call to question_usage_by_activity->start_all_questions()</li><li>line 2059 of /mod/quiz/locallib.php: call to quiz_start_new_attempt()</li><li>line 110 of /mod/quiz/startattempt.php: call to quiz_prepare_and_start_new_attempt()</li></ul></div> 
      

        1. backup-moodle2-course-5-course1-20241204-0533.mbz
          135 kB
          Simey Lameze
        2. MDL-83931.png
          147 kB
          Simey Lameze

            Unassigned Unassigned
            lameze Simey Lameze
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:

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

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