-
Notifications
You must be signed in to change notification settings - Fork 55
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Import quiz error + Number of topics reduced to 1 #203
Comments
Can't replicate: Grid_203_sm2.mp4 |
Hello Gareth https://github.com/gjbarnard/moodle-format_grid/assets/5620195/d368bc8c-6453-4c9a-a1b6-bf83b6ea5b5a importar.GRID_itaca.mp4But if I change the format of the destination course to topics, the importation occurs as expected. importar.GRID_itaca_topics-2024-03-14_17.04.46.mp4Do you have any idea what could be causing this error? To expedite matters for the teachers, I installed the Sharing Cart block, and they are able to import from one course to another. Thank you for your time in testing this case. |
Dear @giselebrugger, Theme won't matter in this case and as you can see, I do Grid to Grid and can't replicate. Gareth |
And previously you stated 403.1.2 (in development) and now 403.1.1 and yet there isn't anything different between the two that would 'fix' this if it occurred. |
Hello Gareth I did one more test. Could you confirm the type of question in your quiz? |
I just had one true/false question, but that won't make a difference. As stated, I can't replicate when performing a partial import with just the quiz in the section. |
Also @giselebrugger are there any errors in the PHP error log? |
Hello @gjb2048 But when there is any quiz in the import it resets the number of topics to 1 and the quiz does not matter. |
The quiz is a Red Herring, because I can't replicate with a quiz so it must be something else. Was there anything in the PHP log file?
|
Some more tests done. 2- when I select just a few items to import and if there is a quiz among them, all resources and activities are imported except the quiz and the number of topics is changed to 1. see course modules before import In this situation I found the following error in the Apache log course sections after import (only 2 sections e no more 10 ) the session 27594 was not created and module 38038 (quiz) exist If i access mymoodle/mod/quiz/view.php?id=38038 This is becoming a mystery :) |
No idea! |
Turn on developer level debugging, try again and see what errors occur - even in the log. |
with debug mode developer and course empty importar.GRID_feluma_com_quiz-2024-03-17_20.23.30.mp4LOG apache see this: |
In that case no idea, and looks like it's not related to the Grid code. |
I took another test. TOPICS: GRID when is GRID have 2 more lines Section not fully restored: id 27605, referer: https://ava.cmmg.edu.br/backup/import.php |
Ok, still stumped. Only thing I can think of is to have a copy of the course with the issue (mbz file without users) and see if I can replicate locally. If so then look at attaching the debugger and attempting to deduce what is going on. |
Hello |
@giselebrugger Thanks, done, and can replicate - odd. |
@giselebrugger Try removing this line https://github.com/gjbarnard/moodle-format_grid/blob/main/backup/moodle2/restore_format_grid_plugin.class.php#L190 and see if it fixes it for you. |
@gjb2048 YESSSSSSSSSSSSSSSSSSSSSSSSS |
@giselebrugger I did manage to replicate, all a bit odd. The backup / restore code / logic is difficult! |
Hi, Nice debugging! 👍 We have a similar problem with one course using Grid format. Some of the course sections can not be imported or restored to another course, although there are only a couple of file and URL resources. Also with backup&restore I could only copy 4 out of 7 sections on that course. There are the same "Section not fully restored" and "Module not fully restored" messages in Apache logs. I tried removing the line from the code mentioned above, and that seemed to fix the problem. Actually I removed these two lines to make it also work with backup & restore to a new course. So thank you both for this. I hope @gjb2048 can figure out an "official" fix too :) |
The snag is with the way that Moodle course creation works with CSV files, that the 'after course restore' code is not called only the section and thus I have to count the number of sections in order to make things work - at the moment. |
Ok, looks like this fix now breaks #189. |
For some odd reason, uploading a csv file that creates a new course (with a template course as reference) has backup::TARGET_CURRENT_ADDING (1) as the target! |
Dear @giselebrugger, I've had to improve the solution so that it does not break CSV import, please test: 7504fed. Thanks, Gareth |
Hello @gjb2048 |
Dear @giselebrugger Thank you for taking the time to test. Appreciated. Kind regards, Gareth |
Describe the bug
When the "import" or "backup + restore" feature is used in Grid format courses, if there are any quizzes, they are not imported, and the number of course topics is changed to 1.
Moodle: [4.3.2 (Build: 20231222)
Grid: 403.1.2 - 2023101502
importar_quiz-2024-03-14_13.30.37.mp4
The text was updated successfully, but these errors were encountered: