Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-17229 Shortanswer questiontype refactoring
  3. MDL-29095

question_type::initialise_question_instance should use extra_question_fields to get data from $questiondata->options

XMLWordPrintable

    • MOODLE_21_STABLE, MOODLE_22_STABLE
    • MOODLE_21_STABLE
    • Hide

      1) Create a shortanswer question with usecase on
      2) Re-edit it to ensure usecase value is showed correctly on the edit form
      3) Try question in the preview, changing case of the correct answer, so you are sure case is taken into account
      4) Repeat these steps with usecase off.

      Show
      1) Create a shortanswer question with usecase on 2) Re-edit it to ensure usecase value is showed correctly on the edit form 3) Try question in the preview, changing case of the correct answer, so you are sure case is taken into account 4) Repeat these steps with usecase off.

      Now question creation become more complicated, but there are no reason to use extra_question_fields() in get_question_options and not use it in initialise_question_instance. Otherwise it prevents extra_question_fields() from functioning properly.

      Shortanswer question should rely on extra_question_fields() instead of hardcoding $usecase there.

      That's actually quite easy, so please do. Preg question type class still inherited from shortanswer, and it has quite more extra question fields.

            oa_sychev Oleg Sychev
            oa_sychev Oleg Sychev
            Tim Hunt Tim Hunt
            Eloy Lafuente (stronk7) Eloy Lafuente (stronk7)
            Adrian Greeve Adrian Greeve
            Votes:
            7 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.