Cannot Duplicate quiz

Cannot Duplicate quiz

by Meet Amin -
Number of replies: 17

HELP,

I tried to duplicate the quiz in moodle 3.9 but it freezes, All the debug options are on but still, there's no issue in front.

FYI: I can still duplicate the attendance and PDFs in a course but not a quiz 

o8pIz.png   wZPPh.png


Average of ratings: -
In reply to Meet Amin

Re: Cannot Duplicate quiz

by Rick Jerz -
Picture of Particularly helpful Moodlers Picture of Testers
For whatever reason, duplicating a quiz that has questions in it can take a while. So I wonder if your Moodle is really "freezing" or just still in progress. Try giving it at least an hour. If you still don't have any luck, you might want to increase your php max_execution_time to something like 900.
Average of ratings: Useful (1)
In reply to Rick Jerz

Re: Cannot Duplicate quiz

by Meet Amin -
Hey Rick, No Like I can see that buffering for 5 mins and then it's gone, there's nothing the user can do and even if I refresh a page it shows a timeout error, So to again go back to moodle admin page I've to clear the cookie and then it'll work. Also, there's some jquery error every time I duplicate anything. Please take a look at this image for javascript error https://ibb.co/jV1vsMb
In reply to Meet Amin

Re: Cannot Duplicate quiz

by Leon Stringer -
Picture of Core developers Picture of Particularly helpful Moodlers

The errors in that screenshot say you have jquery-3.4.1.js which suggests you have Moodle 3.9.4 or earlier. If so you should update to Moodle 3.9.15 as your site is missing 1.5 years of fixes. Maybe this issue has already been fixed or improved.

Also, check cron is running as there's an issue with random questions taking a very long time to copy that's resolved with a scheduled task (MDL-64595).

Average of ratings: Useful (2)
In reply to Leon Stringer

Re: Cannot Duplicate quiz

by Meet Amin -
Hey Leon, Yeah I tried updating moodle to 3.9.16 but there are still some errors like https://ibb.co/jRVZ12X when I run cron.php in the browser.
Also, It resolved the error with jquery but still cannot duplicate the course and quiz inside the course. I've created a test course with an empty quiz and that runs well but not sure what's wrong with the quiz that's actual and populated. Also, I've increased the local execution time so that it doesn't give any timeout errors. and even the backup shows this for the backup location. https://ibb.co/3BWVWRx
In reply to Meet Amin

Re: Cannot Duplicate quiz

by Leon Stringer -
Picture of Core developers Picture of Particularly helpful Moodlers

The Table 'moodledb_ace.mdl_tag_correlation' doesn't exist error from your cron shows that one of Moodle's database tables is missing. This table, mdl_tag_correlation, has been part of Moodle since version 1.x.

So you should fix this, but if you have one table missing perhaps there are others missing too. Moodle Docs has a page on how to verify the database schema. I've attached the CREATE TABLE statement for mdl_tag_correlation from my 3.9 site, this may need changing if your database uses a different character set and character collation.

The The backup destination folder does not exist or is not writable message means the web server process cannot write to this folder. Perhaps this is a permissions or folder ownership problem. Perhaps there's something like SELinux preventing access. If you find out which user your web server uses when running PHP scripts (often one of apache, www-data or php-fpm) then you could try a test like sudo -u apache touch /home/…/moodledata/moodlecoursebkp/testfile (change apache if your web server uses a different user, replace … as needed) to see if the user can create a file in the target folder.

In reply to Leon Stringer

Re: Cannot Duplicate quiz

by Meet Amin -

Hey Leon, I was successfully able to add mdl_tag_correlation But still didn't get that part where we can compare the database to check if any other tables are missing. Also when I check the system status in reports it shows me this https://ibb.co/pwHpXNk . I'm not sure what ad-hoc is and how to keep it running also I wanted to know how to continuously run the cron script because as of now I've to do it manually from chrome by typing the URL.

There's one more error in cron.php and it's this https://ibb.co/mbhqpVj  

Exception: Can't find data record in database table backup_courses. (SELECT * FROM {backup_courses} WHERE courseid = ? AND laststatus = ?
Thanks a lot for helping me with this Im totally unaware of how to moodle and all this works still trying to get it back as far as I can.

In reply to Meet Amin

Re: Cannot Duplicate quiz

by Rick Jerz -
Picture of Particularly helpful Moodlers Picture of Testers
Another thing to try is to create a new experimental quiz. Don't put any questions into it. Then try duplicating it. If you don't get errors, then your problem is about duplicating quizzes with questions. (I am just trying to help you probe. Also consider Leon's advice.)
Average of ratings: Useful (1)
In reply to Rick Jerz

Re: Cannot Duplicate quiz

by Meet Amin -
Hey, rick, yeah that works with empty quizzes but now I also know that I cannot duplicate the course and even the quiz. Please take a look at https://ibb.co/jRVZ12X https://ibb.co/3BWVWRx
In reply to Meet Amin

Re: Cannot Duplicate quiz

by Rick Jerz -
Picture of Particularly helpful Moodlers Picture of Testers
At this point, it seems to me to be a "settings" issue, likely with your server or PHP.

If you back up your course and exclude the "question bank," can you restore it?

How many questions do you have in your total question bank?
In reply to Rick Jerz

Re: Cannot Duplicate quiz

by Meet Amin -
Hey rick, yes If the course is not long and bulky I can restore it. I've read a test course with a few announcements and one quiz and it works, also my ad hoc is having some issues. https://ibb.co/pwHpXNk

Like its failing the tasks but not sure why, I did run cron and increased the time for tasks and also execution time but there is some issue with Adhoc task failed: core\task\asynchronous_backup_task, Can't find data record in database table backup_controllers. https://ibb.co/1f42cyn
In reply to Meet Amin

Re: Cannot Duplicate quiz

by Rick Jerz -
Picture of Particularly helpful Moodlers Picture of Testers
I have never seen that kind of error. I am just trying to think this through with you.

Have you done any editing of data within the tables? You might have some corrupted quiz data.
How many questions do you have in your total question bank?

I am running out of ideas. Maybe someone else will help.
In reply to Rick Jerz

Re: Cannot Duplicate quiz

by Meet Amin -
Hey, Rick, I've 70+ questions in the quiz which are having issues with duplicating and I was able to sort ad-hoc tasks by disabling recycle bin.
In reply to Meet Amin

Re: Cannot Duplicate quiz

by Rick Jerz -
Picture of Particularly helpful Moodlers Picture of Testers
Don't really know. It might have something to do with 70+ questions in your quiz. Since you successfully duplicated a quiz with 0 questions, you can try adding 1 question to it and see if you can duplicate it fairly quickly. If you can, then try 5 questions, then 10. This might help you understand if the problem on your website and Moodle is related to the number of questions.
Average of ratings: Useful (1)
In reply to Rick Jerz

Re: Cannot Duplicate quiz

by Meet Amin -
Hey, rick Yeah like yesterday Ive tried to add a different quiz in another course and it had like 700 questions so when I clicked on duplicate and the loading/ buffering was there for a minute and then I get an undefined error but then I refreshed the page and that copy of quiz was there. I think it's the issue with those sets of questions that are in there in a quiz or maybe some of the courses.
In reply to Meet Amin

Re: Cannot Duplicate quiz

by Emma Richardson -
Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Plugin developers
I see this same behavior when doing anything that takes time in Moodle. If you have a large system level question bank, quiz copying can take a long time or stall out altogether.
Average of ratings: Useful (1)
In reply to Emma Richardson

Re: Cannot Duplicate quiz

by Meet Amin -
Yeah I've even increased the execution time and run the cron.php on the browser but this is what it gives https://ibb.co/jRVZ12X
In reply to Meet Amin

Re: Cannot Duplicate quiz

by Meet Amin -
Also in regards to this issue, Emma do you know anything about this error?? https://ibb.co/3BWVWRx

Im running Linux centos and my directory is there and it is writable but not sure what the issue is here