Closed (fixed)
Project:
Quiz
Version:
6.x-4.0-rc9
Component:
Code - Quiz module
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
12 Oct 2010 at 10:46 UTC
Updated:
30 Nov 2010 at 12:30 UTC
Jump to comment: Most recent file
Comments
Comment #1
fuzzy76 commentedOr I guess you could have the function return best score only by changing:
$to_return[$res_o->vid] = $res_o;
to:
if (isset($to_return[$res_o->vid])) {
if ($res_o->percent_score > $to_return[$res_o->vid]->percent_score) {
$to_return[$res_o->vid] = $res_o;
}
}
else {
$to_return[$res_o->vid] = $res_o;
}
Comment #2
falcon commentedI think you told me that you had a patch for this one?
Comment #3
falcon commentedComment #4
fuzzy76 commentedSorry about forgetting it! :) Here you go. I opted for only returning the highest score. Since I think that was the use case that function were meant for initially.
Comment #5
fuzzy76 commentedComment #6
falcon commentedThanks! Patch has been committed.