If you’ve ever tried to duplicate quizzes in Moodle only to be greeted by an error which looked like or similar to “error_question_answers_missing_in_db & subquestion_error” and was left scratching your head because something didn’t work as expected, you’re not alone. Many Moodle users have run into this issue in Moodle version 4x, and it can feel overwhelming, especially if you don’t consider yourself a tech-savvy person.
I recently migrated my site to Mindfield from another host, and the experience couldn’t have been better. Mindfield kept working until they were certain that my site was operating as well as it was before, and they even helped clean up a few issues to improve my site’s performance – issues my prior host never mentioned. I also found Mindfield’s communication to be excellent. Before the migration, they prepared me for what to expect, and during the migration they kept me well-informed. No small feat considering that changing hosts is inherently stressful! They also provided clear and concise explanations when required. I’d highly recommend Mindfield if you’re looking for an IT consultant, developer, or host.
Jim Benedek
Owner, Student First Media Inc.
Review Source: Google Reviews
Outline
-
What’s the quiz duplication error?
-
Is there a solution for the Moodle version 4x quiz duplication error?
-
How can we still navigate the massive question bank?
-
Benefits of hiring Moodle experts for the Moodle quiz and question duplication error
-
Frequently Asked Questions(FAQs)
What’s the quiz duplication error?
The question bank within Moodle has always been a major issue. Why is that? The core code has never been written to include a separate copy code for quiz or question duplications, it shares code with the backup and restore process. The backup and restore was fundamentally designed for migration purposes or if something dire happens, and an entire platform required restoration. How does this apply to the current quiz duplication error? Over the various versions of patches/fixes released, a fix released caused a specific error to occur during the duplication (backup and restore) process of quizzes. You may have encountered an error which looked like “error_question_answers_missing_in_db & subquestion_error“.
For some, you might’ve tried to revert the section of code that was preventing the duplication and in result allowed the backup and restore to duplicate the quiz. You aren’t the only one if you tried this, we did too! The error thrown was like a gate. In reverting the code, you opened the flood gate. Many have experienced this, where this allowed the duplication of quizzes but then also allowed for thousand, maybe even millions of duplications of their questions. This created a whole new issue. The instructors/teachers weren’t able to navigate the question bank from the amount of duplicated questions. This is an understandable headache especially during exam/testing periods.
Here’s an example of what the question duplications may look like for you in your Moodle database.
Is there a solution for the Moodle version 4x quiz duplication error?
Good news! As of December 2024, Moodle developers have released a temporary fix to address the quiz duplication error affecting Moodle 4.x installations. Starting with Moodle version 4.4, improvements to the duplication function have been implemented to prevent these errors. Specifically, versions 4.4.7 and 4.5.3 include fixes that enhance the duplication process.
Additionally, recent discussions on the Moodle Tracker have highlighted the introduction of a duplication clean-up feature. This clean-up tool is designed to identify and remove duplicate questions that may have accumulated from previous errors, thus helping administrators manage large question banks more efficiently. Although this feature is still undergoing refinement, it represents a significant step forward in ensuring a smoother quiz management experience.
For those experiencing the issue, it is recommended to update to Moodle 4.4.7 or 4.5.3 and thoroughly test the update on a staging site before deploying it to your production environment. If duplicate questions are already present, consider using custom plugins or the new clean-up functionality to improve navigation and overall usability.
For more detailed information and ongoing updates, please refer to the Moodle Tracker entry: https://tracker.moodle.org/browse/MDL-83541.
How can we still navigate the massive question bank?
As mentioned, many may have experienced the massive duplication issue in result of this error. You may have teachers trying to navigate through the huge question banks trying to create their new quizzes or exams. At Mindfield Consulting, we’ve had clients also affected by this problem. We need a quick work around to allow them to create their quizzes during testing seasons or end of semester. Our temporary solution while we were working on a way to clean up the duplications was to hide the duplications from the front-end. What did we do? we’ve developed a structured strategy to clean up and optimize question banks:
- Custom Plugin Development: We’ve created a “review questions” plugin to manage duplications. This plugin uses conditions such as timestamps and usage history to identify duplicates. Only the original question is retained, while duplicates are hidden from view. This ensures instructors can navigate the question bank without clutter.
- Why Hide Instead of Delete: Deleting duplicates outright can be risky without thorough verification. Our approach hides duplicates, preserving them for restoration if needed. This safe method improves usability while maintaining data integrity.
- Database Cleanup Services: Beyond the plugin, we can provide deeper database-level cleanups. Our experts ensure your question bank is fully optimized, removing redundant data while protecting your critical course materials.
- Ongoing Support: Our team offers tailored solutions to streamline your Moodle platform, including performance optimization, plugin updates, and long-term error prevention.
How to backup and restore duplicated quiz questions
Since Moodle 4.4.0, quiz backup stamps are no longer unique, which has introduced serious errors when restoring old quiz backups. Any quiz backed up prior to Moodle 4.4.0 and restored in newer versions may lead to mass duplication of questions. This especially impacts custom question types—like punctuation quizzes—if those types are no longer supported, as they won’t be included in the backup or may trigger restore errors.
This creates a rift for instructors attempting to reuse or migrate older quizzes. Incompatibilities lead to restoration failures or flooded question banks filled with non-functional duplicates.
Mindfield has developed a proprietary solution to address this issue. Our custom approach enables successful backup and restoration of older quizzes, even with outdated question types. Whether you’re dealing with punctuation-type question formats or other specialized structures, we ensure smooth compatibility and minimal disruption.
Benefits of hiring Moodle experts for the Moodle quiz and question duplication error
When faced with complex issues like the Moodle quiz duplication error, hiring a Moodle expert can save you time, stress, and costly mistakes. Moodle experts have the technical know-how to diagnose and resolve problems quickly, ensuring minimal disruption to your courses. They can implement tailored solutions, such as custom plugins or database cleanups, that not only address the immediate issue but also enhance the overall functionality of your Moodle platform.
One of the most overwhelming and intimidating aspects of this issue is cleaning up the question bank — especially when it involves editing or deleting entries from the database. Without proper knowledge, this process can lead to accidental data loss or corruption. A Moodle expert brings both technical skill and strategic caution to this task. They take preventative measures to safeguard your data, verify dependencies before removing anything, and ensure the cleanup is executed smoothly and safely. Whether it’s troubleshooting bugs, streamlining your question bank, or ensuring smooth updates, a Moodle expert brings peace of mind and professional-grade results.