From 226b312472b4b092a3bbacbff94254717ff84d3f Mon Sep 17 00:00:00 2001 From: Tim Hunt Date: Thu, 3 Nov 2011 16:44:26 +0000 Subject: [PATCH] MDL-29808 qtypes: use standard pluginname strings and update version.php AMOS BEGIN MOV [calculated,qtype_calculated],[pluginname,qtype_calculated] MOV [calculated_help,qtype_calculated],[pluginname_help,qtype_calculated] MOV [calculated_link,qtype_calculated],[pluginname_link,qtype_calculated] MOV [addingcalculated,qtype_calculated],[pluginnameadding,qtype_calculated] MOV [editingcalculated,qtype_calculated],[pluginnameediting,qtype_calculated] MOV [calculatedsummary,qtype_calculated],[pluginnamesummary,qtype_calculated] MOV [calculatedmulti,qtype_calculatedmulti],[pluginname,qtype_calculatedmulti] MOV [calculatedmulti_help,qtype_calculatedmulti],[pluginname_help,qtype_calculatedmulti] MOV [calculatedmulti_link,qtype_calculatedmulti],[pluginname_link,qtype_calculatedmulti] MOV [addingcalculatedmulti,qtype_calculatedmulti],[pluginnameadding,qtype_calculatedmulti] MOV [editingcalculatedmulti,qtype_calculatedmulti],[pluginnameediting,qtype_calculatedmulti] MOV [calculatedmultisummary,qtype_calculatedmulti],[pluginnamesummary,qtype_calculatedmulti] MOV [calculatedsimple,qtype_calculatedsimple],[pluginname,qtype_calculatedsimple] MOV [calculatedsimple_help,qtype_calculatedsimple],[pluginname_help,qtype_calculatedsimple] MOV [calculatedsimple_link,qtype_calculatedsimple],[pluginname_link,qtype_calculatedsimple] MOV [addingcalculatedsimple,qtype_calculatedsimple],[pluginnameadding,qtype_calculatedsimple] MOV [editingcalculatedsimple,qtype_calculatedsimple],[pluginnameediting,qtype_calculatedsimple] MOV [calculatedsimplesummary,qtype_calculatedsimple],[pluginnamesummary,qtype_calculatedsimple] MOV [description,qtype_description],[pluginname,qtype_description] MOV [description_help,qtype_description],[pluginname_help,qtype_description] MOV [addingdescription,qtype_description],[pluginnameadding,qtype_description] MOV [editingdescription,qtype_description],[pluginnameediting,qtype_description] MOV [descriptionsummary,qtype_description],[pluginnamesummary,qtype_description] MOV [essay,qtype_essay],[pluginname,qtype_essay] MOV [essay_help,qtype_essay],[pluginname_help,qtype_essay] MOV [essay_link,qtype_essay],[pluginname_link,qtype_essay] MOV [addingessay,qtype_essay],[pluginnameadding,qtype_essay] MOV [editingessay,qtype_essay],[pluginnameediting,qtype_essay] MOV [essaysummary,qtype_essay],[pluginnamesummary,qtype_essay] MOV [match,qtype_match],[pluginname,qtype_match] MOV [match_help,qtype_match],[pluginname_help,qtype_match] MOV [match_link,qtype_match],[pluginname_link,qtype_match] MOV [addingmatch,qtype_match],[pluginnameadding,qtype_match] MOV [editingmatch,qtype_match],[pluginnameediting,qtype_match] MOV [matchsummary,qtype_match],[pluginnamesummary,qtype_match] MOV [missingtype,qtype_missingtype],[pluginname,qtype_missingtype] MOV [addingmissingtype,qtype_missingtype],[pluginnameadding,qtype_missingtype] MOV [editingmissingtype,qtype_missingtype],[pluginnameediting,qtype_missingtype] MOV [multianswer,qtype_multianswer],[pluginname,qtype_multianswer] MOV [multianswer_help,qtype_multianswer],[pluginname_help,qtype_multianswer] MOV [multianswer_link,qtype_multianswer],[pluginname_link,qtype_multianswer] MOV [addingmultianswer,qtype_multianswer],[pluginnameadding,qtype_multianswer] MOV [editingmultianswer,qtype_multianswer],[pluginnameediting,qtype_multianswer] MOV [multianswersummary,qtype_multianswer],[pluginnamesummary,qtype_multianswer] MOV [multichoice,qtype_multichoice],[pluginname,qtype_multichoice] MOV [multichoice_help,qtype_multichoice],[pluginname_help,qtype_multichoice] MOV [multichoice_link,qtype_multichoice],[pluginname_link,qtype_multichoice] MOV [addingmultichoice,qtype_multichoice],[pluginnameadding,qtype_multichoice] MOV [editingmultichoice,qtype_multichoice],[pluginnameediting,qtype_multichoice] MOV [multichoicesummary,qtype_multichoice],[pluginnamesummary,qtype_multichoice] MOV [numerical,qtype_numerical],[pluginname,qtype_numerical] MOV [numerical_help,qtype_numerical],[pluginname_help,qtype_numerical] MOV [numerical_link,qtype_numerical],[pluginname_link,qtype_numerical] MOV [addingnumerical,qtype_numerical],[pluginnameadding,qtype_numerical] MOV [editingnumerical,qtype_numerical],[pluginnameediting,qtype_numerical] MOV [numericalsummary,qtype_numerical],[pluginnamesummary,qtype_numerical] MOV [random,qtype_random],[pluginname,qtype_random] MOV [random_help,qtype_random],[pluginname_help,qtype_random] MOV [editingrandom,qtype_random],[pluginnameediting,qtype_random] MOV [shortanswer,qtype_shortanswer],[pluginname,qtype_shortanswer] MOV [shortanswer_help,qtype_shortanswer],[pluginname_help,qtype_shortanswer] MOV [shortanswer_link,qtype_shortanswer],[pluginname_link,qtype_shortanswer] MOV [addingshortanswer,qtype_shortanswer],[pluginnameadding,qtype_shortanswer] MOV [editingshortanswer,qtype_shortanswer],[pluginnameediting,qtype_shortanswer] MOV [shortanswersummary,qtype_shortanswer],[pluginnamesummary,qtype_shortanswer] MOV [truefalse,qtype_truefalse],[pluginname,qtype_truefalse] MOV [truefalse_help,qtype_truefalse],[pluginname_help,qtype_truefalse] MOV [truefalse_link,qtype_truefalse],[pluginname_link,qtype_truefalse] MOV [addingtruefalse,qtype_truefalse],[pluginnameadding,qtype_truefalse] MOV [editingtruefalse,qtype_truefalse],[pluginnameediting,qtype_truefalse] MOV [truefalsesummary,qtype_truefalse],[pluginnamesummary,qtype_truefalse] AMOS END --- admin/qtypes.php | 17 +++++----- lib/pluginlib.php | 31 ++---------------- question/editlib.php | 9 ++++-- .../calculated/lang/en/qtype_calculated.php | 12 +++---- question/type/calculated/questiontype.php | 4 --- question/type/calculated/version.php | 11 +++++-- .../lang/en/qtype_calculatedmulti.php | 12 +++---- .../type/calculatedmulti/questiontype.php | 4 --- question/type/calculatedmulti/version.php | 13 ++++++-- .../lang/en/qtype_calculatedsimple.php | 12 +++---- question/type/calculatedsimple/version.php | 12 +++++-- .../description/lang/en/qtype_description.php | 12 +++---- question/type/description/version.php | 8 +++-- question/type/essay/lang/en/qtype_essay.php | 12 +++---- question/type/essay/version.php | 8 +++-- question/type/match/lang/en/qtype_match.php | 12 +++---- question/type/match/version.php | 8 +++-- .../missingtype/lang/en/qtype_missingtype.php | 8 ++--- question/type/missingtype/version.php | 8 +++-- .../multianswer/lang/en/qtype_multianswer.php | 12 +++---- question/type/multianswer/questiontype.php | 3 -- question/type/multianswer/version.php | 13 ++++++-- .../multichoice/lang/en/qtype_multichoice.php | 12 +++---- question/type/multichoice/version.php | 8 +++-- .../numerical/lang/en/qtype_numerical.php | 12 +++---- question/type/numerical/version.php | 8 +++-- question/type/questiontypebase.php | 32 ++++++++----------- question/type/random/lang/en/qtype_random.php | 6 ++-- question/type/random/version.php | 8 +++-- .../shortanswer/lang/en/qtype_shortanswer.php | 12 +++---- question/type/shortanswer/version.php | 8 +++-- .../truefalse/lang/en/qtype_truefalse.php | 12 +++---- question/type/truefalse/version.php | 8 +++-- question/type/upgrade.txt | 32 +++++++++++++++++++ 34 files changed, 231 insertions(+), 168 deletions(-) create mode 100644 question/type/upgrade.txt diff --git a/admin/qtypes.php b/admin/qtypes.php index 05e7c754a9c..88c84ed80b0 100644 --- a/admin/qtypes.php +++ b/admin/qtypes.php @@ -28,6 +28,7 @@ require_once(dirname(__FILE__) . '/../config.php'); require_once($CFG->libdir . '/questionlib.php'); require_once($CFG->libdir . '/adminlib.php'); +require_once($CFG->libdir . '/pluginlib.php'); require_once($CFG->libdir . '/tablelib.php'); // Check permissions. @@ -40,6 +41,7 @@ admin_externalpage_setup('manageqtypes'); $thispageurl = new moodle_url('/admin/qtypes.php'); $qtypes = question_bank::get_all_qtypes(); +$pluginmanager = plugin_manager::instance(); // Get some data we will need - question counts and which types are needed. $counts = $DB->get_records_sql(" @@ -52,15 +54,11 @@ foreach ($qtypes as $qtypename => $qtype) { $counts[$qtypename]->numquestions = 0; $counts[$qtypename]->numhidden = 0; } - $needed[$qtypename] = $counts[$qtypename]->numquestions > 0; + $needed[$qtypename] = $counts[$qtypename]->numquestions > 0 && + $pluginmanager->other_plugins_that_require($qtype->plugin_name()); $counts[$qtypename]->numquestions -= $counts[$qtypename]->numhidden; } $needed['missingtype'] = true; // The system needs the missing question type. -foreach ($qtypes as $qtypename => $qtype) { - foreach ($qtype->requires_qtypes() as $reqtype) { - $needed[$reqtype] = true; - } -} foreach ($counts as $qtypename => $count) { if (!isset($qtypes[$qtypename])) { $counts['missingtype']->numquestions += $count->numquestions - $count->numhidden; @@ -237,11 +235,12 @@ foreach ($sortedqtypes as $qtypename => $localname) { } // Other question types required by this one. - $requiredtypes = $qtype->requires_qtypes(); + $plugin = $pluginmanager->get_plugin_info($qtype->plugin_name()); + $requiredtypes = $plugin->get_other_required_plugins(); $strtypes = array(); if (!empty($requiredtypes)) { - foreach ($requiredtypes as $required) { - $strtypes[] = $qtypes[$required]->local_name(); + foreach ($requiredtypes as $required => $notused) { + $strtypes[] = $pluginmanager->plugin_name($required); } $row[] = implode(', ', $strtypes); } else { diff --git a/lib/pluginlib.php b/lib/pluginlib.php index d79ba180398..3c62abe897e 100644 --- a/lib/pluginlib.php +++ b/lib/pluginlib.php @@ -1396,36 +1396,9 @@ class plugintype_qbehaviour extends plugintype_base implements plugin_informatio * Class for question types */ class plugintype_qtype 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); - } - } - - /** - * @see plugintype_base::load_other_required_plugins(). - */ - protected function load_other_required_plugins() { - parent::load_other_required_plugins(); - if (!empty($this->dependencies)) { - return; - } - - // Standard mechanism did not find anything, so try the legacy way. - global $CFG; - require_once($CFG->libdir . '/questionlib.php'); - $required = question_bank::get_qtype($this->name)->requires_qtypes(); - foreach ($required as $other) { - $this->dependencies['qtype_' . $other] = ANY_VERSION; - } - } - + * @see plugin_information::get_uninstall_url() + */ public function get_uninstall_url() { return new moodle_url('/admin/qtypes.php', array('delete' => $this->name, 'sesskey' => sesskey())); diff --git a/question/editlib.php b/question/editlib.php index 7b3722f9db3..8bc1c2c80c1 100644 --- a/question/editlib.php +++ b/question/editlib.php @@ -1781,6 +1781,12 @@ function print_choose_qtype_to_add_form($hiddenparams) { * @param $qtype the question type. */ function print_qtype_to_add_option($qtype) { + if (get_string_manager()->string_exists('pluginnamesummary', $qtype->plugin_name())) { + $summary = get_string('pluginnamesummary', $qtype->plugin_name()); + } else { + $summary = get_string($qtype->name() . 'summary', $qtype->plugin_name()); + } + echo '
' . "\n"; echo '\n"; echo "
\n"; } diff --git a/question/type/calculated/lang/en/qtype_calculated.php b/question/type/calculated/lang/en/qtype_calculated.php index 8ba55b304c9..dd168796c6f 100644 --- a/question/type/calculated/lang/en/qtype_calculated.php +++ b/question/type/calculated/lang/en/qtype_calculated.php @@ -23,7 +23,6 @@ * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ -$string['addingcalculated'] = 'Adding a calculated question'; $string['additem'] = 'Add item'; $string['addmoreanswerblanks'] = 'Add another answer blank.'; $string['addmoreunitblanks'] = 'Blanks for {$a} more units'; @@ -38,10 +37,6 @@ $string['calcdistribution'] = 'Distribution'; $string['calclength'] = 'Decimal places'; $string['calcmax'] = 'Maximum'; $string['calcmin'] = 'Minimum'; -$string['calculated'] = 'Calculated'; -$string['calculated_help'] = 'Calculated questions enable individual numerical questions to be created using wildcards in curly brackets that are substituted with individual values when the quiz is taken. For example, the question "What is the area of a rectangle of length {l} and width {w}?" would have correct answer formula "{l}*{w}" (where * denotes multiplication).'; -$string['calculated_link'] = 'question/type/calculated'; -$string['calculatedsummary'] = 'Calculated questions are like numerical questions but with the numbers used selected randomly from a set when the quiz is taken.'; $string['choosedatasetproperties'] = 'Choose wildcards dataset properties'; $string['choosedatasetproperties_help'] = 'A dataset is a set of values inserted in place of a wildcard. You can create a private dataset for a specific question, or a shared dataset that can be used for other calculated questions within the category.'; $string['correctanswerformula'] = 'Correct answer formula'; @@ -53,7 +48,6 @@ $string['datasetrole']= ' The wild cards {x..} will be substitu $string['decimals'] = 'with {$a}'; $string['deleteitem'] = 'Delete item'; $string['deletelastitem'] = 'Delete last item'; -$string['editingcalculated'] = 'Editing a Calculated question'; $string['editdatasets'] = 'Edit the wildcards datasets'; $string['editdatasets_help'] = 'Wildcard values may be created by entering a number in each wild card field then clicking the add button. To automatically generate 10 or more values, select the number of values required before clicking the add button. A uniform distribution means any value between the limits is equally likely to be generated; a loguniform distribution means that values towards the lower limit are more likely.'; $string['editdatasets_link'] = 'question/type/calculated'; @@ -113,6 +107,12 @@ $string['notvalidnumber'] = 'Wild card value is not a valid number '; $string['oneanswertrueansweroutsidelimits'] = 'At least one correct answer outside the true value limits.
Modify the answers tolerance settings available as Advanced parameters'; $string['param'] = 'Param {{$a}}'; $string['partiallycorrectfeedback'] = 'For any partially correct response'; +$string['pluginname'] = 'Calculated'; +$string['pluginname_help'] = 'Calculated questions enable individual numerical questions to be created using wildcards in curly brackets that are substituted with individual values when the quiz is taken. For example, the question "What is the area of a rectangle of length {l} and width {w}?" would have correct answer formula "{l}*{w}" (where * denotes multiplication).'; +$string['pluginname_link'] = 'question/type/calculated'; +$string['pluginnameadding'] = 'Adding a Calculated question'; +$string['pluginnameediting'] = 'Editing a Calculated question'; +$string['pluginnamesummary'] = 'Calculated questions are like numerical questions but with the numbers used selected randomly from a set when the quiz is taken.'; $string['possiblehdr'] = 'Possible wild cards present only in the question text'; $string['questiondatasets'] = 'Question datasets'; $string['questiondatasets_help'] = 'Question datasets of wild cards that will be used in each individual question'; diff --git a/question/type/calculated/questiontype.php b/question/type/calculated/questiontype.php index 4c450d4b24b..4b6a132e68a 100644 --- a/question/type/calculated/questiontype.php +++ b/question/type/calculated/questiontype.php @@ -40,10 +40,6 @@ class qtype_calculated extends question_type { public $wizardpagesnumber = 3; - public function requires_qtypes() { - return array('numerical'); - } - public function get_question_options($question) { // First get the datasets and default options // the code is used for calculated, calculatedsimple and calculatedmulti qtypes diff --git a/question/type/calculated/version.php b/question/type/calculated/version.php index f9ce35c89bd..724d02254a3 100644 --- a/question/type/calculated/version.php +++ b/question/type/calculated/version.php @@ -25,5 +25,12 @@ defined('MOODLE_INTERNAL') || die(); -$plugin->version = 2011051900; -$plugin->requires = 2011060313; +$plugin->component = 'qtype_calculated'; +$plugin->version = 2011102700; + +$plugin->requires = 2011102700; +$plugin->dependencies = array( + 'qtype_numerical' => 2011102700, +); + +$plugin->maturity = MATURITY_STABLE; diff --git a/question/type/calculatedmulti/lang/en/qtype_calculatedmulti.php b/question/type/calculatedmulti/lang/en/qtype_calculatedmulti.php index d6bbdab8850..e70aa088337 100644 --- a/question/type/calculatedmulti/lang/en/qtype_calculatedmulti.php +++ b/question/type/calculatedmulti/lang/en/qtype_calculatedmulti.php @@ -23,9 +23,9 @@ * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ -$string['addingcalculatedmulti'] = 'Adding a Calculated multichoice question'; -$string['calculatedmulti'] = 'Calculated multichoice'; -$string['calculatedmultisummary'] = 'Calculated multichoice questions are like multichoice questions which choice elements can include formula results from numeric values that are selected randomly from a set when the quiz is taken.'; -$string['calculatedmulti_help'] = 'Calculated multichoice questions are like multichoice questions which in their choice elements can be included numerical formula results using wildcards in curly brackets that are substituted with individual values when the quiz is taken. For example, if the question "What is the area of a rectangle of length {l} and width {w}?" one of the choice is {={l}*{w}} (where * denotes multiplication). '; -$string['calculatedmulti_link'] = 'question/type/calculatedmulti'; -$string['editingcalculatedmulti'] = 'Editing a Calculated multichoice question'; +$string['pluginname'] = 'Calculated multichoice'; +$string['pluginname_help'] = 'Calculated multichoice questions are like multichoice questions which in their choice elements can be included numerical formula results using wildcards in curly brackets that are substituted with individual values when the quiz is taken. For example, if the question "What is the area of a rectangle of length {l} and width {w}?" one of the choice is {={l}*{w}} (where * denotes multiplication). '; +$string['pluginname_link'] = 'question/type/calculatedmulti'; +$string['pluginnameadding'] = 'Adding a Calculated multichoice question'; +$string['pluginnameediting'] = 'Editing a Calculated multichoice question'; +$string['pluginnamesummary'] = 'Calculated multichoice questions are like multichoice questions which choice elements can include formula results from numeric values that are selected randomly from a set when the quiz is taken.'; diff --git a/question/type/calculatedmulti/questiontype.php b/question/type/calculatedmulti/questiontype.php index 63914d0f446..963a95e6cba 100644 --- a/question/type/calculatedmulti/questiontype.php +++ b/question/type/calculatedmulti/questiontype.php @@ -38,10 +38,6 @@ require_once($CFG->dirroot . '/question/type/calculated/questiontype.php'); */ class qtype_calculatedmulti extends qtype_calculated { - public function requires_qtypes() { - return array('calculated', 'multichoice'); - } - public function save_question_options($question) { global $CFG, $DB; $context = $question->context; diff --git a/question/type/calculatedmulti/version.php b/question/type/calculatedmulti/version.php index 678837ca0a6..929ecc537a7 100644 --- a/question/type/calculatedmulti/version.php +++ b/question/type/calculatedmulti/version.php @@ -25,5 +25,14 @@ defined('MOODLE_INTERNAL') || die(); -$plugin->version = 2011051900; -$plugin->requires = 2011060313; +$plugin->component = 'qtype_calculatedmulti'; +$plugin->version = 2011102700; + +$plugin->requires = 2011102700; +$plugin->dependencies = array( + 'qtype_numerical' => 2011102700, + 'qtype_calculated' => 2011102700, + 'qtype_multichoice' => 2011102700, +); + +$plugin->maturity = MATURITY_STABLE; diff --git a/question/type/calculatedsimple/lang/en/qtype_calculatedsimple.php b/question/type/calculatedsimple/lang/en/qtype_calculatedsimple.php index af84a8d445e..ec1e8666327 100644 --- a/question/type/calculatedsimple/lang/en/qtype_calculatedsimple.php +++ b/question/type/calculatedsimple/lang/en/qtype_calculatedsimple.php @@ -23,19 +23,19 @@ * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ -$string['addingcalculatedsimple'] = 'Adding a Simple calculated question'; $string['atleastonewildcard'] = 'There must be at least one wild card {x..} present in the correct answer formulas'; -$string['calculatedsimple'] = 'Calculated simple'; -$string['calculatedsimple_help'] = 'Simple calculated questions enable individual numerical questions to be created using wildcards that are substituted with individual values when the quiz is taken. Simple calculated questions offer the most used features of the calculated question with a simpler creation interface.'; -$string['calculatedsimple_link'] = 'question/type/calculatedsimple'; -$string['calculatedsimplesummary'] = 'A simpler version of calculated questions which are like numerical questions but with the numbers used selected randomly from a set when the quiz is taken.'; $string['converttocalculated'] = 'Save as a new regular calculated question'; -$string['editingcalculatedsimple'] = 'Editing a Simple calculated question'; $string['findwildcards'] = 'Find the wild cards {x..} present in the correct answer formulas'; $string['generatenewitemsset'] = 'Generate'; $string['mustbenumeric'] = 'You must enter a number here.'; $string['mustnotbenumeric'] = 'This can\'t be a number.'; $string['newsetwildcardvalues'] = 'new set(s) of wild card(s) values'; +$string['pluginname'] = 'Calculated simple'; +$string['pluginname_help'] = 'Simple calculated questions enable individual numerical questions to be created using wildcards that are substituted with individual values when the quiz is taken. Simple calculated questions offer the most used features of the calculated question with a simpler creation interface.'; +$string['pluginname_link'] = 'question/type/calculatedsimple'; +$string['pluginnameadding'] = 'Adding a Simple calculated question'; +$string['pluginnameediting'] = 'Editing a Simple calculated question'; +$string['pluginnamesummary'] = 'A simpler version of calculated questions which are like numerical questions but with the numbers used selected randomly from a set when the quiz is taken.'; $string['setno'] = 'Set {$a}'; $string['setwildcardvalues'] = 'set(s) of wild card(s) values'; $string['showitems'] = 'Display'; diff --git a/question/type/calculatedsimple/version.php b/question/type/calculatedsimple/version.php index 03e45df451a..5dcb02e4c88 100644 --- a/question/type/calculatedsimple/version.php +++ b/question/type/calculatedsimple/version.php @@ -25,5 +25,13 @@ defined('MOODLE_INTERNAL') || die(); -$plugin->version = 2011051900; -$plugin->requires = 2011060313; +$plugin->component = 'qtype_calculatedsimple'; +$plugin->version = 2011102700; + +$plugin->requires = 2011102700; +$plugin->dependencies = array( + 'qtype_numerical' => 2011102700, + 'qtype_calculated' => 2011102700, +); + +$plugin->maturity = MATURITY_STABLE; diff --git a/question/type/description/lang/en/qtype_description.php b/question/type/description/lang/en/qtype_description.php index b06b700bdc7..cf917834508 100644 --- a/question/type/description/lang/en/qtype_description.php +++ b/question/type/description/lang/en/qtype_description.php @@ -23,11 +23,11 @@ * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ -$string['addingdescription'] = 'Adding a description'; -$string['description'] = 'Description'; -$string['description_help'] = 'A description is not really a question type. It simply enables text to be displayed without requiring any answers, similar to a label on the course page. +$string['informationtext'] = 'Information text'; +$string['pluginname'] = 'Description'; +$string['pluginname_help'] = 'A description is not really a question type. It simply enables text to be displayed without requiring any answers, similar to a label on the course page. The question text is displayed both during the attempt and on the review page. Any general feedback is displayed on the review page only.'; -$string['descriptionsummary'] = 'This is not actually a question. Instead it is a way to add some instructions, rubric or other content to the activity. This is similar to the way that labels can be used to add content to the course page.'; -$string['editingdescription'] = 'Editing a Description'; -$string['informationtext'] = 'Information text'; +$string['pluginnameadding'] = 'Adding a description'; +$string['pluginnameediting'] = 'Editing a Description'; +$string['pluginnamesummary'] = 'This is not actually a question. Instead it is a way to add some instructions, rubric or other content to the activity. This is similar to the way that labels can be used to add content to the course page.'; diff --git a/question/type/description/version.php b/question/type/description/version.php index 4d38784512c..68bdfaea0b6 100644 --- a/question/type/description/version.php +++ b/question/type/description/version.php @@ -25,5 +25,9 @@ defined('MOODLE_INTERNAL') || die(); -$plugin->version = 2011051200; -$plugin->requires = 2011060313; +$plugin->component = 'qtype_description'; +$plugin->version = 2011102700; + +$plugin->requires = 2011102700; + +$plugin->maturity = MATURITY_STABLE; diff --git a/question/type/essay/lang/en/qtype_essay.php b/question/type/essay/lang/en/qtype_essay.php index 7d8c4746878..2e8d524ca45 100644 --- a/question/type/essay/lang/en/qtype_essay.php +++ b/question/type/essay/lang/en/qtype_essay.php @@ -23,18 +23,18 @@ * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ -$string['addingessay'] = 'Adding an Essay question'; -$string['addingessay_link'] = 'question/type/essay'; $string['allowattachments'] = 'Allow attachments'; -$string['editingessay'] = 'Editing an Essay question'; -$string['essay'] = 'Essay'; -$string['essay_help'] = 'In response to a question (that may include an image) the respondent writes an answer of a paragraph or two. The essay question will not be assigned a grade until it has been reviewed by a teacher and manually graded.'; -$string['essaysummary'] = 'Allows a response of a few sentences or paragraphs. This must then be graded manually.'; $string['formateditor'] = 'HTML editor'; $string['formateditorfilepicker'] = 'HTML editor with file picker'; $string['formatmonospaced'] = 'Plain text, monospaced font'; $string['formatplain'] = 'Plain text'; $string['graderinfo'] = 'Information for graders'; $string['nlines'] = '{$a} lines'; +$string['pluginname'] = 'Essay'; +$string['pluginname_help'] = 'In response to a question (that may include an image) the respondent writes an answer of a paragraph or two. The essay question will not be assigned a grade until it has been reviewed by a teacher and manually graded.'; +$string['pluginname_link'] = 'question/type/essay'; +$string['pluginnameadding'] = 'Adding an Essay question'; +$string['pluginnameediting'] = 'Editing an Essay question'; +$string['pluginnamesummary'] = 'Allows a response of a few sentences or paragraphs. This must then be graded manually.'; $string['responsefieldlines'] = 'Input box size'; $string['responseformat'] = 'Response format'; diff --git a/question/type/essay/version.php b/question/type/essay/version.php index cf4457b2a36..fec288963ce 100644 --- a/question/type/essay/version.php +++ b/question/type/essay/version.php @@ -25,5 +25,9 @@ defined('MOODLE_INTERNAL') || die(); -$plugin->version = 2011060300; -$plugin->requires = 2011060313; +$plugin->component = 'qtype_essay'; +$plugin->version = 2011102700; + +$plugin->requires = 2011102700; + +$plugin->maturity = MATURITY_STABLE; diff --git a/question/type/match/lang/en/qtype_match.php b/question/type/match/lang/en/qtype_match.php index 5f601792d12..f9f1f02829b 100644 --- a/question/type/match/lang/en/qtype_match.php +++ b/question/type/match/lang/en/qtype_match.php @@ -23,16 +23,10 @@ * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ -$string['addingmatch'] = 'Adding a Matching question'; $string['addmoreqblanks'] = '{no} More Sets of Blanks'; $string['availablechoices'] = 'Available choices'; $string['correctansweris'] = 'The correct answer is: {$a}.'; -$string['editingmatch'] = 'Editing a Matching question'; $string['filloutthreeqsandtwoas'] = 'You must provide at least two questions and three answers. You can provide extra wrong answers by giving an answer with a blank question. Entries where both the question and the answer are blank will be ignored.'; -$string['match'] = 'Matching'; -$string['match_help'] = 'Matching questions require the respondent to correctly match a list of names or statements (questions) to another list of names or statements (answers).'; -$string['match_link'] = 'question/type/match'; -$string['matchsummary'] = 'The answer to each of a number of sub-question must be selected from a list of possibilities.'; $string['nomatchinganswer'] = 'You must specify an answer matching the question \'{$a}\'.'; $string['nomatchinganswerforq'] = 'You must specify an answer for this question.'; $string['notenoughqsandas'] = 'You must supply at least {$a->q} questions and {$a->a} answers.'; @@ -40,3 +34,9 @@ $string['notenoughquestions'] = 'You must supply at least {$a} question and answ $string['shuffle'] = 'Shuffle'; $string['shuffle_help'] = 'If enabled, the order of the statements (answers) is randomly shuffled for each attempt, provided that "Shuffle within questions" in the activity settings is also enabled.'; $string['pleaseananswerallparts'] = 'Please answer all parts of the question.'; +$string['pluginname'] = 'Matching'; +$string['pluginname_help'] = 'Matching questions require the respondent to correctly match a list of names or statements (questions) to another list of names or statements (answers).'; +$string['pluginname_link'] = 'question/type/match'; +$string['pluginnameadding'] = 'Adding a Matching question'; +$string['pluginnameediting'] = 'Editing a Matching question'; +$string['pluginnamesummary'] = 'The answer to each of a number of sub-question must be selected from a list of possibilities.'; diff --git a/question/type/match/version.php b/question/type/match/version.php index 4c7d1c1853f..688b4d0dea4 100644 --- a/question/type/match/version.php +++ b/question/type/match/version.php @@ -25,5 +25,9 @@ defined('MOODLE_INTERNAL') || die(); -$plugin->version = 2011051200; -$plugin->requires = 2011060313; +$plugin->component = 'qtype_match'; +$plugin->version = 2011102700; + +$plugin->requires = 2011102700; + +$plugin->maturity = MATURITY_STABLE; diff --git a/question/type/missingtype/lang/en/qtype_missingtype.php b/question/type/missingtype/lang/en/qtype_missingtype.php index baec156cb8b..5aa684472dd 100644 --- a/question/type/missingtype/lang/en/qtype_missingtype.php +++ b/question/type/missingtype/lang/en/qtype_missingtype.php @@ -23,13 +23,13 @@ * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ -$string['addingmissingtype'] = 'Adding a question of a type that is not installed on this system'; $string['answerno'] = 'Answer {$a}'; $string['cannotchangeamissingqtype'] = 'You cannot make any changes to a question of a missing type.'; $string['deletedquestion'] = 'Missing question'; $string['deletedquestiontext'] = 'This question is missing. Unable to display anything.'; -$string['editingmissingtype'] = 'Editing a question of a type that is not installed on this system'; -$string['missing'] = 'Question of a type that is not installed on this system'; -$string['missingtype'] = 'Missing type'; $string['missingqtypewarning'] = 'This question is of a type that is not currently installed on this system. You will not be able to do anything with this question.'; +$string['missing'] = 'Question of a type that is not installed on this system'; +$string['pluginname'] = 'Missing type'; +$string['pluginnameadding'] = 'Adding a question of a type that is not installed on this system'; +$string['pluginnameediting'] = 'Editing a question of a type that is not installed on this system'; $string['warningmissingtype'] = 'This question is of a type that has not been installed on your Moodle yet.
Please alert your Moodle administrator.
'; diff --git a/question/type/missingtype/version.php b/question/type/missingtype/version.php index 13119395b33..7a7aa22183e 100644 --- a/question/type/missingtype/version.php +++ b/question/type/missingtype/version.php @@ -25,5 +25,9 @@ defined('MOODLE_INTERNAL') || die(); -$plugin->version = 2011051200; -$plugin->requires = 2011060313; +$plugin->component = 'qtype_missingtype'; +$plugin->version = 2011102700; + +$plugin->requires = 2011102700; + +$plugin->maturity = MATURITY_STABLE; diff --git a/question/type/multianswer/lang/en/qtype_multianswer.php b/question/type/multianswer/lang/en/qtype_multianswer.php index 4f84fe8997f..192bb770604 100644 --- a/question/type/multianswer/lang/en/qtype_multianswer.php +++ b/question/type/multianswer/lang/en/qtype_multianswer.php @@ -23,24 +23,24 @@ * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ -$string['addingmultianswer'] = 'Adding an Embedded answers (Cloze) question'; $string['confirmquestionsaveasedited'] = 'I confirm that I want the question to be saved as edited'; $string['confirmsave'] = 'Confirm then save {$a}'; $string['correctanswer'] = 'Correct answer'; $string['correctanswerandfeedback'] = 'Correct answer and feedback'; $string['decodeverifyquestiontext'] = 'Decode and verify the question text'; -$string['editingmultianswer'] = 'Editing an Embedded answers (Cloze) question'; $string['layout'] = 'Layout'; $string['layouthorizontal'] = 'Horizontal row of radio-buttons'; $string['layoutselectinline'] = 'Dropdown menu in-line in the text'; $string['layoutundefined'] = 'Undefined layout'; $string['layoutvertical'] = 'Vertical column of radio buttons'; -$string['multianswer'] = 'Embedded answers (Cloze)'; -$string['multianswersummary'] = 'Questions of this type are very flexible, but can only be created by entering text containing special codes that create embedded multiple-choice, short answers and numerical questions.'; -$string['multianswer_help'] = 'Embedded answers (Cloze) questions consist of a passage of text with questions such as multiple-choice and short answer embedded within it.'; -$string['multianswer_link'] = 'question/type/multianswer'; $string['nooptionsforsubquestion'] = 'Unable to get options for question part # {$a->sub} (question->id={$a->id})'; $string['noquestions'] = 'The Cloze(multianswer) question "{$a}" does not contain any question'; +$string['pluginname'] = 'Embedded answers (Cloze)'; +$string['pluginname_help'] = 'Embedded answers (Cloze) questions consist of a passage of text with questions such as multiple-choice and short answer embedded within it.'; +$string['pluginname_link'] = 'question/type/multianswer'; +$string['pluginnameadding'] = 'Adding an Embedded answers (Cloze) question'; +$string['pluginnameediting'] = 'Editing an Embedded answers (Cloze) question'; +$string['pluginnamesummary'] = 'Questions of this type are very flexible, but can only be created by entering text containing special codes that create embedded multiple-choice, short answers and numerical questions.'; $string['qtypenotrecognized'] = 'questiontype {$a} not recognized'; $string['questionnadded'] = 'Question added'; $string['questiondefinition'] = 'Question definition'; diff --git a/question/type/multianswer/questiontype.php b/question/type/multianswer/questiontype.php index e1748b439fc..32f36c1ee77 100644 --- a/question/type/multianswer/questiontype.php +++ b/question/type/multianswer/questiontype.php @@ -36,9 +36,6 @@ require_once($CFG->dirroot . '/question/type/multichoice/question.php'); * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ class qtype_multianswer extends question_type { - public function requires_qtypes() { - return array('shortanswer', 'numerical', 'multichoice'); - } public function can_analyse_responses() { return false; diff --git a/question/type/multianswer/version.php b/question/type/multianswer/version.php index 28bf63d8021..04887328a96 100644 --- a/question/type/multianswer/version.php +++ b/question/type/multianswer/version.php @@ -25,5 +25,14 @@ defined('MOODLE_INTERNAL') || die(); -$plugin->version = 2011051200; -$plugin->requires = 2011060313; +$plugin->component = 'qtype_multianswer'; +$plugin->version = 2011102700; + +$plugin->requires = 2011102700; +$plugin->dependencies = array( + 'qtype_multichoice' => 2011102700, + 'qtype_numerical' => 2011102700, + 'qtype_shortanswer' => 2011102700, +); + +$plugin->maturity = MATURITY_STABLE; diff --git a/question/type/multichoice/lang/en/qtype_multichoice.php b/question/type/multichoice/lang/en/qtype_multichoice.php index ae44717cc7e..ba236be0da1 100644 --- a/question/type/multichoice/lang/en/qtype_multichoice.php +++ b/question/type/multichoice/lang/en/qtype_multichoice.php @@ -23,7 +23,6 @@ * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ -$string['addingmultichoice'] = 'Adding a Multiple choice question'; $string['addmorechoiceblanks'] = 'Blanks for {no} more choices'; $string['answerhowmany'] = 'One or multiple answers?'; $string['answernumbering'] = 'Number the choices?'; @@ -40,7 +39,6 @@ $string['choices'] = 'Available choices'; $string['clozeaid'] = 'Enter missing word'; $string['correctansweris'] = 'The correct answer is: {$a}.'; $string['correctfeedback'] = 'For any correct response'; -$string['editingmultichoice'] = 'Editing a Multiple choice question'; $string['errgradesetanswerblank'] = 'Grade set, but the Answer is blank'; $string['errfractionsaddwrong'] = 'The positive grades you have chosen do not add up to 100%
Instead, they add up to {$a}%'; $string['errfractionsnomax'] = 'One of the choices should be 100%, so that it is
possible to get a full grade for this question.'; @@ -49,10 +47,6 @@ $string['fillouttwochoices'] = 'You must fill out at least two choices. Choices $string['fractionsaddwrong'] = 'The positive grades you have chosen do not add up to 100%
Instead, they add up to {$a}%
Do you want to go back and fix this question?'; $string['fractionsnomax'] = 'One of the choices should be 100%, so that it is
possible to get a full grade for this question.
Do you want to go back and fix this question?'; $string['incorrectfeedback'] = 'For any incorrect response'; -$string['multichoice'] = 'Multiple choice'; -$string['multichoice_help'] = 'In response to a question (that may include a image) the respondent chooses from multiple answers. There are two types of multiple choice questions - one answer and multiple answer.'; -$string['multichoice_link'] = 'question/type/multichoice'; -$string['multichoicesummary'] = 'Allows the selection of a single or multiple responses from a pre-defined list.'; $string['notenoughanswers'] = 'This type of question requires at least {$a} choices'; $string['overallcorrectfeedback'] = 'Feedback for any correct response'; $string['overallfeedback'] = 'Overall feedback'; @@ -61,6 +55,12 @@ $string['overallpartiallycorrectfeedback'] = 'Feedback for any partially correct $string['partiallycorrectfeedback'] = 'For any partially correct response'; $string['pleaseselectananswer'] = 'Please select an answer.'; $string['pleaseselectatleastoneanswer'] = 'Please select at least one answer.'; +$string['pluginname'] = 'Multiple choice'; +$string['pluginname_help'] = 'In response to a question (that may include a image) the respondent chooses from multiple answers. There are two types of multiple choice questions - one answer and multiple answer.'; +$string['pluginname_link'] = 'question/type/multichoice'; +$string['pluginnameadding'] = 'Adding a Multiple choice question'; +$string['pluginnameediting'] = 'Editing a Multiple choice question'; +$string['pluginnamesummary'] = 'Allows the selection of a single or multiple responses from a pre-defined list.'; $string['selectmulti'] = 'Select one or more:'; $string['selectone'] = 'Select one:'; $string['shuffleanswers'] = 'Shuffle the choices?'; diff --git a/question/type/multichoice/version.php b/question/type/multichoice/version.php index 50957e3c6b1..4d11ea60335 100644 --- a/question/type/multichoice/version.php +++ b/question/type/multichoice/version.php @@ -25,5 +25,9 @@ defined('MOODLE_INTERNAL') || die(); -$plugin->version = 2011051200; -$plugin->requires = 2011060313; +$plugin->component = 'qtype_multichoice'; +$plugin->version = 2011102700; + +$plugin->requires = 2011102700; + +$plugin->maturity = MATURITY_STABLE; diff --git a/question/type/numerical/lang/en/qtype_numerical.php b/question/type/numerical/lang/en/qtype_numerical.php index a2c42c3d7be..75dc4570c05 100644 --- a/question/type/numerical/lang/en/qtype_numerical.php +++ b/question/type/numerical/lang/en/qtype_numerical.php @@ -24,7 +24,6 @@ */ $string['acceptederror'] = 'Accepted error'; -$string['addingnumerical'] = 'Adding a Numerical question'; $string['addmoreanswerblanks'] = 'Blanks for {no} More Answers'; $string['addmoreunitblanks'] = 'Blanks for {no} More Units'; $string['answermustbenumberorstar'] = 'The answer must be a number, for example -1.234 or 3e8, or \'*\'.'; @@ -33,7 +32,6 @@ $string['decfractionofquestiongrade'] = 'as a fraction (0-1) of the question gra $string['decfractionofresponsegrade'] = 'as a fraction (0-1) of the response grade'; $string['decimalformat'] = 'decimals'; $string['editableunittext'] = 'the text input element'; -$string['editingnumerical'] = 'Editing a Numerical question'; $string['errornomultiplier'] = 'You must specify a multiplier for this unit.'; $string['errorrepeatedunit'] = 'You cannot have two units with the same name.'; $string['geometric'] = 'Geometric'; @@ -47,10 +45,6 @@ $string['noneditableunittext'] = 'NON editable text of Unit No1'; $string['nonvalidcharactersinnumber'] = 'NON valid characters in number'; $string['notenoughanswers'] = 'You must enter at least one answer.'; $string['nounitdisplay'] = 'No unit grading'; -$string['numerical'] = 'Numerical'; -$string['numerical_help'] = 'From the student perspective, a numerical question looks just like a short-answer question. The difference is that numerical answers are allowed to have an accepted error. This allows a fixed range of answers to be evaluated as one answer. For example, if the answer is 10 with an accepted error of 2, then any number between 8 and 12 will be accepted as correct. '; -$string['numerical_link'] = 'question/type/numerical'; -$string['numericalsummary'] = 'Allows a numerical response, possibly with units, that is graded by comparing against various model answers, possibly with tolerances.'; $string['numericalmultiplier'] = 'Multiplier'; $string['numericalmultiplier_help'] = 'The multiplier is the factor by which the correct numerical response will be multiplied. @@ -65,6 +59,12 @@ $string['onlynumerical'] = 'Units are not used at all. Only the numerical value $string['oneunitshown'] = 'Unit 1 is automatically displayed beside the answer box.'; $string['pleaseenterananswer'] = 'Please enter an answer.'; $string['pleaseenteranswerwithoutthousandssep'] = 'Please enter your answer without using the thousand separator ({$a}).'; +$string['pluginname'] = 'Numerical'; +$string['pluginname_help'] = 'From the student perspective, a numerical question looks just like a short-answer question. The difference is that numerical answers are allowed to have an accepted error. This allows a fixed range of answers to be evaluated as one answer. For example, if the answer is 10 with an accepted error of 2, then any number between 8 and 12 will be accepted as correct. '; +$string['pluginname_link'] = 'question/type/numerical'; +$string['pluginnameadding'] = 'Adding a Numerical question'; +$string['pluginnameediting'] = 'Editing a Numerical question'; +$string['pluginnamesummary'] = 'Allows a numerical response, possibly with units, that is graded by comparing against various model answers, possibly with tolerances.'; $string['relative'] = 'Relative'; $string['rightexample'] = 'on the right, for example 1.00cm or 1.00km'; $string['selectunits'] = 'Select units'; diff --git a/question/type/numerical/version.php b/question/type/numerical/version.php index 149f7ed8834..0786cd3b29a 100644 --- a/question/type/numerical/version.php +++ b/question/type/numerical/version.php @@ -25,5 +25,9 @@ defined('MOODLE_INTERNAL') || die(); -$plugin->version = 2011051200; -$plugin->requires = 2011060313; +$plugin->component = 'qtype_numerical'; +$plugin->version = 2011102700; + +$plugin->requires = 2011102700; + +$plugin->maturity = MATURITY_STABLE; diff --git a/question/type/questiontypebase.php b/question/type/questiontypebase.php index 48ed3d35f99..2541fef2b05 100644 --- a/question/type/questiontypebase.php +++ b/question/type/questiontypebase.php @@ -93,20 +93,6 @@ class question_type { return $this->local_name(); } - /** - * Returns a list of other question types that this one requires in order to - * work. For example, the calculated question type is a subclass of the - * numerical question type, which is a subclass of the shortanswer question - * type; and the randomsamatch question type requires the shortanswer type - * to be installed. - * - * @return array any other question types that this one relies on. An empty - * array if none. - */ - public function requires_qtypes() { - return array(); - } - /** * @return bool override this to return false if this is not really a * question type, for example the description question type is not @@ -263,7 +249,11 @@ class question_type { global $OUTPUT; $heading = $this->get_heading(empty($question->id)); - echo $OUTPUT->heading_with_help($heading, $this->name(), $this->plugin_name()); + if (get_string_manager()->string_exists('pluginname_help', $this->plugin_name())) { + echo $OUTPUT->heading_with_help($heading, 'pluginname', $this->plugin_name()); + } else { + echo $OUTPUT->heading_with_help($heading, $this->name(), $this->plugin_name()); + } $permissionstrs = array(); if (!empty($question->id)) { @@ -297,11 +287,17 @@ class question_type { */ public function get_heading($adding = false) { if ($adding) { - $action = 'adding'; + $string = 'pluginnameadding'; + $fallback = 'adding' . $this->name(); } else { - $action = 'editing'; + $string = 'pluginnameediting'; + $fallback = 'editing' . $this->name(); + } + if (get_string_manager()->string_exists($string, $this->plugin_name())) { + return get_string($string, $this->plugin_name()); + } else { + return get_string($fallback, $this->plugin_name()); } - return get_string($action . $this->name(), $this->plugin_name()); } /** diff --git a/question/type/random/lang/en/qtype_random.php b/question/type/random/lang/en/qtype_random.php index 70622ce1162..952462eaf00 100644 --- a/question/type/random/lang/en/qtype_random.php +++ b/question/type/random/lang/en/qtype_random.php @@ -24,10 +24,10 @@ */ $string['configselectmanualquestions'] = 'Can the random question type select a manually graded question when it is making its random choice of a question from a category?'; -$string['editingrandom'] = 'Editing a random question'; $string['includingsubcategories'] = 'Including subcategories'; -$string['random'] = 'Random'; -$string['random_help'] = 'A random question is not a question type as such, but is a way of inserting a randomly-chosen question from a specified category into an activity.'; +$string['pluginname'] = 'Random'; +$string['pluginname_help'] = 'A random question is not a question type as such, but is a way of inserting a randomly-chosen question from a specified category into an activity.'; +$string['pluginnameediting'] = 'Editing a random question'; $string['randomqname'] = 'Random ({$a})'; $string['randomqplusname'] = 'Random ({$a} and sub-categories)'; $string['selectedby'] = '{$a->questionname} selected by {$a->randomname}'; diff --git a/question/type/random/version.php b/question/type/random/version.php index 0dfd95a9590..b67b2da24cf 100644 --- a/question/type/random/version.php +++ b/question/type/random/version.php @@ -25,5 +25,9 @@ defined('MOODLE_INTERNAL') || die(); -$plugin->version = 2011051200; -$plugin->requires = 2011060313; +$plugin->component = 'qtype_random'; +$plugin->version = 2011102700; + +$plugin->requires = 2011102700; + +$plugin->maturity = MATURITY_STABLE; diff --git a/question/type/shortanswer/lang/en/qtype_shortanswer.php b/question/type/shortanswer/lang/en/qtype_shortanswer.php index f8da33671d5..df9c127e4ef 100644 --- a/question/type/shortanswer/lang/en/qtype_shortanswer.php +++ b/question/type/shortanswer/lang/en/qtype_shortanswer.php @@ -23,7 +23,6 @@ * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ -$string['addingshortanswer'] = 'Adding a short answer question'; $string['addmoreanswerblanks'] = 'Blanks for {no} More Answers'; $string['answer'] = 'Answer: {$a}'; $string['answermustbegiven'] = 'You must enter an answer if there is a grade or feedback.'; @@ -33,11 +32,12 @@ $string['casesensitive'] = 'Case sensitivity'; $string['caseyes'] = 'Yes, case must match'; $string['correctansweris'] = 'The correct answer is: {$a}.'; $string['correctanswers'] = 'Correct answers'; -$string['editingshortanswer'] = 'Editing a Short answer question'; $string['filloutoneanswer'] = 'You must provide at least one possible answer. Answers left blank will not be used. \'*\' can be used as a wildcard to match any characters. The first matching answer will be used to determine the score and feedback.'; $string['notenoughanswers'] = 'This type of question requires at least {$a} answers'; $string['pleaseenterananswer'] = 'Please enter an answer.'; -$string['shortanswer'] = 'Short answer'; -$string['shortanswer_help'] = 'In response to a question (that may include a image) the respondent types a word or short phrase. There may be several possible correct answers, each with a different grade. If the "Case sensitive" option is selected, then you can have different scores for "Word" or "word".'; -$string['shortanswer_link'] = 'question/type/shortanswer'; -$string['shortanswersummary'] = 'Allows a response of one or a few words that is graded by comparing against various model answers, which may contain wildcards.'; +$string['pluginname'] = 'Short answer'; +$string['pluginname_help'] = 'In response to a question (that may include a image) the respondent types a word or short phrase. There may be several possible correct answers, each with a different grade. If the "Case sensitive" option is selected, then you can have different scores for "Word" or "word".'; +$string['pluginname_link'] = 'question/type/shortanswer'; +$string['pluginnameadding'] = 'Adding a short answer question'; +$string['pluginnameediting'] = 'Editing a Short answer question'; +$string['pluginnamesummary'] = 'Allows a response of one or a few words that is graded by comparing against various model answers, which may contain wildcards.'; diff --git a/question/type/shortanswer/version.php b/question/type/shortanswer/version.php index edc2d0948db..f55536a128a 100644 --- a/question/type/shortanswer/version.php +++ b/question/type/shortanswer/version.php @@ -25,5 +25,9 @@ defined('MOODLE_INTERNAL') || die(); -$plugin->version = 2011051200; -$plugin->requires = 2011060313; +$plugin->component = 'qtype_shortanswer'; +$plugin->version = 2011102700; + +$plugin->requires = 2011102700; + +$plugin->maturity = MATURITY_STABLE; diff --git a/question/type/truefalse/lang/en/qtype_truefalse.php b/question/type/truefalse/lang/en/qtype_truefalse.php index a02f59610fd..42ee0706505 100644 --- a/question/type/truefalse/lang/en/qtype_truefalse.php +++ b/question/type/truefalse/lang/en/qtype_truefalse.php @@ -23,18 +23,18 @@ * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ -$string['addingtruefalse'] = 'Adding a True/False question'; $string['correctanswer'] = 'Correct answer'; $string['correctanswerfalse'] = 'The correct answer is \'False\'.'; $string['correctanswertrue'] = 'The correct answer is \'True\'.'; -$string['editingtruefalse'] = 'Editing a True/False question'; $string['false'] = 'False'; $string['feedbackfalse'] = 'Feedback for the response \'False\'.'; $string['feedbacktrue'] = 'Feedback for the response \'True\'.'; $string['pleaseselectananswer'] = 'Please select an answer.'; $string['selectone'] = 'Select one:'; $string['true'] = 'True'; -$string['truefalse'] = 'True/False'; -$string['truefalse_help'] = 'In response to a question (that may include a image) the respondent chooses from true or false.'; -$string['truefalse_link'] = 'question/type/truefalse'; -$string['truefalsesummary'] = 'A simple form of multiple choice question with just the two choices \'True\' and \'False\'.'; +$string['pluginname'] = 'True/False'; +$string['pluginname_help'] = 'In response to a question (that may include a image) the respondent chooses from true or false.'; +$string['pluginname_link'] = 'question/type/truefalse'; +$string['pluginnameadding'] = 'Adding a True/False question'; +$string['pluginnameediting'] = 'Editing a True/False question'; +$string['pluginnamesummary'] = 'A simple form of multiple choice question with just the two choices \'True\' and \'False\'.'; diff --git a/question/type/truefalse/version.php b/question/type/truefalse/version.php index 5f19896a788..f624bccbe53 100644 --- a/question/type/truefalse/version.php +++ b/question/type/truefalse/version.php @@ -25,5 +25,9 @@ defined('MOODLE_INTERNAL') || die(); -$plugin->version = 2011051200; -$plugin->requires = 2011060313; +$plugin->component = 'qtype_truefalse'; +$plugin->version = 2011102700; + +$plugin->requires = 2011102700; + +$plugin->maturity = MATURITY_STABLE; diff --git a/question/type/upgrade.txt b/question/type/upgrade.txt new file mode 100644 index 00000000000..a07b3651449 --- /dev/null +++ b/question/type/upgrade.txt @@ -0,0 +1,32 @@ +This files describes API changes for question type plugins. + +=== 2.2 === + +* The old + public function requires_qtypes() +method is no more. Instead use the ->dependencies facility in version.php. E.g. +$plugin->dependencies = array( + 'qtype_numerical' => 2011102700, +); + +* The plugin name and related strings used to be defined in language strings +called the same thing as the format, for example: + +$string['addingdescription'] = 'Adding a Description'; +$string['description'] = 'Description'; +$string['description_help'] = 'A description is not really a question type. It simply enables text to be displayed without requiring any answers, similar to a label on the course page. +$string['description_link'] = 'A description is not really a question type. It simply enables text to be displayed without requiring any answers, similar to a label on the course page. +$string['descriptionsummary'] = 'This is not actually a question. Instead it is a way to add some instructions, rubric or other content to the activity. This is similar to the way that labels can be used to add content to the course page.'; +$string['editingdescription'] = 'Editing a Description'; + +All these need to be changed to use the standard string name pluginname, as for +other plugin types, and similar for the other strings. + +$string['pluginname'] = 'Description'; +$string['pluginname_help'] = 'A description is not really a question type. It simply enables text to be displayed without requiring any answers, similar to a label on the course page. +$string['pluginname_link'] = 'A description is not really a question type. It simply enables text to be displayed without requiring any answers, similar to a label on the course page. +$string['pluginnameadding'] = 'Adding a Description'; +$string['pluginnameediting'] = 'Editing a Description'; +$string['pluginnamesummary'] = 'This is not actually a question. Instead it is a way to add some instructions, rubric or other content to the activity. This is similar to the way that labels can be used to add content to the course page.'; + +The old strings will continue to work, but only until Moodle 2.3 is released.