The attached patch makes the following changes to the file quiz.pages.inc:
- function quiz_report_form_submit():
-- no longer calls _quiz_remove_unscored_message() when the UPDATE query doesn't affect any row (i.e. db_update(...)->execute() returns 0). Please see http://drupal.org/node/1371970 for more details.
-- uses the D7 fetchObject() i.o. db_fetch_object
-- uses $quiz->keep_results i.o. $quiz->quiz_keep_results
- function quiz_update_total_score_fast() is compliant to the D7 API

CommentFileSizeAuthor
quiz-quiz.pages_.inc_.patch4.28 KBrombapa

Comments

rombapa’s picture

Issue summary: View changes

correction

zeezhao’s picture

Title: Patch for quiz.pages.inc » Patch for quiz.pages.inc - percentage mark of quiz is still wrong on results page

Hi. Just to let you know that this bug still exists:
- the percentage mark of quiz is still wrong on results page of quiz, even though individual scores on each question now correct. This is for long answer type questions - since question is scored later.

I tested it myself by applying your patch, and also tested with this version that has applied your patches:
http://drupal.org/node/1381014

Thanks

Sabareesh’s picture

A bit from this patch saved my time a lot.

SteveK’s picture

@Sabareesh.KF , care to share? :)

sivaji_ganesh_jojodae’s picture

Status: Needs review » Fixed

I'm not able to reproduce the bug. It looks like the patch has been committed to sandbox repository and merged back to main repository recently.

sivaji_ganesh_jojodae’s picture

Status: Fixed » Closed (duplicate)

Noticed that it is still happening when the form in manage questions page is submitted. More explanation about this issue can be found in #1314072: Quiz Results incorrectly calculated when you change the quiz settings.

zeezhao’s picture

It is still an issue when you have "long answer" or "short answer" type questions in a quiz, and you edit it to score them.

zeezhao’s picture

Status: Closed (duplicate) » Active

I have changed it to active, since the case is different from #5.

zeezhao’s picture

Status: Active » Closed (fixed)

tried out very latest dev and created a new quiz and appears fixed. So #5 is a separate issue. Thanks

zeezhao’s picture

Issue summary: View changes

added reference to issue 1371970