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

Importing incomplete calculated questions cases notices

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.7
    • Fix Version/s: 2.6.5, 2.7.2
    • Component/s: Questions
    • Labels:
    • Testing Instructions:
      Hide
      1. Go to the question bank.
      2. Create a new question category 'Export test'
      3. Click Create question... and select Calculated question type.
      4. Complete the first page of the form, setting Category Export test, and then Save changes.
      5. Don't complete the second page of the form. Instead us the Admin block to go back to the question bank.
      6. Now create a proper calculated question (or http://docs.moodle.org/27/en/Simple_calculated_question_type if you want something easier.)
      7. Export category 'Export test' in Moodle XML format
      8. Import the exported file.
      9. Verify that the import completes with no notices.
      10. Verify that the complete question you made had all the data correctly transferred.
      Show
      Go to the question bank. Create a new question category 'Export test' Click Create question... and select Calculated question type. Complete the first page of the form, setting Category Export test, and then Save changes. Don't complete the second page of the form. Instead us the Admin block to go back to the question bank. Now create a proper calculated question (or http://docs.moodle.org/27/en/Simple_calculated_question_type if you want something easier.) Export category 'Export test' in Moodle XML format Import the exported file. Verify that the import completes with no notices. Verify that the complete question you made had all the data correctly transferred.
    • Affected Branches:
      MOODLE_27_STABLE
    • Fixed Branches:
      MOODLE_26_STABLE, MOODLE_27_STABLE
    • Pull from Repository:
    • Pull Master Branch:

      Description

      This was noticed while testing MDL-46212

      Replication:-

      1. Go to the question bank.
      2. Create a new question category 'Export test'
      3. Click Create question... and select Calculated question type.
      4. Complete the first page of the form, setting Category Export test, and then Save changes.
      5. Don't complete the second page of the form. Instead us the Admin block to go back to the question bank.
      6. Export category 'Export test' in Moodle XML format
      7. Import the exported file.
      8. There should be no notices, but following are produced:-

        Parsing questions from import file.
         
        ( ! ) Notice: Undefined index: number_of_items in /var/www/int/master/moodle/question/format/xml/format.php on line 860
        Call Stack
        #	Time	Memory	Function	Location
        1	0.0003	287648	{main}( )	../import.php:0
        2	0.3330	45544800	qformat_default->importprocess( )	../import.php:119
        3	0.3335	45602224	qformat_xml->readquestions( )	../format.php:303
        4	0.3368	45793520	qformat_xml->import_questions( )	../format.php:915
        5	0.3368	45795592	qformat_xml->import_question( )	../format.php:927
        6	0.3368	45797824	qformat_xml->import_calculated( )	../format.php:961
         
        ( ! ) Notice: Undefined index: dataset_items in /var/www/int/master/moodle/question/format/xml/format.php on line 861
        Call Stack
        #	Time	Memory	Function	Location
        1	0.0003	287648	{main}( )	../import.php:0
        2	0.3330	45544800	qformat_default->importprocess( )	../import.php:119
        3	0.3335	45602224	qformat_xml->readquestions( )	../format.php:303
        4	0.3368	45793520	qformat_xml->import_questions( )	../format.php:915
        5	0.3368	45795592	qformat_xml->import_question( )	../format.php:927
        6	0.3368	45797824	qformat_xml->import_calculated( )	../format.php:961
         
        ( ! ) Warning: Invalid argument supplied for foreach() in /var/www/int/master/moodle/question/format/xml/format.php on line 862
        Call Stack
        #	Time	Memory	Function	Location
        1	0.0003	287648	{main}( )	../import.php:0
        2	0.3330	45544800	qformat_default->importprocess( )	../import.php:119
        3	0.3335	45602224	qformat_xml->readquestions( )	../format.php:303
        4	0.3368	45793520	qformat_xml->import_questions( )	../format.php:915
        5	0.3368	45795592	qformat_xml->import_question( )	../format.php:927
        6	0.3368	45797824	qformat_xml->import_calculated( )	../format.php:961
         
        ( ! ) Notice: Undefined index: number_of_items in /var/www/int/master/moodle/question/format/xml/format.php on line 860
        Call Stack
        #	Time	Memory	Function	Location
        1	0.0003	287648	{main}( )	../import.php:0
        2	0.3330	45544800	qformat_default->importprocess( )	../import.php:119
        3	0.3335	45602224	qformat_xml->readquestions( )	../format.php:303
        4	0.3368	45793520	qformat_xml->import_questions( )	../format.php:915
        5	0.3368	45795592	qformat_xml->import_question( )	../format.php:927
        6	0.3368	45797824	qformat_xml->import_calculated( )	../format.php:961
         
        ( ! ) Notice: Undefined index: dataset_items in /var/www/int/master/moodle/question/format/xml/format.php on line 861
        Call Stack
        #	Time	Memory	Function	Location
        1	0.0003	287648	{main}( )	../import.php:0
        2	0.3330	45544800	qformat_default->importprocess( )	../import.php:119
        3	0.3335	45602224	qformat_xml->readquestions( )	../format.php:303
        4	0.3368	45793520	qformat_xml->import_questions( )	../format.php:915
        5	0.3368	45795592	qformat_xml->import_question( )	../format.php:927
        6	0.3368	45797824	qformat_xml->import_calculated( )	../format.php:961
         
        ( ! ) Warning: Invalid argument supplied for foreach() in /var/www/int/master/moodle/question/format/xml/format.php on line 862
        Call Stack
        #	Time	Memory	Function	Location
        1	0.0003	287648	{main}( )	../import.php:0
        2	0.3330	45544800	qformat_default->importprocess( )	../import.php:119
        3	0.3335	45602224	qformat_xml->readquestions( )	../format.php:303
        4	0.3368	45793520	qformat_xml->import_questions( )	../format.php:915
        5	0.3368	45795592	qformat_xml->import_question( )	../format.php:927
        6	0.3368	45797824	qformat_xml->import_calculated( )	../format.php:961
        Importing 5 questions from file
        1. "What is {={A}+{B}} - {A}?"
         
        2. test
         
        3. test
         
        4. Matching
         
        5. Matching
        

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                timhunt Tim Hunt
                Reporter:
                ankit_frenz Ankit Agarwal
                Peer reviewer:
                Sam Marshall
                Integrator:
                Marina Glancy
                Tester:
                Jetha Chan
                Participants:
                Component watchers:
                Tim Hunt, Andrew Nicols, Mathew May, Michael Hawkins, Shamim Rezaie, Simey Lameze
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Fix Release Date:
                  8/Sep/14