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

Question: question_created event trigger before we saved extra fields when importing question

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Minor Minor
    • 4.1.5, 4.2.2
    • 4.1.4, 4.2.1, 4.3
    • Questions
    • MOODLE_401_STABLE, MOODLE_402_STABLE, MOODLE_403_STABLE
    • MOODLE_401_STABLE, MOODLE_402_STABLE
    • MDL-78866-401
    • MDL-78866-master
    • Hide

      Because student quiz in master branch has been error with the "Exception - Class "qbank_previewquestion\preview_action_column" not found"
      So we should test it in moodle 4.2.1 & moodle 4.1.4

      Test step:

      1. Download Studentquiz Moodle Plugin (v5.1.0 (2022122200))
      2. Install it to your site 
      3. Create a question with any type in question bank -> Export it to Moodle XML format
      4. Create a Studentquiz activity -> import question with the file have exported above

      Expected:
      Import question completed without warning message.

      Show
      Because student quiz in master branch has been error with the "Exception - Class "qbank_previewquestion\preview_action_column" not found" So we should test it in moodle 4.2.1 & moodle 4.1.4 Test step: Download Studentquiz Moodle Plugin ( v5.1.0 (2022122200)) Install it to your site  Create a question with any type in question bank -> Export it to Moodle XML format Create a Studentquiz activity -> import question with the file have exported above Expected: Import question completed without warning message.

      When importing questions to Studentquiz there are some warning messages:
      True/False:

      Root cause: We can't load extra fields from each qtype due to the question_create event being called before we save the extra fields to the database.

      question/format.php:477 and question/format.php:478

      we should trigger the event after we save_question_options.

        1. image-2023-08-01-11-07-16-197.png
          45 kB
          Hieu Nguyen Dang
        2. image-2023-08-01-14-18-58-005.png
          144 kB
          Hieu Nguyen Dang
        3. MDL-78866.png
          478 kB
          Ron Carl Alfon Yu

            danghieu1407 Hieu Nguyen Dang
            danghieu1407 Hieu Nguyen Dang
            Anupama Sarjoshi Anupama Sarjoshi
            Tim Hunt Tim Hunt
            Ron Carl Alfon Yu Ron Carl Alfon Yu
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved:

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

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