Merge branch 'MDL-70248-310' of https://github.com/HuongNV13/moodle into MOODLE_310_S...
[moodle.git] / question / type / ddmarker / lib.php
CommitLineData
b3878dbd
JP
1<?php
2// This file is part of Moodle - http://moodle.org/
3//
4// Moodle is free software: you can redistribute it and/or modify
5// it under the terms of the GNU General Public License as published by
6// the Free Software Foundation, either version 3 of the License, or
7// (at your option) any later version.
8//
9// Moodle is distributed in the hope that it will be useful,
10// but WITHOUT ANY WARRANTY; without even the implied warranty of
11// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12// GNU General Public License for more details.
13//
14// You should have received a copy of the GNU General Public License
15// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
16
17/**
f8bb5fdc 18 * Serve question type files.
b3878dbd 19 *
f8bb5fdc
TH
20 * @package qtype_ddmarker
21 * @copyright 2012 The Open University
22 * @author Jamie Pratt <me@jamiep.org>
23 * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
b3878dbd
JP
24 */
25
b3878dbd
JP
26defined('MOODLE_INTERNAL') || die();
27
b3878dbd 28/**
8bc1d28b
EM
29 * Checks file access for ddmarker questions.
30 *
31 * @param object $course The course we are in
32 * @param object $cm Course module
33 * @param object $context The context object
34 * @param string $filearea the name of the file area.
35 * @param array $args the remaining bits of the file path.
36 * @param bool $forcedownload whether the user must be forced to download the file.
37 * @param array $options additional options affecting the file serving
b3878dbd 38 */
bd6d6e4a 39function qtype_ddmarker_pluginfile($course, $cm, $context, $filearea, $args, $forcedownload, array $options=array()) {
b3878dbd
JP
40 global $CFG;
41 require_once($CFG->libdir . '/questionlib.php');
bd6d6e4a 42 question_pluginfile($course, $context, 'qtype_ddmarker', $filearea, $args, $forcedownload, $options);
b3878dbd 43}
2b931458
DW
44
45/**
46 * Get icon mapping for font-awesome.
47 */
48function qtype_ddmarker_get_fontawesome_icon_map() {
49 return [
50 'qtype_ddmarker:crosshairs' => 'fa-crosshairs',
51 'qtype_ddmarker:grid' => 'fa-th',
52 ];
53}