Hi, I can create questions fine. But I cannot save the correct answer. It is always always set to 1. I set it to something different, submit, then click edit on the question, and it's 1 again.

When I take the quiz, I always get 100% score, regardless of what I choose. Whether one, or the answer I set to be correct, or anything else.

What's going on? Thanks for this great module!

Comments

mbutcher’s picture

Status: Active » Postponed (maintainer needs more info)

I cannot reproduce the error.

Steps I have taken:

1. Create a new quiz
2. Create a new multichoice question
3. Set the answer to the fourth entry
4. Save
5. Assign the question to the quiz

When taking the quiz, if I don't select #4, I get it wrong.

Can you list your steps to get the bug? Thanks.

Also, might this be related to another recently reported issue: #339675: Preview mcq-mcq creation form seems to forget the already chosen answer

Flying Drupalist’s picture

Hi, I have taken basically the same steps as you did. Except I created 9 questions.

I have since fixed it by enabling multiple answers. I can then set the checkbox to the correct answer, and everything works swimmingly. Just when the correct answer was only selectable via dropdown was it broken. The bug still exists AFAIK but it works for me via this workaround.

jfolwarski’s picture

I was getting the same problem as Miraploy. The only thing was I didn't have the permissions checked for the multichoice module. Before I changed the permissions all my answers were right even though I selected the wrong answers. After I changed the permissions, I checked all of them for myself, it then performed fine just like Miraploy said, as long as I had the "Multiple answers" checkbox checked. I also want to thank you, because before this post I was SO lost. Hope this helps some.

mbutcher’s picture

Pathol2187: So did the permissions seem to fix it? Or did you have to check the "Multiple answers" button, too.

I have tested several questions with "Multiple answers" unchecked, and it seems to be working fine, so I'm wondering if there is a permissions bug. If either of you can confirm that it is a permissions problem then that would at least get me pointed in the right direction. It's hard to figure out the source of the bug if I can't replicate it here.

Thanks, both of you, for the updates.

jfolwarski’s picture

I tested it again and I'm almost positive it's the permissions. If you don't have the permissions for "allow multiple correct answers" then the outcome is the answer always being right even if the wrong answer is selected. I have all the other permissions checked for multichoice module and when I have that permission checked then it works fine.

jfolwarski’s picture

Sorry, I forgot something. As to your question it's fine if the "Multiple answers" checkbox is checked. I was mistaken before. Sorry about that. If the permissions is checked then it doesn't matter whether the checkbox is checked or not.

mbutcher’s picture

Oh, *that* makes sense... if the "allow multiple correct answers" perm is not granted to a user, then the user cannot assign a correct answer. It defaults to personality test scoring (everything is right).

I've been wondering about those permissions... I'm not sure why they exist, since I can't understand why you would allow someone to create a question but not allow them to assign a correct answer.

So what are your thoughts on how this ought to behave? We could (a) get rid of the permission, (b) set an error message saying something informative like "you can't assign a correct answer because you have insufficient permissions" or (c) change the behavior to... do... something... else.

jfolwarski’s picture

I'm not sure. At first I was going to say to get rid of it, but then I tried making a personality quiz. I only did a few tests and I think it works better it you don't have that permission. I don't know if this is possible, but I would say to send an error message if it's not a personality quiz. If you can still make good a personality quiz, I only tested it once, I would say get rid of it completely.

mbutcher’s picture

I wonder if I should disable the "pass rate for quiz" field and set it to 0 for anyone who does not have the right permissions.

jfolwarski’s picture

That sounds like a good plan. It would probably be a good idea to put a message that would tell people how to change it or something that refers to the permissions to change it from a personality quiz to a quiz that has wrong or right answers. But that sounds like it would be a great solution.

mike booth’s picture

I think this issue is drifting away from the point. I think it was meant to be about the following bug, which I experienced in quiz version 6.x-2.1:

1. Install Quiz with the Multichoice module
2. Ensure that the current user does not have "allow multiple correct answers" permission.
3. Add a new question. Note that the checkboxes for multiple correct answers do not appear (as you would expect, from the permissions setting). Instead there is a "correct answer" select widget.
4. Enter a question and four answers. Select "4" from the "correct answer" widget.
5. Submit the question.
6. Visit the Edit page for the question and note that the "correct answer" widget has reset itself to 1. It will continue to do so no matter how many times you submit the form.

My best guess is that this was caused by some kind of problem in the multichoice_submit() function in version 6.x-2.1. Upgrading to 6.x-3.x-dev has fixed this bug for me, so I shall probably try to backport a patch to 6.x-2.x-dev.

The issue of whether or not there should be a separate "designate a correct answer" permission (without which a user can only create personality quizzes with open-ended questions) is IMHO a different issue altogether. In this issue, we're discussing a permission named "allow multiple correct answers", which was originally designed as a way of forcing user-generated questions to follow a standard format (see #197187: Multichoice: permission system is confusing.). You should be able to create a question with a single correct answer even if you don't have this permission.

The question of whether or not the question create/edit form should have a better interface for choosing between "a question with multiple correct answers", "a question with one correct answer", and "a question with no correct answers" (i.e. a personality quiz question) is also a separate issue. (I think the answer is probably "yes".)

ezraw’s picture

Issue summary: View changes
Status: Postponed (maintainer needs more info) » Closed (works as designed)