Closed (fixed)
Project:
Quiz
Version:
6.x-3.0
Component:
Code - Quiz module
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
11 Jun 2009 at 19:24 UTC
Updated:
11 May 2010 at 11:43 UTC
Jump to comment: Most recent file
Comments
Comment #1
mbutcher commentedHmm... only multichoice has built-in support for personality quizzes. I guess we should figure out a way to handle this for short and long answer question types, which could legitimately be used for personality quizzes.
Comment #2
sivaji_ganesh_jojodae commentedattached patches will fix it. Committed to 3.x as well as 4.x.
Comment #3
turadg commentedI think we can make a more reliable fix. Here is the isCorrect() function for long_answer now:
public function isCorrect() {
$possible = _quiz_question_get_instance($this->question)->getMaximumScore();
$actual = $this->score;
// To prevent Division by zero warning
$possible = ($possible == 0) ? 1 : $possible;
return (($actual / $possible) * 100 > 50);
}
1) Why should $possible ever be less than one? If there's no good case, then we should enforce that $possible>=1 throughout the object lifetime and avoid this hack.
2) If possible is allowed to be zero, what does that mean? I would think it means that getting 0 out of 0 would be counted as isCorrect(), but this function will count it as incorrect.
3) Where does that 50% threshold come from? A long answer is correct if over 50% of possible points are earned? That seems like something a user would want to control. Shouldn't it go into the long answer admin section?
Comment #4
falcon commentedThis issue doesn't seem relevant anymore. ($possible == $actual is the new logic for all of our current question types.)
Comment #5
falcon commented