gpoore / text2qti

Create quizzes in QTI format for Canvas from Markdown-based plain text
BSD 3-Clause "New" or "Revised" License
177 stars 64 forks source link

Detection of duplicate questions should consider the answer choices, not just the question stem. #38

Open MaduroMF opened 3 years ago

MaduroMF commented 3 years ago

If two or more multiple choice questions have the same stem (e.g. 'Which of the following is the largest number?') the script raises a 'Duplicate question' error and halts generation of the QTI files. This makes sense if the answer choices are also the same, however if the same question stem is repeated by followed by a different set of answer choices, it should not be flagged as a Duplicate question. Can the program be modified to permit the same stem but with different answer choices?

MaduroMF commented 3 years ago

A workaround is to append this html snippet to each question stem:

<font style="display:none">uniquetext</font>

... where uniquetext is e.g. a version number that would not be displayed but which prevents text2qti from detecting an identical stem (since they are now unique). In Canvas the hidden text does not appear when the quiz is being taken. It does appear in the html editor within Canvas Quizzes.

gpoore commented 3 years ago

The duplicate check could be easily expanded to consider both the question and the answers. For a lot of what I do, I need the check to consider just the question, but I can see how that is a limitation in some cases. I can add a new new option, maybe something like --allow-identical-questions.

MaduroMF commented 3 years ago

A switch/option would be a good way to solve the problem. (Indeed, before posting here I first looked to see if there was a way to disable the check or to allow duplicate question stems.)

0verdoes commented 3 years ago

I would also greet this feature. Note that if 2 questions only differ with 1 space they are than considered different questions. So when i ran into the duplicate question error. I just add different amount of spaces to the instances of the same question. And than in Canvas there is absolutely no difference.

ururk commented 3 years ago

--allow-identical-questions Would be great - we are generating hundreds of MC questions (for instance) that are all a little bit different, but the titles remain the same. At the moment I'm appending <font... to get around this limitation.

Another thought would be to expand how duplicates are looked for. One way I do duplicate checking in my own code for other things is string concatenation - I come up with a repeatable pattern - concatenate the variables, and store it in an array/list to see if I encounter it again. There may be other performance enhancements (hash the string), but generally I've found it to be reliable enough.

benjamin-j-cooper commented 1 year ago

I am currently working on a project for a software engineering course and I am utilizing text2qti to format the output of my quiz question generating system in .qti format. I ran into this issue because I am generating x iterations of each question, and then putting all the the iterations for each question into groups. The question is the same, the possible responses are different , and the script raises the "duplicate question" error. I am also appending "uniquetext" to get around this limitation. Adding my two cents that --allow-identical-questions would be great.