Proyectos de Subversion Moodle

Rev

Rev 1 | Autoría | Comparar con el anterior | Ultima modificación | Ver Log |

{"version":3,"file":"add_question_modal.min.js","sources":["../src/add_question_modal.js"],"sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle.  If not, see <http://www.gnu.org/licenses/>.\n\n/**\n * Contain the logic for the add random question modal.\n *\n * @module     mod_quiz/add_question_modal\n * @copyright  2023 Andrew Lyons <andrew@nicols.co.uk>\n * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\n\nimport Modal from 'core/modal';\n\nexport default class AddQuestionModal extends Modal {\n    configure(modalConfig) {\n        // Add question modals are always large.\n        modalConfig.large = true;\n\n        // Always show on creation.\n        modalConfig.show = true;\n        modalConfig.removeOnClose = true;\n\n        // Apply question modal configuration.\n        this.setContextId(modalConfig.contextId);\n        this.setAddOnPageId(modalConfig.addOnPage);\n\n        // Apply standard configuration.\n        super.configure(modalConfig);\n    }\n\n    constructor(root) {\n        super(root);\n\n        this.contextId = null;\n        this.addOnPageId = null;\n    }\n\n    /**\n     * Save the Moodle context id that the question bank is being\n     * rendered in.\n     *\n     * @method setContextId\n     * @param {Number} id\n     */\n    setContextId(id) {\n        this.contextId = id;\n    }\n\n    /**\n     * Retrieve the saved Moodle context id.\n     *\n     * @method getContextId\n     * @return {Number}\n     */\n    getContextId() {\n        return this.contextId;\n    }\n\n    /**\n     * Set the id of the page that the question should be added to\n     * when the user clicks the add to quiz link.\n     *\n     * @method setAddOnPageId\n     * @param {Number} id\n     */\n    setAddOnPageId(id) {\n        this.addOnPageId = id;\n    }\n\n    /**\n     * Returns the saved page id for the question to be added to.\n     *\n     * @method getAddOnPageId\n     * @return {Number}\n     */\n    getAddOnPageId() {\n        return this.addOnPageId;\n    }\n\n}\n"],"names":["AddQuestionModal","Modal","configure","modalConfig","large","show","removeOnClose","setContextId","contextId","setAddOnPageId","addOnPage","constructor","root","addOnPageId","id","getContextId","this","getAddOnPageId"],"mappings":";;;;;;;iJAyBqBA,yBAAyBC,eAC1CC,UAAUC,aAENA,YAAYC,OAAQ,EAGpBD,YAAYE,MAAO,EACnBF,YAAYG,eAAgB,OAGvBC,aAAaJ,YAAYK,gBACzBC,eAAeN,YAAYO,iBAG1BR,UAAUC,aAGpBQ,YAAYC,YACFA,WAEDJ,UAAY,UACZK,YAAc,KAUvBN,aAAaO,SACJN,UAAYM,GASrBC,sBACWC,KAAKR,UAUhBC,eAAeK,SACND,YAAcC,GASvBG,wBACWD,KAAKH"}