When having a full setup of quiz and submodules and adding quiz result display settings, somehow it breaks.
When quiz results cannot get a proper layout it breaks and the quiz cannot be taken because of the next error:
Notice: Undefined offset: 27 in QuizResult->getLayout() in QuizResult.class.inc
Warning: Invalid argument supplied for foreach() in quiz_take_quiz() (line 1886 in quiz.module
I think it would be nicer to set a check if there's a layout, so it cannot break the process.
Comment | File | Size | Author |
---|---|---|---|
#6 | layout_error_quiz_not-2884215-6.patch | 2.04 KB | fabianderijk |
#5 | layout_error_quiz_not-2884215-5.patch | 1.41 KB | mr_infinity |
|
Comments
Comment #2
djdevinHi,
That means the quiz attempt did not have any questions, which isn't supposed to happen.
Does it do the same if you delete the current result?
Comment #3
mr_infinity CreditAttribution: mr_infinity commentedThanks for the quick respond! It appears also when a newly made quiz haves questions... also when creating a new quiz. There is no possibility to start the quiz.
Comment #4
mr_infinity CreditAttribution: mr_infinity commentedI would like to add my patch, if possible.
Comment #5
mr_infinity CreditAttribution: mr_infinity commentedTo bring more context: When we create a quiz, we do start the quiz automatically.
But if there are no questions, then it breaks immediatly. So if no questions where presented and you choose to start, it should not break the site.
Comment #6
fabianderijkThere was also another issue involved in this one. When you reload a quiz that you where taking (for example on the page www.example.com/node/666/take/1) and all results have been removed from that quiz (so you don't have any progress anymore) you should be redirected to the node page instead of getting a 500 error. I've added the code in the patch and uploaded it in this comment.
Comment #7
djdevinThanks, let's see what the tests say.
We should add an automated test for this to make sure this doesn't regress.
Comment #9
webservant316 CreditAttribution: webservant316 commentedI am experiencing this problem. This is an old issue, but was the solution never implemented?