Details

    • Type: Sub-task Sub-task
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 2.1
    • Fix Version/s: 2.1
    • Component/s: Questions
    • Labels:
      None
    • Testing Instructions:
      Hide
      1. Create a course with one or more of each type of questions, including enough questions to cover all the different options of each question type.
      2. Export these questions using Moodle XML format.
      3. Verify that there are no error messages during export.
      4. Import them again into a different course.
      5. Compare the original and imported questions by opening them side-by-side in the question edit form, and ensure that all the options have been carried over accurately.

      For extra credit, also

      1. Create a full set of questions in a Moodle 2.0 site.
      2. Export them and import them into your 2.1 site.
      3. Verify that all the options from 2.0 have been transferred accurately, and that any new options in 2.1 have been set to the default value.
      Show
      Create a course with one or more of each type of questions, including enough questions to cover all the different options of each question type. Export these questions using Moodle XML format. Verify that there are no error messages during export. Import them again into a different course. Compare the original and imported questions by opening them side-by-side in the question edit form, and ensure that all the options have been carried over accurately. For extra credit, also Create a full set of questions in a Moodle 2.0 site. Export them and import them into your 2.1 site. Verify that all the options from 2.0 have been transferred accurately, and that any new options in 2.1 have been set to the default value.
    • Affected Branches:
      MOODLE_21_STABLE
    • Fixed Branches:
      MOODLE_21_STABLE
    • Pull from Repository:
    • Pull Master Branch:
    • Rank:
      17662

      Description

        Activity

        Hide
        Tim Hunt added a comment -

        Note that this branch includes the fix for MDL-27854 which I found and fixed while testing this new work.

        Show
        Tim Hunt added a comment - Note that this branch includes the fix for MDL-27854 which I found and fixed while testing this new work.
        Hide
        Eloy Lafuente (stronk7) added a comment -

        Integrated, thanks!

        PS: Bloody code-checker, lol!

        Show
        Eloy Lafuente (stronk7) added a comment - Integrated, thanks! PS: Bloody code-checker, lol!
        Hide
        Sam Hemelryk added a comment -

        Hi guys,

        Failing this as I got the following during the import operation:

        Warning: trim() expects parameter 1 to be string, array given in /var/git/integration/master/question/format/xml/format.php on line 88
        Call Stack

        1. Time Memory Function Location
          1 0.0009 721448
          Unknown macro: {main}

          ( ) ../import.php:0
          2 0.4970 80574672 qformat_default->importprocess( ) ../import.php:121
          3 0.5262 88940144 qformat_xml->readquestions( ) ../format.php:314
          4 0.5318 89693264 qformat_xml->import_calculated( ) ../format.php:911
          5 0.5323 89700168 qformat_xml->trans_single( ) ../format.php:714
          6 0.5323 89700248 trim ( ) ../format.php:88
          Error importing question Question type calculatedmulti is not supported by XML import
          Error importing question Question type calculatedsimple is not supported by XML import

          ( ! ) Notice: Undefined variable: question in /var/git/integration/master/question/format/xml/format.php on line 441
          Call Stack

          1. Time Memory Function Location
            1 0.0009 721448

          ( ) ../import.php:0
          2 0.4970 80574672 qformat_default->importprocess( ) ../import.php:121
          3 0.5262 88940144 qformat_xml->readquestions( ) ../format.php:314
          4 0.5721 93118904 qformat_xml->import_multianswer( ) ../format.php:907
          Importing 12 questions from file
          Error(s) found parsing the import file. No questions have been imported. To import any good questions try again setting 'Stop on error' to 'No

        Will attach the XML file I was using for reference.

        Cheers
        Sam

        Show
        Sam Hemelryk added a comment - Hi guys, Failing this as I got the following during the import operation: Warning: trim() expects parameter 1 to be string, array given in /var/git/integration/master/question/format/xml/format.php on line 88 Call Stack Time Memory Function Location 1 0.0009 721448 Unknown macro: {main} ( ) ../import.php:0 2 0.4970 80574672 qformat_default->importprocess( ) ../import.php:121 3 0.5262 88940144 qformat_xml->readquestions( ) ../format.php:314 4 0.5318 89693264 qformat_xml->import_calculated( ) ../format.php:911 5 0.5323 89700168 qformat_xml->trans_single( ) ../format.php:714 6 0.5323 89700248 trim ( ) ../format.php:88 Error importing question Question type calculatedmulti is not supported by XML import Error importing question Question type calculatedsimple is not supported by XML import ( ! ) Notice: Undefined variable: question in /var/git/integration/master/question/format/xml/format.php on line 441 Call Stack Time Memory Function Location 1 0.0009 721448 ( ) ../import.php:0 2 0.4970 80574672 qformat_default->importprocess( ) ../import.php:121 3 0.5262 88940144 qformat_xml->readquestions( ) ../format.php:314 4 0.5721 93118904 qformat_xml->import_multianswer( ) ../format.php:907 Importing 12 questions from file Error(s) found parsing the import file. No questions have been imported. To import any good questions try again setting 'Stop on error' to 'No Will attach the XML file I was using for reference. Cheers Sam
        Hide
        Sam Hemelryk added a comment -

        Screenshot of errors

        Show
        Sam Hemelryk added a comment - Screenshot of errors
        Hide
        Tim Hunt added a comment -

        Grrr! but should be easy to fix. Thanks for finding this Sam.

        Show
        Tim Hunt added a comment - Grrr! but should be easy to fix. Thanks for finding this Sam.
        Hide
        Tim Hunt added a comment -

        I think https://github.com/timhunt/moodle/compare/master...MDL-27797_fixup is the correct fix, but I need to do a bit of testing before submitting for integration.

        Note that one of the bugs was in the export process, so the attached XML file is broken, and I would not expect it to import.

        Show
        Tim Hunt added a comment - I think https://github.com/timhunt/moodle/compare/master...MDL-27797_fixup is the correct fix, but I need to do a bit of testing before submitting for integration. Note that one of the bugs was in the export process, so the attached XML file is broken, and I would not expect it to import.
        Hide
        Tim Hunt added a comment -

        OK https://github.com/timhunt/moodle/compare/master...MDL-27797_fixup is ready for integration to fix the problems that caused testing to fail.

        Show
        Tim Hunt added a comment - OK https://github.com/timhunt/moodle/compare/master...MDL-27797_fixup is ready for integration to fix the problems that caused testing to fail.
        Hide
        Eloy Lafuente (stronk7) added a comment -

        Integrated and tested, 2 notes:

        1) it breaks badly with randomsamatch questions.
        2) The UI should be improved a bit and make the "get category from file" option to disable the category picked (that should be below IMO). I did select one category just to discover the questions had been imported in another one (the original, hence I got dupes questions)

        Show
        Eloy Lafuente (stronk7) added a comment - Integrated and tested, 2 notes: 1) it breaks badly with randomsamatch questions. 2) The UI should be improved a bit and make the "get category from file" option to disable the category picked (that should be below IMO). I did select one category just to discover the questions had been imported in another one (the original, hence I got dupes questions)
        Hide
        Tim Hunt added a comment -

        I added a note about 1. to MDL-27414

        If you care about 2., please file it as a separate issue. Thanks.

        Show
        Tim Hunt added a comment - I added a note about 1. to MDL-27414 If you care about 2., please file it as a separate issue. Thanks.
        Hide
        Eloy Lafuente (stronk7) added a comment -

        Upstream, upstream, this is part of upstream, upstream... thanks!

        Show
        Eloy Lafuente (stronk7) added a comment - Upstream, upstream, this is part of upstream, upstream... thanks!

          People

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

            Dates

            • Created:
              Updated:
              Resolved: