Moodle
  1. Moodle
  2. MDL-28349

question import for GIFT essay questions throws db exception

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 2.1, 2.2
    • Fix Version/s: 2.1.2
    • Component/s: Questions
    • Labels:
    • Environment:
      Ubuntu 10.04, ESX virtual machine
    • Database:
      MySQL
    • Testing Instructions:
      Hide

      1. Get an example GIFT file including an essay question. For example question/format/gift/simpletest/fixtures/questions.gift.txt
      2. Import it, check there are no errors.
      3. Check that the imported Essay question is OK.

      Show
      1. Get an example GIFT file including an essay question. For example question/format/gift/simpletest/fixtures/questions.gift.txt 2. Import it, check there are no errors. 3. Check that the imported Essay question is OK.
    • Affected Branches:
      MOODLE_21_STABLE, MOODLE_22_STABLE
    • Fixed Branches:
      MOODLE_21_STABLE
    • Pull from Repository:
    • Pull Master Branch:
    • Rank:
      18069

      Description

      On fresh install of Moodle 2.1 (Build: 20110713)

      Attempting to import a sample GIFT essay question,

      Write a short biography of Dag Hammarskjöld. {}

      results in a dml_write_exception when trying to insert the record in the database. A debug message is also shown.

      The question does appear in the question bank however, but continued processing of additional questions stops.

      Debug message follows:
      Notice: Undefined property: stdClass::$responseformat in /home/moodle/public_html/public/question/type/essay/questiontype.php on line 63 Notice: Undefined property: stdClass::$responsefieldlines in /home/moodle/public_html/public/question/type/essay/questiontype.php on line 64 Notice: Undefined property: stdClass::$attachments in /home/moodle/public_html/public/question/type/essay/questiontype.php on line 65 Notice: Undefined property: stdClass::$graderinfo in /home/moodle/public_html/public/question/type/essay/questiontype.php on line 66 Notice: Undefined property: stdClass::$graderinfo in /home/moodle/public_html/public/question/type/essay/questiontype.php on line 68

        Activity

        Hide
        Eloy Lafuente (stronk7) added a comment -

        Silly Q before integration: It seems that the structure returned after the change does not match the one built into the simpletest expectation. Is that Ok?

        Ciao

        Show
        Eloy Lafuente (stronk7) added a comment - Silly Q before integration: It seems that the structure returned after the change does not match the one built into the simpletest expectation. Is that Ok? Ciao
        Hide
        Tim Hunt added a comment -

        Are you saying that the unit test fails?

        Show
        Tim Hunt added a comment - Are you saying that the unit test fails?
        Hide
        Eloy Lafuente (stronk7) added a comment -

        No, I'm saying the structure is different in real life and in expectations, just that.

        Show
        Eloy Lafuente (stronk7) added a comment - No, I'm saying the structure is different in real life and in expectations, just that.
        Hide
        Tim Hunt added a comment -

        Well, the unit test is using an expectation called Check Specified Fields. The point is to test the important bits, not every detail, I guess.

        Show
        Tim Hunt added a comment - Well, the unit test is using an expectation called Check Specified Fields. The point is to test the important bits, not every detail, I guess.
        Hide
        Eloy Lafuente (stronk7) added a comment -

        Ah, got it, what confused me was the last part of the patch:

        https://github.com/timhunt/moodle/compare/master...MDL-28349#L2R90

        I thought it was another expectation and surprised me the structure was different. But it's part of another (export) test, not an expectation.

        Thanks!

        Show
        Eloy Lafuente (stronk7) added a comment - Ah, got it, what confused me was the last part of the patch: https://github.com/timhunt/moodle/compare/master...MDL-28349#L2R90 I thought it was another expectation and surprised me the structure was different. But it's part of another (export) test, not an expectation. Thanks!
        Hide
        Eloy Lafuente (stronk7) added a comment -

        Integrated, thanks!

        Show
        Eloy Lafuente (stronk7) added a comment - Integrated, thanks!
        Hide
        Eloy Lafuente (stronk7) added a comment -

        Passing this. Import worked perfectly and unittests are passing too.

        I've created MDL-28977 for a problem found in the import form.

        Ciao

        Show
        Eloy Lafuente (stronk7) added a comment - Passing this. Import worked perfectly and unittests are passing too. I've created MDL-28977 for a problem found in the import form. Ciao
        Hide
        Eloy Lafuente (stronk7) added a comment -

        Closing, this is now part of Moodle. Big thanks!

        Show
        Eloy Lafuente (stronk7) added a comment - Closing, this is now part of Moodle. Big thanks!

          People

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

            Dates

            • Created:
              Updated:
              Resolved: