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

turadg’s picture

Assigned: Unassigned » turadg
Status: Active » Fixed

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.