When importing moodle's mbz file, the process fails
Import moodle backup in chamilo
Create a empty course
Try import a moodle's mbz (backup) file
1.11.x
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.mbzThis 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.mbzI 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 nullI 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).
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.