Fieldtype, Module

Archived
Forum
(read-only)

eeXam

ExpressionEngine 2

Back to this add-on's main page
View Other Add-ons From Coffee Bean Design

     

Correct answers showing up as wrong in the results page

Support Request

Batdelfuego
Batdelfuego

Hi!

I’ve been creating this long exam and I found some kind of bug in the Correct Answers results.

All my questions are single choice questions.

When I select the right answer in the exam and submit the exam to get to the results page, some of the answers show wrong when the answer selected was actually right (see screenshot for one example).

Correct answer selected in exam entry:
https://dl.dropboxusercontent.com/u/692614/1.jpg

Correct answer selected in exam page:
https://dl.dropboxusercontent.com/u/692614/2.jpg

Wrong answer notification in exam results and exam admin:
https://dl.dropboxusercontent.com/u/692614/3.jpg
https://dl.dropboxusercontent.com/u/692614/4.jpg

I’m really not sure what is going on here…
This is happening for a few random questions in the exam and I really don’t know what to do from here.

I’m running EE v2.8.1 with eeXam 1.0.10.

Thanks for the hlep!

Batdelfuego
# 1
Batdelfuego

One other note.

If I go back to the Exam to do the test again.
The problematic Questions are the only ones that don’t keep their answers selected.

https://dl.dropboxusercontent.com/u/692614/5.jpg

It’s as if they are not part of the exam.

Maybe that can help figure out the bug…

Coffee Bean Design
# 2
Developer
Coffee Bean Design

Hi there,

I’m sorry you are having trouble with the tests.  This is a really strange problem, I’ve not seen anything like this before.  I can’t see anything particular about those questions.  It may not explain why this happened, but what happens if you recreate the question and save again?

Batdelfuego
# 3
Batdelfuego

Hi,

Thanks for getting back to me.
I’ve tried removing the problematic questions (there were 50 out of 100).

It worked at first but as I kept replacing them, other new ones started doing the same thing (showing wrong when they were answered right).

I’ve actually spent a lot of hours on this problem but I feel like I’m just going in circle.

I’ve asked a more advanced programmer to look into it.
I’ll update a bit later if we find the problem.

 

Coffee Bean Design
# 4
Developer
Coffee Bean Design

That must be very frustrating.  It is useful information though, we now know that there isn’t anything inherently amiss with those specific questions.  Although the bad questions change, do the same questions behave incorrectly each time you take the test?  That might suggest it has something to do with their position in the array of data that is sent when you save the test.

If you are saving all at once, and with 100 questions, you will be posting a lot of data when you save the test. There are some PHP limits on posted data, see post_max_size and max_input_vars.  The next step might be to look in the database to see exactly what is being saved, you can see this data in the exp_eexam_answers table.

Let me know how you get on with the developer, I am interested to hear what the problem is.

Batdelfuego
# 5
Batdelfuego

All right…

So for anyone who encounter this bug.
The solution is actually pretty simple.

When entering new Answer Choices, MAKE SURE YOU HAVE NO CARRIAGE RETURN in the answers.

If you have one, the HTML rendering will create a space in the <label> and the answer will not be properly taken by eeXam when the form is submitted.

This is the kind of thing that can happen if you do some copy paste of your questions and answers and don’t remove all of the extra carriage returns in your answers.

Took us 2 days to figure it out…. Ouch!

Coffee Bean Design
# 6
Developer
Coffee Bean Design

I’m really glad you resolved the problem, but I’m really sorry it took so long.  I can see that this issue would cause a lot of frustration.  I will try to resolve it in the next release by trimming all white space on question labels.