Skip to content

Commit

Permalink
Merge branch 'MDL-36806_22' of git://github.com/timhunt/moodle into M…
Browse files Browse the repository at this point in the history
…OODLE_22_STABLE
  • Loading branch information
danpoltawski committed Nov 27, 2012
2 parents fee4404 + 8ee045c commit 24d215d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/questionlib.php
Expand Up @@ -1797,10 +1797,10 @@ function question_pluginfile($course, $context, $component, $filearea, $args, $f
send_file_not_found(); send_file_not_found();
} }


list($context, $course, $cm) = get_context_info_array($context->id);
require_login($course, false, $cm);

if ($filearea === 'export') { 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'); require_once($CFG->dirroot . '/question/editlib.php');
$contexts = new question_edit_contexts($context); $contexts = new question_edit_contexts($context);
// check export capability // check export capability
Expand Down
3 changes: 3 additions & 0 deletions question/previewlib.php
Expand Up @@ -228,6 +228,9 @@ function question_preview_question_pluginfile($course, $context, $component,
$filearea, $qubaid, $slot, $args, $forcedownload) { $filearea, $qubaid, $slot, $args, $forcedownload) {
global $USER, $DB, $CFG; 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); $quba = question_engine::load_questions_usage_by_activity($qubaid);


if (!question_has_capability_on($quba->get_question($slot), 'use')) { if (!question_has_capability_on($quba->get_question($slot), 'use')) {
Expand Down

0 comments on commit 24d215d

Please sign in to comment.