I receive a fatal error with the latest dev release. To reproduce:

1. Create new quiz.
2. Add new scale question.
3. Click 'Manage presets'.

Receive error: "Fatal error: Cannot pass parameter 1 by reference in ...\modules\quiz\question_types\scale\scale.module on line 146"

Line 146 is:
$scale_question = new ScaleQuestion(NULL);

Proposed solutions:

1. Change this to:
$null_object = new stdClass();
$scale_question = new ScaleQuestion($null_object);

2. Add parameter default to constructor of class QuizQuestion (in quiz_question.core.inc):
public function __construct(stdClass &$node = NULL) {
$this->node = $node;
}
And also change lines 146 and 230 of scale.module to:
$scale_question = new ScaleQuestion();

Both resolve this particular error. I prefer the second option but there may be other considerations that I haven't thought of.

Comments

falcon’s picture

Thanks for the report! I went for the simplest solution(1)

falcon’s picture

Status: Active » Closed (fixed)