コード例 #1
0
ファイル: question.php プロジェクト: evltuma/moodle
 public function check_file_access($qa, $options, $component, $filearea, $args, $forcedownload)
 {
     if ($component == 'question' && $filearea == 'response_attachments') {
         // Response attachments visible if the question has them.
         return $this->attachments != 0;
     } else {
         if ($component == 'question' && $filearea == 'response_answer') {
             // Response attachments visible if the question has them.
             return $this->responseformat === 'editorfilepicker';
         } else {
             if ($component == 'qtype_essay' && $filearea == 'graderinfo') {
                 return $options->manualcomment;
             } else {
                 return parent::check_file_access($qa, $options, $component, $filearea, $args, $forcedownload);
             }
         }
     }
 }
コード例 #2
0
ファイル: question.php プロジェクト: laiello/poodll.poodll2
 public function check_file_access($qa, $options, $component, $filearea, $args, $forcedownload)
 {
     //print_object($qa);
     if ($component == 'question' && $filearea == 'response_answer') {
         //since we will put files in respnse_answer, this is likely to be always true.
         return true;
         //if we are showing a whiteboard backimage, there is no need to restrict here
     } else {
         if ($component == 'qtype_poodllrecording' && $filearea == 'backimage') {
             return true;
         } else {
             if ($component == 'qtype_poodllrecording' && $filearea == 'graderinfo') {
                 return $options->manualcomment;
             } else {
                 return parent::check_file_access($qa, $options, $component, $filearea, $args, $forcedownload);
             }
         }
     }
 }