}
}
-/**
- * Class for question formats
- */
-class plugintype_qformat extends plugintype_base implements plugin_information {
-
- /**
- * @see plugin_information::init_display_name()
- */
- public function init_display_name() {
- if (get_string_manager()->string_exists('pluginname', $this->component)) {
- $this->displayname = get_string('pluginname', $this->component);
- } else {
- $this->displayname = get_string($this->name, $this->component);
- }
- }
-}
/**
* Class for authentication plugins
if ($provided) {
list($notused, $fileformat) = explode('_', $component, 2);
- if (get_string_manager()->string_exists('pluginname', $component)) {
- $fileformatnames[$fileformat] = get_string('pluginname', $component);
- } else {
- $fileformatnames[$fileformat] = get_string($fileformat, $component);
- }
+ $fileformatnames[$fileformat] = get_string('pluginname', $component);
}
}
$provided = $format_class->provide_export();
}
if ($provided) {
- $formatname = get_string($fileformat, 'qformat_'.$fileformat);
- $fileformatnames[$fileformat] = $formatname;
+ $fileformatnames[$fileformat] = get_string('pluginname', 'qformat_'.$fileformat);
}
}
natcasesort($fileformatnames);
foreach ($fileformatnames as $shortname => $fileformatname) {
$currentgrp1 = array();
$currentgrp1[] = $mform->createElement('radio', 'format', '', $fileformatname, $shortname);
- $mform->addGroup($currentgrp1, "formathelp[$i]", '', array('<br />'), false);
- $mform->addHelpButton("formathelp[$i]", $shortname, 'qformat_' . $shortname);
+ $mform->addGroup($currentgrp1, "formathelp[$i]", ' ', array('<br />'), false);
+
+ if (get_string_manager()->string_exists('pluginname_help', 'qformat_' . $shortname)) {
+ $mform->addHelpButton("formathelp[$i]", 'pluginname', 'qformat_' . $shortname);
+ }
+
$i++ ;
}
$mform->addRule("formathelp[0]", null, 'required', null, 'client');
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
-$string['aiken'] = 'Aiken format';
-$string['aiken_help'] = 'This is a simple format for importing multiple choice questions from a text file.';
-$string['aiken_link'] = 'qformat/aiken';
+$string['pluginname'] = 'Aiken format';
+$string['pluginname_help'] = 'This is a simple format for importing multiple choice questions from a text file.';
+$string['pluginname_link'] = 'qformat/aiken';
--- /dev/null
+<?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/>.
+
+/**
+ * Version information for the calculated question type.
+ *
+ * @package qformat
+ * @subpackage aiken
+ * @copyright 2011 The Open University
+ * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
+ */
+
+defined('MOODLE_INTERNAL') || die();
+
+$plugin->component = 'qformat_aiken';
+$plugin->version = 2011102700;
+
+$plugin->requires = 2011102700;
+
+$plugin->maturity = MATURITY_STABLE;
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
-$string['blackboard'] = 'Blackboard';
-$string['blackboard_help'] = 'Blackboard format enables questions saved in the Blackboard version 5 "POOL" type export format to be imported.';
+$string['pluginname'] = 'Blackboard';
+$string['pluginname_help'] = 'Blackboard format enables questions saved in the Blackboard version 5 "POOL" type export format to be imported.';
--- /dev/null
+<?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/>.
+
+/**
+ * Version information for the calculated question type.
+ *
+ * @package qformat
+ * @subpackage blackboard
+ * @copyright 2011 The Open University
+ * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
+ */
+
+defined('MOODLE_INTERNAL') || die();
+
+$plugin->component = 'qformat_blackboard';
+$plugin->version = 2011102700;
+
+$plugin->requires = 2011102700;
+
+$plugin->maturity = MATURITY_STABLE;
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
-$string['blackboard_six'] = 'Blackboard V6+';
-$string['blackboard_six_help'] = 'Blackboard V6+ format enables questions saved in Blackboard\'s export format to be imported via zip file. It provides limited support for Blackboard Version 6 and 7.';
+$string['pluginname'] = 'Blackboard V6+';
+$string['pluginname_help'] = 'Blackboard V6+ format enables questions saved in Blackboard\'s export format to be imported via zip file. It provides limited support for Blackboard Version 6 and 7.';
--- /dev/null
+<?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/>.
+
+/**
+ * Version information for the calculated question type.
+ *
+ * @package qformat
+ * @subpackage blackboard_six
+ * @copyright 2011 The Open University
+ * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
+ */
+
+defined('MOODLE_INTERNAL') || die();
+
+$plugin->component = 'qformat_blackboard_six';
+$plugin->version = 2011102700;
+
+$plugin->requires = 2011102700;
+
+$plugin->maturity = MATURITY_STABLE;
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
-$string['examview'] = 'Examview';
-$string['examview_help'] = 'Examview format enables the import of questions from Examview 4 XML files. For newer versions of Examview, Blackboard format may be used.';
+$string['pluginname'] = 'Examview';
+$string['pluginname_help'] = 'Examview format enables the import of questions from Examview 4 XML files. For newer versions of Examview, Blackboard format may be used.';
--- /dev/null
+<?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/>.
+
+/**
+ * Version information for the calculated question type.
+ *
+ * @package qformat
+ * @subpackage examview
+ * @copyright 2011 The Open University
+ * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
+ */
+
+defined('MOODLE_INTERNAL') || die();
+
+$plugin->component = 'qformat_examview';
+$plugin->version = 2011102700;
+
+$plugin->requires = 2011102700;
+
+$plugin->maturity = MATURITY_STABLE;
*/
$string['braceerror'] = 'Could not find {...} around answers';
-$string['gift'] = 'Gift format';
-$string['gift_help'] = 'Gift format enables multiple-choice, true-false, short answer, matching, missing word, numerical and essay questions to be imported or exported via text file.';
-$string['gift_link'] = 'qformat/gift';
-$string['gift'] = 'GIFT format';
$string['giftleftbraceerror'] = 'Could not find a {';
$string['giftmatchingformat'] = 'Matching question answers are improperly formatted';
$string['giftnonumericalanswers'] = 'No answers found for numerical question';
$string['importminerror'] = 'There is an error in the question. There are not enough answers for this question type';
$string['nohandler'] = 'No handler for question type {$a}';
$string['pluginname'] = 'Gift format';
+$string['pluginname_help'] = 'Gift format enables multiple-choice, true-false, short answer, matching, missing word, numerical and essay questions to be imported or exported via text file.';
+$string['pluginname_link'] = 'qformat/gift';
--- /dev/null
+<?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/>.
+
+/**
+ * Version information for the calculated question type.
+ *
+ * @package qformat
+ * @subpackage gift
+ * @copyright 2011 The Open University
+ * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
+ */
+
+defined('MOODLE_INTERNAL') || die();
+
+$plugin->component = 'qformat_gift';
+$plugin->version = 2011102700;
+
+$plugin->requires = 2011102700;
+
+$plugin->maturity = MATURITY_STABLE;
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
-$string['learnwise'] = 'Learnwise format';
-$string['learnwise_help'] = 'This format enables the import of multiple choice questions saved in Learnwise\'s XML format.';
+$string['pluginname'] = 'Learnwise format';
+$string['plugidnname_help'] = 'This format enables the import of multiple choice questions saved in Learnwise\'s XML format.';
--- /dev/null
+<?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/>.
+
+/**
+ * Version information for the calculated question type.
+ *
+ * @package qformat
+ * @subpackage learnwise
+ * @copyright 2011 The Open University
+ * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
+ */
+
+defined('MOODLE_INTERNAL') || die();
+
+$plugin->component = 'qformat_learnwise';
+$plugin->version = 2011102700;
+
+$plugin->requires = 2011102700;
+
+$plugin->maturity = MATURITY_STABLE;
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
-$string['missingword'] = 'Missing word format';
-$string['missingword_help'] = 'Missing word format enables questions to be imported via text file.';
-$string['missingword_link'] = 'Missing word format';
+$string['pluginname'] = 'Missing word format';
+$string['pluginname_help'] = 'Missing word format enables questions to be imported via text file.';
+$string['pluginname_link'] = 'Missing word format';
--- /dev/null
+<?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/>.
+
+/**
+ * Version information for the calculated question type.
+ *
+ * @package qformat
+ * @subpackage missingword
+ * @copyright 2011 The Open University
+ * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
+ */
+
+defined('MOODLE_INTERNAL') || die();
+
+$plugin->component = 'qformat_missingword';
+$plugin->version = 2011102700;
+
+$plugin->requires = 2011102700;
+
+$plugin->maturity = MATURITY_STABLE;
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
-$string['multianswer'] = 'Embedded answers (Cloze)';
-$string['multianswer_help'] = 'Embedded answers (Cloze) format enables the import of a passage of text with questions such as multiple-choice and short answer embedded within it.';
-$string['multianswer_link'] = 'question/type/multianswer';
+$string['pluginname'] = 'Embedded answers (Cloze)';
+$string['pluginname_help'] = 'Embedded answers (Cloze) format enables the import of a passage of text with questions such as multiple-choice and short answer embedded within it.';
+$string['pluginname_link'] = 'question/type/multianswer';
--- /dev/null
+<?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/>.
+
+/**
+ * Version information for the calculated question type.
+ *
+ * @package qformat
+ * @subpackage multianswer
+ * @copyright 2011 The Open University
+ * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
+ */
+
+defined('MOODLE_INTERNAL') || die();
+
+$plugin->component = 'qformat_multianswer';
+$plugin->version = 2011102700;
+
+$plugin->requires = 2011102700;
+
+$plugin->maturity = MATURITY_STABLE;
--- /dev/null
+This files describes API changes for question import/export format plugins.
+
+=== 2.2 ===
+
+* The plugin name used to be defined in a string called the same thing as the
+format, with assoicated help strings, for example:
+
+$string['aiken'] = 'Aiken format';
+$string['aiken_help'] = 'This is a simple format ...';
+$string['aiken_link'] = 'qformat/aiken';
+
+This needs to be changed to use the standard string name pluginname, as for
+other plugin types.
+
+$string['pluginname'] = 'Aiken format';
+$string['pluginname_help'] = 'This is a simple format ...';
+$string['pluginname_link'] = 'qformat/aiken';
$string['missingquestion'] = 'Missing question label after line {$a}';
$string['paragraphquestion'] = 'Paragraph question';
$string['pluginname'] = 'WebCT format';
+$string['pluginname_help'] = 'WebCT format enables multiple-choice and short answer questions saved in WebCT\'s text-based format to be imported.';
+$string['pluginname_link'] = 'qformat/webct';
$string['questionnametoolong'] = 'Question name too long at line {$a} (255 char. max). It has been truncated.';
$string['unknowntype'] = 'Unknown type';
$string['warningsdetected'] = '{$a} warning(s) detected';
-$string['webct'] = 'WebCT format';
-$string['webct_help'] = 'WebCT format enables multiple-choice and short answer questions saved in WebCT\'s text-based format to be imported.';
-$string['webct_link'] = 'qformat/webct';
$string['wronggrade'] = 'Wrong grade (after line {$a}) :';
--- /dev/null
+<?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/>.
+
+/**
+ * Version information for the calculated question type.
+ *
+ * @package qformat
+ * @subpackage webct
+ * @copyright 2011 The Open University
+ * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
+ */
+
+defined('MOODLE_INTERNAL') || die();
+
+$plugin->component = 'qformat_webct';
+$plugin->version = 2011102700;
+
+$plugin->requires = 2011102700;
+
+$plugin->maturity = MATURITY_STABLE;
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
-$string['xhtml'] = 'XHTML format';
-$string['xhtml_help'] = 'XHTML format enables all questions in the category to be exported to a single page of strict XHTML for possible use in another application.';
-$string['xhtml_link'] = 'qformat/xhtml';
+$string['pluginname'] = 'XHTML format';
+$string['pluginname_help'] = 'XHTML format enables all questions in the category to be exported to a single page of strict XHTML for possible use in another application.';
+$string['pluginname_link'] = 'qformat/xhtml';
--- /dev/null
+<?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/>.
+
+/**
+ * Version information for the calculated question type.
+ *
+ * @package qformat
+ * @subpackage xhtml
+ * @copyright 2011 The Open University
+ * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
+ */
+
+defined('MOODLE_INTERNAL') || die();
+
+$plugin->component = 'qformat_xhtml';
+$plugin->version = 2011102700;
+
+$plugin->requires = 2011102700;
+
+$plugin->maturity = MATURITY_STABLE;
$string['invalidxml'] = 'Invalid XML file - string expected (use CDATA?)';
$string['pluginname'] = 'Moodle XML format';
+$string['pluginname_help'] = 'This is a Moodle-specific format for importing and exporting questions.';
+$string['pluginname_link'] = 'qformat/xml';
$string['truefalseimporterror'] = '<b>Warning</b>: The true/false question \'{$a->questiontext}\' could not be imported properly. It was not clear whether the correct answer is true or false. The question has been imported assuming that the answer is \'{$a->answer}\'. If this is not correct, you will need to edit the question.';
$string['unsupportedexport'] = 'Question type {$a} is not supported by XML export';
-$string['xml'] = 'Moodle XML format';
-$string['xml_help'] = 'This is a Moodle-specific format for importing and exporting questions.';
-$string['xml_link'] = 'qformat/xml';
$string['xmlimportnoname'] = 'Missing question name in XML file';
$string['xmlimportnoquestion'] = 'Missing question text in XML file';
$string['xmltypeunsupported'] = 'Question type {$a} is not supported by XML import';
--- /dev/null
+<?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/>.
+
+/**
+ * Version information for the calculated question type.
+ *
+ * @package qformat
+ * @subpackage xml
+ * @copyright 2011 The Open University
+ * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
+ */
+
+defined('MOODLE_INTERNAL') || die();
+
+$plugin->component = 'qformat_xml';
+$plugin->version = 2011102700;
+
+$plugin->requires = 2011102700;
+
+$plugin->maturity = MATURITY_STABLE;
foreach ($fileformatnames as $shortname => $fileformatname) {
$currentgrp1 = array();
$currentgrp1[] = $mform->createElement('radio', 'format', '', $fileformatname, $shortname);
- $mform->addGroup($currentgrp1, "formathelp[$i]", '', array('<br />'), false);
- $mform->addHelpButton("formathelp[$i]", $shortname, 'qformat_' . $shortname);
+ $mform->addGroup($currentgrp1, "formathelp[$i]", ' ', array('<br />'), false);
+
+ if (get_string_manager()->string_exists('pluginname_help', 'qformat_' . $shortname)) {
+ $mform->addHelpButton("formathelp[$i]", 'pluginname', 'qformat_' . $shortname);
+ }
+
$i++ ;
}
$mform->addRule("formathelp[0]", null, 'required', null, 'client');