I have seen some strange behavior and errors while editing a question with the revision checkbox selected.
I suppose that the errors and bugs are not related to the various kind of questions.
I have seen this on: Multiple choice question and Matching questions I suppose it also exists on all the other questions. (I will try to test that if I have some extra time)

Follow this steps to see the bug:
=====================================
Step 1 - Create a quiz.
# Create Content
# Create content Quiz
# Title: "Test quiz"
# Save quiz

Step 2 - Create a question
I made a Multiple choice question Test 100 with 2 choices
# Alternative 1 --> 100
# Alternative 2 --> 200 --> correct answer
# Add to quiz --> Check "Test quiz"
# Revision information --> Check the box
# Save

Step 3 - Open the quiz in edit mode
# Admin -> Content -> Edit [Test quiz]
# Click on [Manage Questions]
# Click on [edit] under "Questions on this quiz (1)" by "Test 100"
# Click on [Revision information]
Here you see that the Revision checkbox is UN-checkedThis maybe right, I am not sure about that.
# Select the checkbox "Create new revision"
# Save the question.

You see the question now with the right and wrong answer and on the top you see the tabs: [View] [References] [Edit][Revisions]

Step 4 - Check the "Add to quiz" properties from the question.
# Click on the tab [Edit]
# Check the "Add to quiz" properties.
Here you see that the checkbox "Test quiz" is UN-checked. <--- I SUPPOSE THIS IS A BUG

Step 5 - Open the Quiz in edit mode and select [Manage questions]
# Admin --> Content Management --> Content
# Click on "edit" by "Test quiz"
# Click on the tab [Manage questions]
Here you see "Questions on this quiz (2)" with twice the same question connected to the quiz.

: Test 200 multichoice Edit | Remove Latest of revisions
: Test 200 multichoice Edit | Remove Up to date

The link "Remove" dosn't work on both questions. <-- I SUPPOSE THIS IS A BUG

Step 6 - View the quiz
# Click on the tab [View]
Here you see "Question 1 of 2".
That tells me that the "real" question and the revision question are now included in the quiz.
# Click on button [Next]
Now you see the second question. This is the same question as the first one. (duplicate?)
The end of the quiz looks OK. I says "You got 0 of 1 possible points." and just one result is displayed.

Step 7 - Delete a quiz revision Error
# Admin --> Content Mangement --> Content -\
# Click on "edit" by "Test quiz"
# Clck on tab [Edit]
# Make sure that hte checkbox on "Create revision" is checked
# Save question
# Click on tab [Revisions]
# Click on "delete"
# Click on button [Delete] for confirmation
Now you see a error like: Fatal error: Uncaught exception 'Exception' with message 'no constructor available for 'quiz' question type' in /var/www/WWW.SOMEDOMAIN.COM/html/drupal-6.14/modules/contrib/quiz/question_types/quiz_question/quiz_question.module:521 Stack trace: #0 /var/www/WWW.SOMEDOMAIN.COM/html/drupal-6.14/modules/contrib/quiz/question_types/quiz_question/quiz_question.module(456): _quiz_question_get_instance(Object(stdClass), true) #1 /var/www/WWW.SOMEDOMAIN.COM/html/drupal-6.14/modules/contrib/quiz/question_types/quiz_question/quiz_question.module(365): _quiz_delete_question(Object(stdClass), true) #2 /var/www/WWW.SOMEDOMAIN.COM/html/drupal-6.14/modules/node/node.module(673): quiz_question_nodeapi(Object(stdClass), 'delete revision', NULL, NULL) #3 /var/www/WWW.SOMEDOMAIN.COM/html/drupal-6.14/modules/node/node.pages.inc(600): node_invoke_nodeapi(Object(stdClass), 'delete revision') #4 /var/www/WWW.SOMEDOMAIN.COM/html/drupal-6.14/includes/form.inc(774): node_revision_delete_confirm_submit in /var/www/WWW.SOMEDOMAIN.COM/html/drupal-6.14/modules/contrib/quiz/question_types/quiz_question/quiz_question.module on line 521

I hope this give you some good input to solve the bug(s).

There was a other strange behavior were on the edit-question-page under the sub "Add to Quiz" 8 times the same quiz was presented. I cant figure out how this exactly happens but I am convinced in a relation with revision from the Question.

Regards and succes,
Neorg

CommentFileSizeAuthor
#4 Screenshot-1.png151.02 KBneorg
#4 Screenshot-2.png113.25 KBneorg
#4 Screenshot-3.png101.67 KBneorg
#4 Screenshot-4.png145.52 KBneorg
#4 Screenshot-5.png150.58 KBneorg

Comments

falcon’s picture

Version: 6.x-4.0-alpha3 » 6.x-4.x-dev
Assigned: Unassigned » falcon
Status: Active » Needs work

Hi,

Thanks for the report! I have seen some of these insects myself, and they are not unexpected. I hope they'll all be dead in Alpha 4(release tomorrow).

falcon’s picture

@neorg: Thanks for the report! - "Remove" always works for me. What browser are you using?

Done:
- each quiz appear only once in add to quiz fieldset
- Revision delete bug solved

When a question is revisioned, quizzes it belongs to keeps the old revision, you manually have to add the new revision to the quiz from the manage question tab. This is currently by design. If we updated the quiz automatically, and replaced the old revision of the question with a new one we would also have to automatically create a new revision of the quiz if the quiz had been answered. If not the stored quiz results might become invalid because the saved answers don't correspond to the updated quiz. (This is the reason why all LMS systems I've tried forces teachers to delete all quiz answers before they are allowed to change the quiz...) This design creates an enormous UX bug...

Possible solutions:
- Automatically replace old revisions of a question with new without creating a new revision of the affected quizzes. (Might lead to incorrect result reports and statistics)
- Keep things the way they are. (Might lead to ppl thinking they have updated a quiz when they really haven't)
- Automatically replace old revisions of a question with new, and create new revisions of the affected quizzes. (Might lead to a lot of revisions for each quiz, and each revision has its own stats...)
- Make a GUI in the question types node forms to choose what shall happen with the affected quizzes if the question is revisioned. (I'm not quite sure how that GUI would look like and behave...)
- Insert warnings in the node form or after the nodeform informing the user about these issues(The issues are a bit complex. I don't think the average user wants to know about these issues...)
- Do as the LMS and block node editing until all results have been deleted.(I really don't like this approach...)

I think the best solution is to redirect the user to a page for updating affected quizzes after they have created a new revision of a question that belongs to a quiz.

Any thoughts? Maybe we can this one sorted out as well in Alpha 4 tomorrow... :)

neorg’s picture

@falon: What browser are you using? <-- I am using Firefox on a Linux Ubuntu 9.04 (jaunty) distribution

Thanks for the information on how and why the revision work this way.

I agree with your proposal to redirect the user (admin who changed the questions) to a page where he gets a notification about the change and revision issue and the possibillity to update his quiz.

neorg’s picture

StatusFileSize
new150.58 KB
new145.52 KB
new101.67 KB
new113.25 KB
new151.02 KB

Hi Falcon, Thanks for the great job in this fantastic project. I really like it and hope to use it next month on a big consumer show in Amsterdam.

After the upgrade I did some testing with version quiz-6.x-4.0-alpha4. Unfortunately I see still some bug related to the revision system.

When I edit a question and check revision I get this question twice in [Managing Questions]. (See screenshot 1). I can't remove non of them.

All the double questions (in my case I had three times the same question) appears in the quiz. (See screenshot 2). While taking the quiz I get all four question (three times the same). At the end of the quiz I get no feedback. (See screenshot 3). I suppose there is no feedback because I found out that non of my questions was add-ed to a quiz. At least on the edit question forms there was non quistion with a "Add to question" box checked, while the [Managing Question] page make me think something els. There I see the question added(?) to a quiz.

When a edit a question and check the "Add to quiz" box I see the question again (ad again, and again) in my [Managing Questions] overview. (see screenshot 4) When I try to save this quiz (including revision) I get the drupal red error-message "A duplicate question has been removed. You can only ask a question once per quiz." (See screenshot 5). While the error massage says that a double question is deleted this is not what happens. I take the quiz now I see "Question 1 of 5" in stead of 4, and I really get five question in the quiz.

At the end of the quiz I get just two responses , one for the four double questions and one for the single question. This look OK to me.

SO it look like it's a kind of DISTINCT fault in a query or something like that.

By the way: in version alpha4 there is still no feedback after each question. Feedback only appears on the end of the quiz.

TNK!!

falcon’s picture

Status: Needs work » Needs review

Thanks again for the report! It speeds up the process of finishing up quiz 4.

I have just commited some changes that should fix some or all of these problems. Could you please download the latest 4.x dev from cvs and test it? (Or wait 24 hours and download it from the project page, I'm not sure when or how often the 4.x-dev build on the project page gets updated.

neorg’s picture

HI Falcon!
You did great job here. Quiz 4 looks pretty good now!

In a quick test I found the following issues.

1. No feedback after each question.

On the page to create or edit a quiz there is an option to choose when to show to feedback. If I choos te option "Feedback after each question" I do not get that feedback. The feedback is at the end of the quiz. The option "Do not show" and "At the end of the Quiz" works like charm.

You can reproduce this as follow:
# Create a Quiz
# Select "After each question" by "Feedback Time"
# Save the quiz
# Assign at least 2 questions. ( I just use Multiple choice question")
# Take the quiz.
# After the first question you see there is no feedback. Immediately after the first question comes the second question. The feedback is given at the end of the quiz as if the option "At the end of the Quiz" was chosen.

The feedback after each question is an important feature for my project. It would be great is you can fix this issue with some priority.

2. While editing a Quiz the status from "Assign Action: " is always on "Choose an Action".

You can reproduce this as follow:
# Create a Quiz
# Assign some questions.
# Go to edit quiz (admin --> content --> edit a quiz type)
# Scroll down to "Assign Action: "
# Select a action (i choose "Save post")
# Save
# Take the test ( admin --> content --> click on title from a test)
# After completing the test --> edit the test again. [edit] on top of page
# Scroll down to "Assign Action: "
Here you see that the action is on "Choose an Action".

Although the presentation of the value in the option-list is not correct and always on "Choose an Action" I see that Quiz result are stored. I can access Quiz Reports an brows to the results. So this gives me the feeling that the earlier chosen action works and that the this is only an presentation issue in the edit Quiz form. (I did not test this, sorry.)

3. Counting the score is gone after editing a question.

I'am not sure if this is a bug or that I do not understand good enough the principles of questions, quizzes and editing them.

You can reproduce this as follow:
# Create a Quiz
# Save the quiz
# Assign at least 2 questions. ( I just use Multiple choice question")
# Take the quiz.
you see a score at the end of the quiz. something like
You got 3 of 3 possible points.
Your score: 100%

and on each question you see a score like:
Sore 1 of 1
This is OK.

Now edit a question.
# admin --> content --> quiz [edit] --> tab [Manage questions]
under Question Notes that there are values in the fields "Max Score"
# Click on edit from one of the questions.
# Edit the question (just make a small change in the text of the question is OK)
# Save the question
# I choos the standard option in the next (NEW, great!!) screen "Update and revise":
___Test quiz 110 (published and answered):
_____Update, revise and unpublish
____*Update and revise
_____Update
_____Do nothing
# Now Check [Manage questions] and you see that the values of all "Max Score" are zero "0".
# If you take the quiz you get no result because there are no point to collect.

If I remove the question from the quiz and add them again in [Manage questions] the "Max score" values are back.
You can reproduce this as follow:
# In [Manage questions] click on "Remove" at each question
# Click on [Submit]
# Check some question to assign to the quiz
# Click on [Submit]
Now the Max sore is back.

One again: Falcon You are doing a great job over here. I am really impressed about this great and complex module.

Greetings from,
Neorg

falcon’s picture

Thanks for testing!
1. No feedback after each question.
This will be handled in issue #635580

2. While editing a Quiz the status from "Assign Action: " is always on "Choose an Action".
I will look into this

3. Counting the score is gone after editing a question.
I just fixed this one

falcon’s picture

Status: Needs review » Closed (fixed)

2. has also been fixed.

By the way, thanks for the kind words. We hope the module will be useful when it is finished.

pimousse98’s picture

Hi, do you plan to fix 2. in version 3? I am running into that issue, but 4 is not stable enough for me yet...

falcon’s picture

Hi pimousse98!

You have to open a ticket for this against 3.x if you haven't already...

phponwebsites’s picture

Component: Code » Code - Quiz core

Solution ofr comment #6 task 3You need to add below lines with db_insert() query on quiz_insert() at quiz.module,

'max_score_for_random'        => $node->max_score_for_random,

Now you can keep maximum score always