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

Importing incomplete calculated questions cases notices

XMLWordPrintable

    • MOODLE_27_STABLE
    • MOODLE_26_STABLE, MOODLE_27_STABLE
    • 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.

      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
        

            timhunt Tim Hunt
            ankit_frenz Ankit Agarwal
            Sam Marshall Sam Marshall
            Marina Glancy Marina Glancy
            Jetha Chan Jetha Chan
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved:

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