Closed (fixed)
Project:
Quiz
Version:
6.x-4.x-dev
Component:
Code
Priority:
Normal
Category:
Task
Assigned:
Reporter:
Created:
17 Aug 2009 at 20:24 UTC
Updated:
31 Aug 2009 at 20:40 UTC
AbstractQuizQuestionResponse has two instance variables that are public and shouldn't be:
// These are only public until we can
// adjust all of Quiz. DO NOT EXPECT THESE
// TO BE ACCESSIBLE!
public $rid = 0;
public $is_correct = FALSE;
The problem with vars instead of getters is that they're mutable.
But looking through the code, it turns out there are no places where ->is_correct or ->rid are referenced. There are several references to $result->is_correct or $result->rid, but those are references to objects made by evaluate_question or skip_question, which return new objects (e.g. by toBareObj())
So I've gone ahead and changed the two values to protected. I looked everything over thoroughly, but please test.
Comments
Comment #1
turadg commented