Skip to content

Commit

Permalink
MDL-34399 questions cleanup: straighten out strange links to question…
Browse files Browse the repository at this point in the history
… objects.
  • Loading branch information
timhunt committed Oct 26, 2012
1 parent 204ceaa commit 15dd772
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion question/behaviour/behaviourbase.php
Original file line number Diff line number Diff line change
Expand Up @@ -458,7 +458,7 @@ public function process_comment(question_attempt_pending_step $pendingstep) {
$fraction = null;
} else if ($fraction > 1 || $fraction < $this->qa->get_min_fraction()) {
throw new coding_exception('Score out of range when processing ' .
'a manual grading action.', 'Question ' . $this->qa->get_question()->id .
'a manual grading action.', 'Question ' . $this->question->id .
', slot ' . $this->qa->get_slot() . ', fraction ' . $fraction);
}
$pendingstep->set_fraction($fraction);
Expand Down
2 changes: 1 addition & 1 deletion question/behaviour/immediatecbm/behaviour.php
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ public function process_submit(question_attempt_pending_step $pendingstep) {
return question_attempt::DISCARD;
}

if (!$this->qa->get_question()->is_gradable_response($pendingstep->get_qt_data()) ||
if (!$this->question->is_gradable_response($pendingstep->get_qt_data()) ||
!$pendingstep->has_behaviour_var('certainty')) {
$pendingstep->set_state(question_state::$invalid);
return question_attempt::KEEP;
Expand Down
2 changes: 1 addition & 1 deletion question/type/shortanswer/question.php
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ public function check_file_access($qa, $options, $component, $filearea,
$args, $forcedownload) {
if ($component == 'question' && $filearea == 'answerfeedback') {
$currentanswer = $qa->get_last_qt_var('answer');
$answer = $qa->get_question()->get_matching_answer(array('answer' => $currentanswer));
$answer = $this->get_matching_answer(array('answer' => $currentanswer));
$answerid = reset($args); // itemid is answer id.
return $options->feedback && $answer && $answerid == $answer->id;

Expand Down

0 comments on commit 15dd772

Please sign in to comment.