Permalink
Browse files

Merge branch 'MDL-36806_23' of git://github.com/timhunt/moodle into M…

…OODLE_23_STABLE
  • Loading branch information...
2 parents f441ec2 + 36ab57f commit 6ac0d92d5ba510eee5c927554d7b86abf9abb528 @danpoltawski danpoltawski committed Nov 27, 2012
Showing with 6 additions and 3 deletions.
  1. +3 −3 lib/questionlib.php
  2. +3 −0 question/previewlib.php
View
@@ -1803,10 +1803,10 @@ function question_pluginfile($course, $context, $component, $filearea, $args, $f
send_file_not_found();
}
- list($context, $course, $cm) = get_context_info_array($context->id);
- require_login($course, false, $cm);
-
if ($filearea === 'export') {
+ list($context, $course, $cm) = get_context_info_array($context->id);
+ require_login($course, false, $cm);
+
require_once($CFG->dirroot . '/question/editlib.php');
$contexts = new question_edit_contexts($context);
// check export capability
@@ -231,6 +231,9 @@ function question_preview_question_pluginfile($course, $context, $component,
$filearea, $qubaid, $slot, $args, $forcedownload, $fileoptions) {
global $USER, $DB, $CFG;
+ list($context, $course, $cm) = get_context_info_array($context->id);
+ require_login($course, false, $cm);
+
$quba = question_engine::load_questions_usage_by_activity($qubaid);
if (!question_has_capability_on($quba->get_question($slot), 'use')) {

0 comments on commit 6ac0d92

Please sign in to comment.