Truncated quiz

Truncated quiz

by ben reynolds -
Number of replies: 6

Just reporting here about some odd behavior, should anyone else run into this. Moodle 1.9.4+ (Build: 20090401)

Student reported that quiz ended 10 questions before it should have. All 75 questions are on one page.

On first view as admin, all 75 questions were visible. (I'm still puzzled by this.)

When I used "log in as" the student, and viewed the quiz in IE8 with compatibility turned on, the quiz was truncated at question 65.

When I viewed again as admin, quiz was truncated at question 65. Clearing cache, etc, did not solve the problem.

Behavior not replicated in FireFox 3.6.4

Viewing source of quiz, I found a malformed tag < / objec < / div > , without the spaces, obviously. The object tag was not malformed in the question text. < / object > The two tags collide when Moodle generates the < / div > for the quiz.

I inserted a space and & n b s p ; after the object tag to prevent the collision.

Too Much Information follows big grin

This quiz has a series of questions using object embed to play sound files (it's a music course). The above behavior is not replicated with any of the other questions. We replicate classrooms from a template, and this collision is in the template. Again, not replicated with any other question.

This quiz is the course's final exam, which students can opt out of if they instead do a final project. Course has been offered since January 2009. That this problem hasn't been reported until now speaks well to how most students opt to finish their course.

Average of ratings: -
In reply to ben reynolds

Re: Truncated quiz

by Tim Hunt -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
This behaviour should not depend on who you are logged in as (I would have thought wink). Moodle does to stuff to the HTML that was input to try to prevent security attack, but that should be the same whichever login you use.

It is more likely to be a difference between IE and Firefox. If you view the source in Firefox, is it mangled?

Ah, it could be the case that Moodle is mangling the object tag for both browsers, but Firefox can make sense of the mess, and IE can't.
In reply to ben reynolds

Re: Truncated quiz

by Joseph Rézeau -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers Picture of Translators
Hi Ben,
It would be interesting to see the exact complete text of that question which triggers a malformed tag (its HTML code, not the WYSIWYG), maybe attached here as a text file. Other than that it's near impossible for us to "guess" what might have happened to it.
And why do you need to use an embed tag simply to output audio in your questions? Why not use moodle's mp3 flash player?
Joseph
In reply to Joseph Rézeau

Re: Truncated quiz

by ben reynolds -
Hi Tim and Joseph,
We are venturing into the odd world of browsers here. When I wrote the above, I checked 2 classrooms and the original (and only) template, I found the ending object tag in each question to be complete.

I just now checked several more classrooms and found the object tag to be broken in the question, not in the quiz.

The attached text file contains the entire question, with the end tag broken.

Oddly, viewing the questions where I added the unbreaking space at the end in IE 8 does not show the unbreaking space. Viewing in Chrome does. Viewing in FF does not.

Joseph, the sound files are created with a music program (Sibellius, I think). I can't remember the reason for embedding, but I think it was easy for the instructor to build that way.

Tim, quite right about behavior not dependent on who you are logged in as.

Quite right that FF & Chrome are more forgiving about the mangled code. In the question in editing mode -- not the quiz -- Chrome actually supplies the closing bracket: "< / objec >" without the ending "t"!

Oh, but IE actually shows the whole tag as complete for the exact same question in the exact same course.

I have to think about this and write you a clearer response. Sorry.
In reply to ben reynolds

Re: Truncated quiz

by Joseph Rézeau -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers Picture of Translators
Hi Ben,
This does not help much.
"The attached text file contains the entire question, with the end tag broken."
The text file only contains the entire question text, not the choices proposed to the student. Never mind.
But why would that end tag be broken? Was it entered correctly when the question text was originally created? When does it get broken?
Since I have no access to your moodle site, I cannot re-creating that question on my local moodle test site (it requires a login to your site).
Joseph

In reply to Joseph Rézeau

Re: Truncated quiz

by ben reynolds -
I take back my original post. It was based on incomplete data. What's actually happening is demonstrated in the attached picture.
  1. The embed tag, I suspect, was not copied properly into the question text box, leaving off the "t > "
  2. Different browsers accommodate that error differently when viewed in the html view of Moodle's html editor.
    1. IE 8 completes the tag
    2. FF completes the tag
    3. Chrome (& probably Safari) does not complete the tag.
  3. "Completing" does not actually fix the tag. It just alters what humans see. So, when the question is saved, the tag is actually still missing its last 2 elements.
  4. When the quiz is generated, the browsers do the following, as you can test with the question and any choices you wish (multiple choice question):
    1. IE8 < / objec < / div >
    2. Chrome < / objec > < / div >
    3. FF renders it as < / objec > < / div >
Attachment ObjectTagThreeBrowers.jpg