Skip to content

Commit

Permalink
MDL-29808 qformats: use standard pluginname string and add version.php
Browse files Browse the repository at this point in the history
AMOS BEGIN
 MOV [aiken,qformat_aiken],[pluginname,qformat_aiken]
 MOV [aiken_help,qformat_aiken],[pluginname_help,qformat_aiken]
 MOV [aiken_link,qformat_aiken],[pluginname_link,qformat_aiken]
 MOV [blackboard,qformat_blackboard],[pluginname,qformat_blackboard]
 MOV [blackboard_help,qformat_blackboard],[pluginname_help,qformat_blackboard]
 MOV [blackboard_six,qformat_blackboard_six],[pluginname,qformat_blackboard_six]
 MOV [blackboard_six_help,qformat_blackboard_six],[pluginname_help,qformat_blackboard_six]
 MOV [examview,qformat_examview],[pluginname,qformat_examview]
 MOV [examview_help,qformat_examview],[pluginname_help,qformat_examview]
 MOV [gift_help,qformat_gift],[pluginname_help,qformat_gift]
 MOV [gift_link,qformat_gift],[pluginname_link,qformat_gift]
 MOV [learnwise,qformat_learnwise],[pluginname,qformat_learnwise]
 MOV [learnwise_help,qformat_learnwise],[pluginname_help,qformat_learnwise]
 MOV [missingword,qformat_missingword],[pluginname,qformat_missingword]
 MOV [missingword_help,qformat_missingword],[pluginname_help,qformat_missingword]
 MOV [missingword_link,qformat_missingword],[pluginname_link,qformat_missingword]
 MOV [multianswer,qformat_multianswer],[pluginname,qformat_multianswer]
 MOV [multianswer_help,qformat_multianswer],[pluginname_help,qformat_multianswer]
 MOV [multianswer_link,qformat_multianswer],[pluginname_link,qformat_multianswer]
 MOV [webct_help,qformat_webct],[pluginname_help,qformat_webct]
 MOV [webct_link,qformat_webct],[pluginname_link,qformat_webct]
 MOV [xhtml,qformat_xhtml],[pluginname,qformat_xhtml]
 MOV [xhtml_help,qformat_xhtml],[pluginname_help,qformat_xhtml]
 MOV [xhtml_link,qformat_xhtml],[pluginname_link,qformat_xhtml]
 MOV [xml_help,qformat_xml],[pluginname_help,qformat_xml]
 MOV [xml_link,qformat_xml],[pluginname_link,qformat_xml]
AMOS END
  • Loading branch information
timhunt committed Nov 10, 2011
1 parent 75a31c9 commit 6467917
Show file tree
Hide file tree
Showing 28 changed files with 420 additions and 57 deletions.
16 changes: 0 additions & 16 deletions lib/pluginlib.php
Original file line number Diff line number Diff line change
Expand Up @@ -1432,22 +1432,6 @@ public function get_uninstall_url() {
}
}

/**
* 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
Expand Down
6 changes: 1 addition & 5 deletions lib/questionlib.php
Original file line number Diff line number Diff line change
Expand Up @@ -1207,11 +1207,7 @@ function get_import_export_formats($type) {

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);
}
}

Expand Down
3 changes: 1 addition & 2 deletions mod/lesson/lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -876,8 +876,7 @@ function lesson_get_import_export_formats($type) {
$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);
Expand Down
8 changes: 6 additions & 2 deletions question/export_form.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,12 @@ protected function definition() {
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]", '&#160;', 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');
Expand Down
6 changes: 3 additions & 3 deletions question/format/aiken/lang/en/qformat_aiken.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,6 @@
* @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';
33 changes: 33 additions & 0 deletions question/format/aiken/version.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<?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;
4 changes: 2 additions & 2 deletions question/format/blackboard/lang/en/qformat_blackboard.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,5 @@
* @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.';
33 changes: 33 additions & 0 deletions question/format/blackboard/version.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<?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;
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,5 @@
* @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.';
33 changes: 33 additions & 0 deletions question/format/blackboard_six/version.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<?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;
4 changes: 2 additions & 2 deletions question/format/examview/lang/en/qformat_examview.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,5 @@
* @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.';
33 changes: 33 additions & 0 deletions question/format/examview/version.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<?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;
6 changes: 2 additions & 4 deletions question/format/gift/lang/en/qformat_gift.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,6 @@
*/

$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';
Expand All @@ -37,3 +33,5 @@
$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';
33 changes: 33 additions & 0 deletions question/format/gift/version.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<?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;
4 changes: 2 additions & 2 deletions question/format/learnwise/lang/en/qformat_learnwise.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,5 @@
* @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.';
33 changes: 33 additions & 0 deletions question/format/learnwise/version.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<?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;
6 changes: 3 additions & 3 deletions question/format/missingword/lang/en/qformat_missingword.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,6 @@
* @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';
33 changes: 33 additions & 0 deletions question/format/missingword/version.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<?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;
6 changes: 3 additions & 3 deletions question/format/multianswer/lang/en/qformat_multianswer.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,6 @@
* @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';
Loading

0 comments on commit 6467917

Please sign in to comment.