Comparing Question Bank Questions

Comparing Question Bank Questions

by Scott Karren -
Number of replies: 2

All,

I am using Moodle 2.9.1 and have been asked to compare the questions in two separate Question Bank categories for duplicates.  Each category has around 500 multiple choice questions in it.  I tried exporting each category and then doing a compare in Notepad ++, but because the export includes the question id the compare found everything to be different.

Is there a way to do this?  I currently do not have access the the DB.

Scott

Average of ratings: -
In reply to Scott Karren

Re: Comparing Question Bank Questions

by Tim Hunt -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

Does it help to use regular-expression search and replace to delete the bits of the XML like questionid that mess up the comparison?

In reply to Scott Karren

Re: Comparing Question Bank Questions

by Eoin Campbell -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers

You could try installing the Microsoft Word table format plugin and export the questions to Word format. This format omits the question IDs so that particular issue would be avoided. In addition, the XML export question order could be quite different for each category, but in Word you could sort the questions by name (each name is a Heading 2 style) to avoid this issue too.

Word has quite a good compare function so the comparison results are very good, exactly highlighting changed words, not just changed lines. 

If you do use regexp to remove question IDs from the XML files, the best text file comparison tool I have found comes with the Total Commander file explorer. Like Word, it does word-by-word comparison within lines, but the feature I like best is that you can re-synchronise the line comparison. For example, if there is one extra question near the start of one file that throws out the whole comparison, you can manually tell it to re-align on the next question and start comparing again. I find this is quite a typical scenario for XML and HTML files.