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

question_type::export_to_xml misses files in answers & feedback when using extra_answer_fields

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Minor Minor
    • 2.1.6, 2.2.3
    • 2.1.5, 2.2.2
    • Questions
    • MOODLE_21_STABLE, MOODLE_22_STABLE
    • MOODLE_21_STABLE, MOODLE_22_STABLE
    • Hide

      To test this, you need to install a third-party question type that relies on the extra_answer_fields functionality, and the question type base class implementation of export_to_xml. I will use qtype_varnumericset here.

      0. Type
      git clone git://github.com/moodleou/moodle-qtype_varnumericset.git question/type/varnumericset
      or
      git clone -b MOODLE_21_STABLE git://github.com/moodleou/moodle-qtype_varnumericset.git question/type/varnumericset
      in the root of your Moodle install, as applicable. The go to admin to let the plugin install itself.

      1. Create a new varnumericset question in the question bank:
      Question name: VNS
      Question text: What is [[a]] + [[b]]?
      Variable 1: Predefined variable
      Name: a
      Value for variant 1: 1
      Value for variant 2: 2
      Variable 2: Predefined variable
      Name: b
      Value for variant 1: 3
      Value for variant 2: 4
      Answer 1: a + b
      Answer 1 grade: 100%
      Answer 1 feedback: Well done and then add an image in this HTML editor.
      then Save changes.

      1.5 You should probably also create some standard Moodle question in the same category, to make sure there are no regressions there.

      2. Export the category containing this question as Moodle XML.

      3. Import the XML file into another course.

      4. Edit the imported question, and make sure the image is still there in the answer feedback.

      4.5 If you made extra questions in step 1.5, check those too.

      Show
      To test this, you need to install a third-party question type that relies on the extra_answer_fields functionality, and the question type base class implementation of export_to_xml. I will use qtype_varnumericset here. 0. Type git clone git://github.com/moodleou/moodle-qtype_varnumericset.git question/type/varnumericset or git clone -b MOODLE_21_STABLE git://github.com/moodleou/moodle-qtype_varnumericset.git question/type/varnumericset in the root of your Moodle install, as applicable. The go to admin to let the plugin install itself. 1. Create a new varnumericset question in the question bank: Question name: VNS Question text: What is [ [a] ] + [ [b] ]? Variable 1: Predefined variable Name: a Value for variant 1: 1 Value for variant 2: 2 Variable 2: Predefined variable Name: b Value for variant 1: 3 Value for variant 2: 4 Answer 1: a + b Answer 1 grade: 100% Answer 1 feedback: Well done and then add an image in this HTML editor. then Save changes. 1.5 You should probably also create some standard Moodle question in the same category, to make sure there are no regressions there. 2. Export the category containing this question as Moodle XML. 3. Import the XML file into another course. 4. Edit the imported question, and make sure the image is still there in the answer feedback. 4.5 If you made extra questions in step 1.5, check those too.

      Actually, there was a TODO in the code saying that this code should be refactored to use $format->write_answer, and that will fix this problem.

            timhunt Tim Hunt
            timhunt Tim Hunt
            Dan Poltawski Dan Poltawski
            Dan Poltawski Dan Poltawski
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:

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