Moodle
  1. Moodle
  2. MDL-20189

Moodle XML export for calculated question produces incorrect correctanswerlength

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 1.9.5
    • Fix Version/s: 1.7.7+, 1.8.10, 1.9.6
    • Component/s: Questions
    • Labels:
      None
    • Environment:
      Don't know what specifications are for server, can find out if you want. Not 100% sure about the moodle version either, though I will check.
    • Affected Branches:
      MOODLE_19_STABLE
    • Fixed Branches:
      MOODLE_17_STABLE, MOODLE_18_STABLE, MOODLE_19_STABLE
    • Rank:
      31356

      Description

      Calculated questions exported in Moodle XML format do not set the correct "Correct Answer Shows"

      To reproduce:
      Make a new calculated question.
      Enter any name, question text "

      {x}" and correct answer formula "{x}

      ".
      Export question.

      Expected: <correctanswerlength> tag set to 2 (the default value)
      Actual: <correctanswerlength> tag is set to 1

      Importing the exported XML confirms the problem:
      Import the file you exported above.
      Edit question.
      Expected: "Correct answer shows" will still be 2 (as originally set)
      Actual: "Correct answer shows" is 1

      The value written out seems to depend on "Tolerance Type". It is 1 for geometric and relative regardless of the value set in writing the question. It is 2 for nominal regardless of the value set in writing the question.

        Activity

        Hide
        Tim Hunt added a comment -

        Calculated question type, so -> Pierre.

        Show
        Tim Hunt added a comment - Calculated question type, so -> Pierre.
        Hide
        Pierre Pichet added a comment -

        Thanks Matt for the infos.
        Effectively due to a bad copy and paste the value exported was the correctanswerformat!!.

        Show
        Pierre Pichet added a comment - Thanks Matt for the infos. Effectively due to a bad copy and paste the value exported was the correctanswerformat!!.
        Hide
        Pierre Pichet added a comment -

        CVS and merged down to 1.6
        I set Fix version 1.77 but as I CVS from 19_STABLE, 18_STABLE,17_STABLE,16_STABLE to
        19_MERGED, 18_MERGED,17_MERGED,16_MERGED it can be applied to at least last released versions of each main versions.

        Show
        Pierre Pichet added a comment - CVS and merged down to 1.6 I set Fix version 1.77 but as I CVS from 19_STABLE, 18_STABLE,17_STABLE,16_STABLE to 19_MERGED, 18_MERGED,17_MERGED,16_MERGED it can be applied to at least last released versions of each main versions.
        Hide
        Matt Craig added a comment -

        Wow, that didn't take long at all to fix! Thanks for the work you've put into Moodle.

        Show
        Matt Craig added a comment - Wow, that didn't take long at all to fix! Thanks for the work you've put into Moodle.
        Hide
        Tim Hunt added a comment -

        Just correcting fix version/s field.

        The correct way is to select the latest version from each stable branch you have fixed it on.

        The 1.7.x and 1.6.x now only have minimal support, which is why there is no 1.6.x release in the future, and only a 1.7.7+ option on that branch.

        Show
        Tim Hunt added a comment - Just correcting fix version/s field. The correct way is to select the latest version from each stable branch you have fixed it on. The 1.7.x and 1.6.x now only have minimal support, which is why there is no 1.6.x release in the future, and only a 1.7.7+ option on that branch.
        Hide
        Sam Hemelryk added a comment -

        Confirmed fixed. Thanks Pierre

        Show
        Sam Hemelryk added a comment - Confirmed fixed. Thanks Pierre

          People

          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: