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

Impossible to import questions from GIFT or Moodle XML files into Lesson (2.0)

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Critical
    • Resolution: Not a bug
    • Affects Version/s: 2.0
    • Fix Version/s: None
    • Component/s: Lesson
    • Affected Branches:
      MOODLE_20_STABLE

      Description

      Impossible to import questions from GIFT or Moodle XML files into Lesson (2.0).
      Getting error messages:
      Warning: mysqli::real_escape_string() expects parameter 1 to be string, array given in \moodle\lib\dml\mysqli_native_moodle_database.php on line 661
      See http://moodle.org/mod/forum/discuss.php?d=167980

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

              Hide
              tsala Helen Foster added a comment -

              Joseph, thanks for your report. I notice that the forum discussion has an example GIFT file attached.

              Show
              tsala Helen Foster added a comment - Joseph, thanks for your report. I notice that the forum discussion has an example GIFT file attached.
              Hide
              skodak Petr Skoda added a comment -

              eh, this is going to be a lot of work, seems like somebody changed the question format API without thinking much about lesson code...

              Show
              skodak Petr Skoda added a comment - eh, this is going to be a lot of work, seems like somebody changed the question format API without thinking much about lesson code...
              Hide
              tlock Tim Lock added a comment -

              Feedback on 2.1.6 with Question / Lesson importing.

              Importing of that gift export isn't liked by Moodle for some reason.

              Course > Question -> Import -> GIFT :

              Import questions from file
              Import
              The type of the file you selected (document/unknown) does not match the type expected by this import format (text/plain).

              BUT works from within Lesson.

              Import questions
              Importing 10 questions

              Show
              tlock Tim Lock added a comment - Feedback on 2.1.6 with Question / Lesson importing. Importing of that gift export isn't liked by Moodle for some reason. Course > Question -> Import -> GIFT : Import questions from file Import The type of the file you selected (document/unknown) does not match the type expected by this import format (text/plain). BUT works from within Lesson. Import questions Importing 10 questions
              Hide
              jmvedrine Jean-Michel Vedrine added a comment -

              Hello Tim,
              Your problem is not related to the present issue (MDL-26273) but is somewhat related to MDL-28364.
              But MDL-28364 is fixed since Moodle 2.1.5, so most probably your file don't have the right extension.
              For a gift file the extension should be .txt because as the error message said a text/plain file is expected. Rename your file and try again to import it.
              It works with lesson because lesson is using a different (older) code that don't verify the mimetype of the file.

              Show
              jmvedrine Jean-Michel Vedrine added a comment - Hello Tim, Your problem is not related to the present issue ( MDL-26273 ) but is somewhat related to MDL-28364 . But MDL-28364 is fixed since Moodle 2.1.5, so most probably your file don't have the right extension. For a gift file the extension should be .txt because as the error message said a text/plain file is expected. Rename your file and try again to import it. It works with lesson because lesson is using a different (older) code that don't verify the mimetype of the file.
              Hide
              jmvedrine Jean-Michel Vedrine added a comment -

              By the way, I just discovered this issue (Mdl-26273). Joseph can you tell me if it is fixed or not ? if this is still a problem, I can have a look at it, seems pretty similar to the changes already done in question code .

              Show
              jmvedrine Jean-Michel Vedrine added a comment - By the way, I just discovered this issue (Mdl-26273). Joseph can you tell me if it is fixed or not ? if this is still a problem, I can have a look at it, seems pretty similar to the changes already done in question code .
              Hide
              rezeau Joseph Rézeau added a comment -

              Import of GIFT and Moodle XML questions into Lesson works fine with current Moodle 2.3.

              Show
              rezeau Joseph Rézeau added a comment - Import of GIFT and Moodle XML questions into Lesson works fine with current Moodle 2.3.
              Hide
              rajeshtaneja Rajesh Taneja added a comment -

              Hello Joseph,

              It seems this issue has been fixed. Shall we close this issue or you are still facing this issue on (any) 2.x branch?

              Show
              rajeshtaneja Rajesh Taneja added a comment - Hello Joseph, It seems this issue has been fixed. Shall we close this issue or you are still facing this issue on (any) 2.x branch?
              Hide
              rezeau Joseph Rézeau added a comment -

              The issue is fixed on 2.3.

              Show
              rezeau Joseph Rézeau added a comment - The issue is fixed on 2.3.
              Hide
              rajeshtaneja Rajesh Taneja added a comment -

              Thanks Joseph,

              Closing this issue as it's not a bug anymore.

              Show
              rajeshtaneja Rajesh Taneja added a comment - Thanks Joseph, Closing this issue as it's not a bug anymore.

                People

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

                  Dates

                  • Created:
                    Updated:
                    Resolved: