Chamilo-lms: Restore course from Moodle backup is broken

Created on 22 Nov 2018  路  5Comments  路  Source: chamilo/chamilo-lms

Current behavior / Resultado actual / R茅sultat actuel

When importing moodle's mbz file, the process fails

Expected behavior / Resultado esperado / R茅sultat attendu

Import moodle backup in chamilo

Steps to reproduce / Pasos para reproducir / 脡tapes pour reproduire

Create a empty course
Try import a moodle's mbz (backup) file

Chamilo Version / Versi贸n de Chamilo / Version de Chamilo

1.11.x

Bug Requires testinvalidation

Most helpful comment

I just checked again and now it is all working well. The moodle 2.7.7 course has been imported correctly here : https://11.chamilo.org/courses/NOUVEAUTESTIMPORTMOODLE277/index.php?id_session=0

So it looks all good for me, I will try to get some more moodle course to test it a bit more.

All 5 comments

Just a little precision that can help in analysing the problem :

The moodle's course import in Chamilo has been developped based on a moodle 2.7.7 version and it seems that in version 3 of moodle they have changed the course export format.

I put here a link to one of the example files that has been used to do the first implementation :

Then a few examples of files exported from moodle 3 or higher that do not work :

Angel I tested and there is a problem with importation of the file from moodle 2.7.7

* moodle 2.7.7 :
  https://task.beeznest.com/attachments/download/18977/backup-moodle2-course-8-dfjw_-_an_der_rezeption-20161115-2110.mbz

I tried to import this one here https://11.chamilo.org/main/coursecopy/import_moodle.php?cidReq=TESTIMPORTMOODLE277DFJWDERREZ&id_session=0&gidReq=0&gradebook=0&origin= and I get an error while importing :

`An exception occurred while executing 'INSERT INTO c_quiz (c_id,start_time,end_time,title,description,sound,type,random,random_answers,active,results_disabled,max_attempt,feedback_type,expired_time,session_id,review_answers,random_by_category,text_when_finished,display_category_name,pass_percentage,save_correct_answers,propagate_neg,hide_question_title) VALUES (:c_id, :start_time, :end_time, :title, :description, :sound, :type, :random, :random_answers, :active, :results_disabled, :max_attempt, :feedback_type, :expired_time, :session_id, :review_answers, :random_by_category, :text_when_finished, :display_category_name, :pass_percentage, :save_correct_answers, :propagate_neg, :hide_question_title)' with params ["526", null, null, "", null, "", 1, 0, null, 1, 1, 0, 0, 0, 0, 0, 0, "", 0, 0, 0, 0, 0]: SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'random_answers' cannot be null

Then a few examples of files exported from moodle 3 or higher that do not work :

* moodle 3.3.2
  https://task.beeznest.com/attachments/download/26729/sauvegarde-moodle2-course-4-pe_-_module_1-20180903-1011-nu.mbz

This one seems to be working well, imported here : https://11.chamilo.org/courses/TESTIMPORTMOODLE332SAUVEGARDEMOOD/index.php?id_session=0

* moodle 3.4
  https://task.beeznest.com/attachments/download/23430/course-2-ejemplo-20171115-1708-nu.zip
  https://task.beeznest.com/attachments/download/23429/course-2-ejemplo-20171115-1653.mbz

This one worked correctly here https://11.chamilo.org/courses/TESTIMPORTMOODLE34COURSE2EJEMPLO/index.php?id_session=0

Angel I tested and there is a problem with importation of the file from moodle 2.7.7

* moodle 2.7.7 :
  https://task.beeznest.com/attachments/download/18977/backup-moodle2-course-8-dfjw_-_an_der_rezeption-20161115-2110.mbz

I tried to import this one here https://11.chamilo.org/main/coursecopy/import_moodle.php?cidReq=TESTIMPORTMOODLE277DFJWDERREZ&id_session=0&gidReq=0&gradebook=0&origin= and I get an error while importing :

`An exception occurred while executing 'INSERT INTO c_quiz (c_id,start_time,end_time,title,description,sound,type,random,random_answers,active,results_disabled,max_attempt,feedback_type,expired_time,session_id,review_answers,random_by_category,text_when_finished,display_category_name,pass_percentage,save_correct_answers,propagate_neg,hide_question_title) VALUES (:c_id, :start_time, :end_time, :title, :description, :sound, :type, :random, :random_answers, :active, :results_disabled, :max_attempt, :feedback_type, :expired_time, :session_id, :review_answers, :random_by_category, :text_when_finished, :display_category_name, :pass_percentage, :save_correct_answers, :propagate_neg, :hide_question_title)' with params ["526", null, null, "", null, "", 1, 0, null, 1, 1, 0, 0, 0, 0, 0, 0, "", 0, 0, 0, 0, 0]: SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'random_answers' cannot be null

I can't reproduce this error in my local installation. But I supposed it is because there is missing a param. I sent a commit for this.

I just checked again and now it is all working well. The moodle 2.7.7 course has been imported correctly here : https://11.chamilo.org/courses/NOUVEAUTESTIMPORTMOODLE277/index.php?id_session=0

So it looks all good for me, I will try to get some more moodle course to test it a bit more.

I'm closing this. Although the Moodle import is a nice feature, it is a "nice to have", not a priority (for now).

Was this page helpful?
0 / 5 - 0 ratings

Related issues

sjcqs picture sjcqs  路  6Comments

yourKatharsis picture yourKatharsis  路  7Comments

480419140 picture 480419140  路  5Comments

ywarnier picture ywarnier  路  3Comments

vfremaux picture vfremaux  路  5Comments