Merge branch 'MDL-27869' of git://github.com/timhunt/moodle
This commit is contained in:
@@ -245,6 +245,22 @@ class qtype_multianswer_question extends question_graded_automatically {
|
||||
}
|
||||
|
||||
public function check_file_access($qa, $options, $component, $filearea, $args, $forcedownload) {
|
||||
// TODO
|
||||
if ($component == 'question' && $filearea == 'answer') {
|
||||
return true;
|
||||
|
||||
} else if ($component == 'question' && $filearea == 'answerfeedback') {
|
||||
// Full logic to control which feedbacks a student can see is too complex.
|
||||
// Just allow access to all images. There is a theoretical chance the
|
||||
// students could see files they are not meant to see by guessing URLs,
|
||||
// but it is remote.
|
||||
return $options->feedback;
|
||||
|
||||
} else if ($component == 'question' && $filearea == 'hint') {
|
||||
return $this->check_hint_file_access($qa, $options, $args);
|
||||
|
||||
} else {
|
||||
return parent::check_file_access($qa, $options, $component, $filearea,
|
||||
$args, $forcedownload);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -240,8 +240,8 @@ class qtype_numerical_question extends question_graded_automatically {
|
||||
$this->apply_unit_penalty($ans->fraction, $unit)));
|
||||
}
|
||||
|
||||
public function check_file_access($question, $state, $options, $contextid, $component,
|
||||
$filearea, $args) {
|
||||
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));
|
||||
|
||||
Reference in New Issue
Block a user