MDL-57597 competency: Fix serving of prior learning evidence files
authorDavid Mudrák <david@moodle.com>
Mon, 13 Feb 2017 21:49:33 +0000 (22:49 +0100)
committerDan Poltawski <dan@moodle.com>
Fri, 10 Mar 2017 18:03:51 +0000 (18:03 +0000)
For security reasons, all files submitted by students must be disposed
as attachments, not inline contents.

competency/lib.php

index 847bd07..1e5bdfd 100644 (file)
@@ -290,6 +290,7 @@ function core_competency_pluginfile($course, $cm, $context, $filearea, $args, $f
     if ($filearea == 'userevidence' && $context->contextlevel == CONTEXT_USER) {
         if (user_evidence::can_read_user($context->instanceid)) {
             $file = $fs->get_file($context->id, 'core_competency', $filearea, $itemid, $filepath, $filename);
+            $forcedownload = true;
         }
     }