Skip to content
Snippets Groups Projects
Select Git revision
  • 7b7b77bae98cdf22784fbbf2b802c890c9aaf81f
  • master default protected
  • gitkeep
  • dev protected
  • Issue/2464-invalidateMeta
  • Issue/2309-docs
  • Issue/2462-removeTraces
  • Hotfix/2459-EncodingPath
  • Hotfix/2452-linkedDeletion
  • Issue/1792-newMetadataStructure
  • Hotfix/2371-fixGitLabinRCV
  • Fix/xxxx-activateGitlab
  • Issue/2349-gitlabHttps
  • Issue/2287-guestRole
  • Issue/2102-gitLabResTypeRCV
  • Hotfix/2254-fixContentLenghtCalculation
  • Fix/xxxx-resourceVisibility
  • Issue/1951-quotaImplementation
  • Issue/2162-fixFolderResponse
  • Issue/2158-emailServicedesk
  • Hotfix/2141-fileUploadErrors
  • v3.3.4
  • v3.3.3
  • v3.3.2
  • v3.3.1
  • v3.3.0
  • v3.2.3
  • v3.2.2
  • v3.2.1
  • v3.2.0
  • v3.1.2
  • v3.1.1
  • v3.1.0
  • v3.0.6
  • v3.0.5
  • v3.0.4
  • v3.0.3
  • v3.0.2
  • v3.0.1
  • v3.0.0
  • v2.8.2
41 results

BlobController.cs

Blame
  • Code owners
    Assign users and groups as approvers for specific file changes. Learn more.
    controller.php 49.41 KiB
    <?php
    // This file is part of Moodle - http://moodle.org/
    //
    // Moodle is free software: you can redistribute it and/or modify
    // it under the terms of the GNU General Public License as published by
    // the Free Software Foundation, either version 3 of the License, or
    // (at your option) any later version.
    //
    // Moodle is distributed in the hope that it will be useful,
    // but WITHOUT ANY WARRANTY; without even the implied warranty of
    // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    // GNU General Public License for more details.
    //
    // You should have received a copy of the GNU General Public License
    // along with Moodle.  If not, see <http://www.gnu.org/licenses/>.
    
    /**
     *
     * @package   mod_cardbox
     * @copyright 2019 RWTH Aachen (see README.md)
     * @author    Anna Heynkes
     * @license   http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
     */
    defined('MOODLE_INTERNAL') || die();
    define ('ENABLE_AUTOCORRECT', 0);
    define ('DISABLE_AUTOCORRECT', 1);
    
    
    
    require_once($CFG->dirroot.'/mod/cardbox/locallib.php');
    
    if (!isset($action)) {
        $action = required_param('action', PARAM_ALPHA);
    }
    
    /* *********************************************** Add a new flashcard *********************************************** */
    
    if ($action === 'addflashcard') {
    
        require_capability('mod/cardbox:submitcard', $context);
        require_once('card_form.php');
        $PAGE->set_url('/mod/cardbox/view.php', array('id' => $cm->id, 'action' => 'addflashcard'));
        $returnurl = new moodle_url('/mod/cardbox/view.php', array('id' => $cmid, 'action' => 'practice'));
        $actionurl = new moodle_url('/mod/cardbox/view.php', array('id' => $cmid, 'action' => 'addflashcard'));
    
        $stringman = get_string_manager();
        $strings = $stringman->load_component_strings('cardbox', 'en'); // Method gets the strings of the language files.
        $PAGE->requires->strings_for_js(array_keys($strings), 'cardbox'); // Method to use the language-strings in javascript.
        $PAGE->requires->js(new moodle_url("/mod/cardbox/js/addcard.js?ver=00001"));
        $params = array($cmid, 1, null); // true means: the user checks their own results.
        $PAGE->requires->js_init_call('addCard', $params, true);
    
        // Contextual data to pass on to the card form.
        if (empty($entry)) {
            $entry = new stdClass();
            $entry->id = $cmid;
            $entry->course = $cm->course;
            $entry->action = $action;
        }
    
        $options = array('subdirs' => 0, 'maxbytes' => 0, 'areamaxbytes' => 10485760, 'maxfiles' => 3,
                              'accepted_types' => array('bmp', 'gif', 'jpeg', 'jpg', 'png', 'svg'), 'return_types' => 1 | 2);
        $component = 'mod_cardbox';
        $filearea = 'content';
    
        $customdata = array('cardboxid' => $cardbox->id, 'cmid' => $cmid, 'allowautocorrection' => $cardbox->autocorrection);
        $mform = new mod_cardbox_card_form(null, $customdata);
        $mform->set_data($entry);
    
        if ($mform->is_cancelled()) {