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

Cannot properly create a shared dataset for calculated questions

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: Minor Minor
    • None
    • 4.0.2
    • Questions
    • MOODLE_400_STABLE

      To reproduce, create a new calculated question:

       

      • In "Question text" write "{a}"
      • In "Answer 1 formula =" write "{a}/2"
      • In "Grade" write "100%"
      • Click "Save Changes"
      • In "Wild card {a}" choose "Will use an already existing shared dataset"
      • Click "Next page"

       

      What you get is an error like this:

       

            Field "questionid" does not exist in table "quiz_slots"

       

      The stack trace:

      Stack trace:

      • line 672 of /lib/dml/moodle_database.php: dml_exception thrown
      • line 1919 of /lib/dml/moodle_database.php: call to moodle_database->where_clause()
      • line 1762 of /question/type/calculated/questiontype.php: call to moodle_database->count_records()
      • line 133 of /question/type/calculated/datasetitems_form.php: call to qtype_calculated->print_dataset_definitions_category_shared()
      • line 214 of /lib/formslib.php: call to question_dataset_dependent_items_form->definition()
      • line 114 of /question/type/calculated/datasetitems_form.php: call to moodleform->__construct()
      • line 412 of /question/type/calculated/questiontype.php: call to question_dataset_dependent_items_form->__construct()
      • line 201 of /question/bank/editquestion/question.php: call to qtype_calculated->next_wizard_form()

       

      The code that is causing the exception is here:

      https://github.com/moodle/moodle/blob/73d604369d26e7dda837b1ce5a5564dbe2054015/question/type/calculated/questiontype.php#L1762-L1768

       

       

            Unassigned Unassigned
            jsegarra Juan Segarra Montesinos
            Votes:
            1 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved:

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