MDL-57587 question file access: fix regression caused by MDL-53744
This commit is contained in:
@@ -668,11 +668,18 @@ abstract class question_graded_automatically extends question_with_responses
|
||||
* @param question_attempt $qa the question attempt being displayed.
|
||||
* @param question_display_options $options the options that control display of the question.
|
||||
* @param string $filearea the name of the file area.
|
||||
* @param array $args the remaining bits of the file path.
|
||||
* @return bool whether access to the file should be allowed.
|
||||
*/
|
||||
protected function check_combined_feedback_file_access($qa, $options, $filearea) {
|
||||
protected function check_combined_feedback_file_access($qa, $options, $filearea, $args = null) {
|
||||
$state = $qa->get_state();
|
||||
|
||||
if ($args === null) {
|
||||
debugging('You must pass $args as the fourth argument to check_combined_feedback_file_access.',
|
||||
DEBUG_DEVELOPER);
|
||||
$args = array($this->id); // Fake it for now, so the rest of this method works.
|
||||
}
|
||||
|
||||
if (!$state->is_finished()) {
|
||||
$response = $qa->get_last_qt_data();
|
||||
if (!$this->is_gradable_response($response)) {
|
||||
|
||||
Reference in New Issue
Block a user