Hi,
When the questions for a Quiz are randomly selected using a term, nothing is done to handle multi-languages. All published question for the term are used. Quiz doesn't check that the questions are in the same language that the Quiz itself. Multi-languages in the term's vocabulary is not handled.
Here is patch that add multi-languages support when randomly selecting questions using a term. Also attached to this is a test case to for the behavior of the modified function.
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | quiz_742938_2.patch | 6.6 KB | pbuyle |
| #1 | quiz_742938_1.patch | 3.99 KB | pbuyle |
| quiz.test | 10.17 KB | pbuyle | |
| get_random_taxonomy_question_ids_i18n.patch | 3.97 KB | pbuyle |
Comments
Comment #1
pbuyle commentedHere is an updated patch to also select questions without a language (== language neutral) in _quiz_get_random_taxonomy_question_ids().
Comment #2
pbuyle commentedHere is a patch build on the one in #1 (with quiz.test in the 'tests' folder from initial post) that adds language support to the "Manage questions" tab of quiz nodes. Auto-complete has been modified to use language as first argument (and to properly handle '/' in the query). Form validation has been modified to check for language too of added questions. The test case only covers autocomplete.
Comment #3
tutumlum commentedSimply needed to add following lines to quiz.module just after line #2747 :
Tested and it works. If you want to test, you should take quiz newly. Resuming quizzes will not be affected since question list is built before.
Comment #4
pbonnefoi commentedIs this has been ported yet ? I think, the count needs to be also updated on line 2552, but I don't know how to do it...
If you put more questions than questions available in a given language, but still under the number of questions available for a term (no matter what's the language) the function will pass.
Comment #5
pbonnefoi commentedWell actually, the problem isn't there, the $count is alright, the warning message does not show up in a right place. It only appear when the quiz is taken, not when the number of questions is added. quiz.admin.inc, needs to be reviewed (I pasted the code below where the problem is). I'm working on it.
Comment #6
djdevinThis issue is being closed because it was filed against a version that is no longer supported. If the issue still persists in the latest version of Quiz, please open a new issue.