From d0a9505ceee422bf366f69b7c172b418a39ad05c Mon Sep 17 00:00:00 2001 From: Mihail Geshoski Date: Fri, 23 Feb 2024 10:23:45 +0800 Subject: [PATCH] MDL-79863 qtype_ordering: Fix access control to files The implementation of the check_file_access() method needs to be added in the qtype_ordering_question class in order to ensure the users have the appropriate access rights to a particular file. --- question/type/ordering/question.php | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/question/type/ordering/question.php b/question/type/ordering/question.php index 5eb22ff2887..9b1adf5ec01 100644 --- a/question/type/ordering/question.php +++ b/question/type/ordering/question.php @@ -533,14 +533,8 @@ class qtype_ordering_question extends question_graded_automatically { return parent::check_file_access($qa, $options, $component, $filearea, $args, $forcedownload); } - // Methods from "question_graded_automatically" class. - // See "question/type/questionbase.php". - /** - * Check a request for access to a file belonging to a combined feedback field. - * - * Fix a bug in Moodle 2.9 & 3.0, in which this method does not declare $args, - * so trying to use $args[0] always fails and images in feedback are not shown. + * Checks whether the user has permission to access a particular file. * * @param question_attempt $qa the question attempt being displayed. * @param question_display_options $options the options that control display of the question.