Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 3.10.x will end 8 November 2021 (12 months).
  • Bug fixes for security issues in 3.10.x will end 9 May 2022 (18 months).
  • PHP version: minimum PHP 7.2.0 Note: minimum PHP version has increased since Moodle 3.8. PHP 7.3.x and 7.4.x are supported too.
   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   * @package   moodlecore
  18   * @subpackage backup-imscc
  19   * @copyright 2009 Mauro Rondinelli (mauro.rondinelli [AT] uvcms.com)
  20   * @license   http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
  21   */
  22  
  23  defined('MOODLE_INTERNAL') or die('Direct access to this script is forbidden.');
  24  
  25  // GENERAL PARAMETERS ************************************************************************************************* //
  26  define('ROOT_DEEP', 2);
  27  
  28  // PACKAGES FORMATS *************************************************************************************************** //
  29  define('FORMAT_UNKNOWN', 'NA');
  30  define('FORMAT_COMMON_CARTRIDGE', 'CC');
  31  define('FORMAT_BLACK_BOARD', 'BB');
  32  
  33  // FORMATS NAMESPACES ************************************************************************************************* //
  34  define('NS_COMMON_CARTRIDGE', 'http://www.imsglobal.org/xsd/imscc/imscp_v1p1');
  35  define('NS_BLACK_BOARD', 'http://www.blackboard.com/content-packaging');
  36  
  37  // SHEET FILES ******************************************************************************************************** //
  38  define('SHEET_BASE', 'cc/sheets/base.xml');
  39  define('SHEET_INFO_DETAILS_MOD', 'cc/sheets/info_details_mod.xml');
  40  define('SHEET_INFO_DETAILS_MOD_INSTANCE', 'cc/sheets/info_details_mod_instance.xml');
  41  define('SHEET_COURSE_BLOCKS_BLOCK', 'cc/sheets/course_blocks_block.xml');
  42  define('SHEET_COURSE_HEADER', 'cc/sheets/course_header.xml');
  43  define('SHEET_COURSE_SECTIONS_SECTION', 'cc/sheets/course_sections_section.xml');
  44  define('SHEET_COURSE_SECTIONS_SECTION_MODS_MOD', 'cc/sheets/course_sections_section_mods_mod.xml');
  45  define('SHEET_COURSE_SECTIONS_SECTION_MODS_MOD_FORUM', 'cc/sheets/course_modules_mod_forum.xml');
  46  define('SHEET_COURSE_SECTIONS_SECTION_MODS_MOD_LABEL', 'cc/sheets/course_modules_mod_label.xml');
  47  define('SHEET_COURSE_SECTIONS_SECTION_MODS_MOD_RESOURCE', 'cc/sheets/course_modules_mod_resource.xml');
  48  define('SHEET_COURSE_SECTIONS_SECTION_MODS_MOD_QUIZ', 'cc/sheets/course_modules_mod_quiz.xml');
  49  define('SHEET_COURSE_SECTIONS_SECTION_MODS_MOD_QUIZ_QUESTION_INSTANCE', 'cc/sheets/course_modules_mod_quiz_question_instance.xml');
  50  define('SHEET_COURSE_SECTIONS_SECTION_MODS_MOD_QUIZ_FEEDBACK', 'cc/sheets/course_modules_mod_quiz_feedback.xml');
  51  define('SHEET_COURSE_QUESTION_CATEGORIES', 'cc/sheets/course_question_categories.xml');
  52  define('SHEET_COURSE_QUESTION_CATEGORIES_QUESTION_CATEGORY', 'cc/sheets/course_question_categories_question_category.xml');
  53  define('SHEET_COURSE_QUESTION_CATEGORIES_QUESTION_CATEGORY_QUESTION', 'cc/sheets/course_question_categories_question_category_question.xml');
  54  define('SHEET_COURSE_QUESTION_CATEGORIES_QUESTION_CATEGORY_QUESTION_MULTIPLE_CHOICE', 'cc/sheets/course_question_categories_question_category_question_multiple_choice.xml');
  55  define('SHEET_COURSE_QUESTION_CATEGORIES_QUESTION_CATEGORY_QUESTION_TRUE_FALSE', 'cc/sheets/course_question_categories_question_category_question_true_false.xml');
  56  define('SHEET_COURSE_QUESTION_CATEGORIES_QUESTION_CATEGORY_QUESTION_EESAY', 'cc/sheets/course_question_categories_question_category_question_eesay.xml');
  57  define('SHEET_COURSE_QUESTION_CATEGORIES_QUESTION_CATEGORY_QUESTION_SHORTANSWER', 'cc/sheets/course_question_categories_question_category_question_shortanswer.xml');
  58  define('SHEET_COURSE_QUESTION_CATEGORIES_QUESTION_CATEGORY_QUESTION_ANSWER', 'cc/sheets/course_question_categories_question_category_question_answer.xml');
  59  define('SHEET_COURSE_SECTIONS_SECTION_MODS_MOD_BASICLTI', 'cc/sheets/course_modules_mod_basiclti.xml');
  60  define('SHEET_COURSE_SECTIONS_SECTION_MODS_MOD_LTI', 'cc/sheets/course_modules_mod_lti.xml');
  61  
  62  // CC RESOURCES TYPE ************************************************************************************************** //
  63  define('CC_TYPE_FORUM', 'imsdt_xmlv1p0');
  64  define('CC_TYPE_QUIZ', 'imsqti_xmlv1p2/imscc_xmlv1p0/assessment');
  65  define('CC_TYPE_QUESTION_BANK', 'imsqti_xmlv1p2/imscc_xmlv1p0/question-bank');
  66  define('CC_TYPE_WEBLINK', 'imswl_xmlv1p0');
  67  define('CC_TYPE_WEBCONTENT', 'webcontent');
  68  define('CC_TYPE_ASSOCIATED_CONTENT', 'associatedcontent/imscc_xmlv1p0/learning-application-resource');
  69  define('CC_TYPE_EMPTY', '');
  70  
  71  // MOODLE RESOURCES TYPE ********************************************************************************************** //
  72  define('MOODLE_TYPE_FORUM', 'forum');
  73  define('MOODLE_TYPE_QUIZ', 'quiz');
  74  define('MOODLE_TYPE_QUESTION_BANK', 'question_bank');
  75  define('MOODLE_TYPE_RESOURCE', 'resource');
  76  define('MOODLE_TYPE_LABEL', 'label');
  77  define('MOODLE_TYPE_BASICLTI', 'basiclti');
  78  define('MOODLE_TYPE_LTI', 'lti');
  79  
  80  // UNKNOWN TYPE ******************************************************************************************************* //
  81  define('TYPE_UNKNOWN', '[UNKNOWN]');
  82  
  83  // CC QUESTIONS TYPES ************************************************************************************************* //
  84  define('CC_QUIZ_MULTIPLE_CHOICE', 'cc.multiple_choice.v0p1');
  85  define('CC_QUIZ_TRUE_FALSE', 'cc.true_false.v0p1');
  86  define('CC_QUIZ_FIB', 'cc.fib.v0p1');
  87  define('CC_QUIZ_MULTIPLE_RESPONSE', 'cc.multiple_response.v0p1');
  88  define('CC_QUIZ_PATTERN_MACHT', 'cc.pattern_match.v0p1');
  89  define('CC_QUIZ_ESSAY', 'cc.essay.v0p1');
  90  
  91  //MOODLE QUESTIONS TYPES ********************************************************************************************** //
  92  define('MOODLE_QUIZ_MULTIPLE_CHOICE', 'multichoice');
  93  define('MOODLE_QUIZ_TRUE_FALSE', 'truefalse');
  94  define('MOODLE_QUIZ_MULTIANSWER', 'multianswer');
  95  define('MOODLE_QUIZ_MULTIPLE_RESPONSE', 'multichoice');
  96  define('MOODLE_QUIZ_MACHT', 'match');
  97  define('MOODLE_QUIZ_ESSAY', 'essay');
  98  define('MOODLE_QUIZ_SHORTANSWER', 'shortanswer');