AutorÃa | Ultima modificación | Ver Log |
{"version":3,"file":"normalise.min.js","sources":["../../../../src/grades/grader/gradingpanel/normalise.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 * Error handling and normalisation of provided data.\n *\n * @module core_grades/grades/grader/gradingpanel/normalise\n * @copyright 2019 Andrew Nicols <andrew@nicols.co.uk>\n * @licens
e http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\n\n/**\n * Normalise a resultset for consumption by the grader.\n *\n * @param {Object} result The result returned from a grading web service\n * @return {Object}\n */\nexport const normaliseResult = result => {\n return {\n result,\n failed: !!result.warnings.length,\n success: !result.warnings.length,\n error: null,\n };\n};\n\n/**\n * Return the resultset used to describe an invalid result.\n *\n * @return {Object}\n */\nexport const invalidResult = () => {\n return {\n success: false,\n failed: false,\n result: {},\n error: null,\n };\n};\n\n/**\n * Return the resultset used to describe a failed update.\n *\n * @param {Object} error\n * @return {Object}\n */\nexport const failedUpdate = error => {\n return {\n success: false,\n failed: true,\n result: {},\n error,\n };\n};\n"],"names":["result","failed","warnings","length","success","erro
r"],"mappings":"wPA6B+BA,SACpB,CACHA,OAAAA,OACAC,SAAUD,OAAOE,SAASC,OAC1BC,SAAUJ,OAAOE,SAASC,OAC1BE,MAAO,8BASc,KAClB,CACHD,SAAS,EACTH,QAAQ,EACRD,OAAQ,GACRK,MAAO,6BAUaA,QACjB,CACHD,SAAS,EACTH,QAAQ,EACRD,OAAQ,GACRK,MAAAA"}