Merge branch 'MDL-29808' of git://github.com/timhunt/moodle

Conflicts:
	question/type/upgrade.txt

There were already one just added upgrade.txt file so this ended
conflicting. Reviewed the contents, I've deleted the less detailed
note about pluginname, leaving the longer description added by Tim.

Ciao :-)
This commit is contained in:
Eloy Lafuente (stronk7) 2011-11-10 21:54:36 +01:00
commit d59df6582b
80 changed files with 1046 additions and 289 deletions

View File

@ -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.
@ -39,6 +40,7 @@ admin_externalpage_setup('manageqbehaviours');
$thispageurl = new moodle_url('/admin/qbehaviours.php');
$behaviours = get_plugin_list('qbehaviour');
$pluginmanager = plugin_manager::instance();
// Get some data we will need - question counts and which types are needed.
$counts = $DB->get_records_sql_menu("
@ -50,15 +52,11 @@ foreach ($behaviours as $behaviour => $notused) {
if (!array_key_exists($behaviour, $counts)) {
$counts[$behaviour] = 0;
}
$needed[$behaviour] = $counts[$behaviour] > 0;
$needed[$behaviour] = ($counts[$behaviour] > 0) &&
$pluginmanager->other_plugins_that_require('qbehaviour_' . $behaviour);
$archetypal[$behaviour] = question_engine::is_behaviour_archetypal($behaviour);
}
foreach ($behaviours as $behaviour => $notused) {
foreach (question_engine::get_behaviour_required_behaviours($behaviour) as $reqbehaviour) {
$needed[$reqbehaviour] = true;
}
}
foreach ($counts as $behaviour => $count) {
if (!array_key_exists($behaviour, $behaviours)) {
$counts['missingtype'] += $count;
@ -238,13 +236,14 @@ foreach ($sortedbehaviours as $behaviour => $behaviourname) {
}
// Other question types required by this one.
$requiredbehaviours = question_engine::get_behaviour_required_behaviours($behaviour);
if (!empty($requiredbehaviours)) {
$strrequiredbehaviours = array();
foreach ($requiredbehaviours as $required) {
$strrequiredbehaviours[] = $sortedbehaviours[$required];
$plugin = $pluginmanager->get_plugin_info('qbehaviour_' . $behaviour);
$required = $plugin->get_other_required_plugins();
if (!empty($required)) {
$strrequired = array();
foreach ($required as $component => $notused) {
$strrequired[] = $pluginmanager->plugin_name($component);
}
$row[] = implode(', ', $strrequiredbehaviours);
$row[] = implode(', ', $strrequired);
} else {
$row[] = '';
}

View File

@ -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 {

View File

@ -1383,25 +1383,9 @@ class plugintype_mod extends plugintype_base implements plugin_information {
* Class for question behaviours.
*/
class plugintype_qbehaviour extends plugintype_base implements plugin_information {
/**
* @see plugintype_base::load_other_required_plugins().
* @see plugin_information::get_uninstall_url()
*/
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_engine::get_behaviour_required_behaviours($this->name);
foreach ($required as $other) {
$this->dependencies['qbehaviour_' . $other] = ANY_VERSION;
}
}
public function get_uninstall_url() {
return new moodle_url('/admin/qbehaviours.php',
array('delete' => $this->name, 'sesskey' => sesskey()));
@ -1413,58 +1397,15 @@ 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()));
}
}
/**
* 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

View File

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

View File

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

View File

@ -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 qbehaviour
* @subpackage adaptive
* @copyright 2011 The Open University
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') || die();
$plugin->component = 'qbehaviour_adaptive';
$plugin->version = 2011102700;
$plugin->requires = 2011102700;
$plugin->maturity = MATURITY_STABLE;

View File

@ -40,10 +40,6 @@ require_once(dirname(__FILE__) . '/../adaptive/behaviour.php');
class qbehaviour_adaptivenopenalty extends qbehaviour_adaptive {
const IS_ARCHETYPAL = true;
public static function get_required_behaviours() {
return array('adaptive');
}
protected function adjusted_fraction($fraction, $prevtries) {
return $fraction;
}

View File

@ -0,0 +1,36 @@
<?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 qbehaviour
* @subpackage adaptivenopenalty
* @copyright 2011 The Open University
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') || die();
$plugin->component = 'qbehaviour_adaptivenopenalty';
$plugin->version = 2011102700;
$plugin->requires = 2011102700;
$plugin->dependencies = array(
'qbehaviour_adaptive' => 2011102700
);
$plugin->maturity = MATURITY_STABLE;

View File

@ -77,10 +77,6 @@ abstract class question_behaviour {
}
}
public static function get_required_behaviours() {
return array();
}
/**
* Most behaviours can only work with {@link question_definition}s
* of a particular subtype, or that implement a particular interface.

View File

@ -45,10 +45,6 @@ require_once(dirname(__FILE__) . '/../deferredfeedback/behaviour.php');
class qbehaviour_deferredcbm extends qbehaviour_deferredfeedback {
const IS_ARCHETYPAL = true;
public static function get_required_behaviours() {
return array('deferredfeedback');
}
public static function get_unused_display_options() {
return array('correctness', 'marks', 'specificfeedback', 'generalfeedback',
'rightanswer');

View File

@ -0,0 +1,36 @@
<?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 qbehaviour
* @subpackage deferredcbm
* @copyright 2011 The Open University
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') || die();
$plugin->component = 'qbehaviour_deferredcbm';
$plugin->version = 2011102700;
$plugin->requires = 2011102700;
$plugin->dependencies = array(
'qbehaviour_deferredfeedback' => 2011102700
);
$plugin->maturity = MATURITY_STABLE;

View File

@ -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 qbehaviour
* @subpackage deferredfeedback
* @copyright 2011 The Open University
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') || die();
$plugin->component = 'qbehaviour_deferredfeedback';
$plugin->version = 2011102700;
$plugin->requires = 2011102700;
$plugin->maturity = MATURITY_STABLE;

View File

@ -45,10 +45,6 @@ require_once(dirname(__FILE__) . '/../immediatefeedback/behaviour.php');
class qbehaviour_immediatecbm extends qbehaviour_immediatefeedback {
const IS_ARCHETYPAL = true;
public static function get_required_behaviours() {
return array('immediatefeedback', 'deferredcbm');
}
public function get_min_fraction() {
return question_cbm::adjust_fraction(parent::get_min_fraction(), question_cbm::HIGH);
}

View File

@ -0,0 +1,37 @@
<?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 qbehaviour
* @subpackage immediatecbm
* @copyright 2011 The Open University
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') || die();
$plugin->component = 'qbehaviour_immediatecbm';
$plugin->version = 2011102700;
$plugin->requires = 2011102700;
$plugin->dependencies = array(
'qbehaviour_immediatefeedback' => 2011102700,
'qbehaviour_deferredcbm' => 2011102700
);
$plugin->maturity = MATURITY_STABLE;

View File

@ -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 qbehaviour
* @subpackage immediatefeedback
* @copyright 2011 The Open University
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') || die();
$plugin->component = 'qbehaviour_immediatefeedback';
$plugin->version = 2011102700;
$plugin->requires = 2011102700;
$plugin->maturity = MATURITY_STABLE;

View File

@ -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 qbehaviour
* @subpackage informationitem
* @copyright 2011 The Open University
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') || die();
$plugin->component = 'qbehaviour_informationitem';
$plugin->version = 2011102700;
$plugin->requires = 2011102700;
$plugin->maturity = MATURITY_STABLE;

View File

@ -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 qbehaviour
* @subpackage interactive
* @copyright 2011 The Open University
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') || die();
$plugin->component = 'qbehaviour_interactive';
$plugin->version = 2011102700;
$plugin->requires = 2011102700;
$plugin->maturity = MATURITY_STABLE;

View File

@ -64,10 +64,6 @@ require_once(dirname(__FILE__) . '/../interactive/behaviour.php');
class qbehaviour_interactivecountback extends qbehaviour_interactive {
const IS_ARCHETYPAL = false;
public static function get_required_behaviours() {
return array('interactive');
}
public function required_question_definition_type() {
return 'question_automatically_gradable_with_countback';
}

View File

@ -0,0 +1,36 @@
<?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 qbehaviour
* @subpackage interactivecountback
* @copyright 2011 The Open University
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') || die();
$plugin->component = 'qbehaviour_interactivecountback';
$plugin->version = 2011102700;
$plugin->requires = 2011102700;
$plugin->dependencies = array(
'qbehaviour_interactive' => 2011102700
);
$plugin->maturity = MATURITY_STABLE;

View File

@ -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 qbehaviour
* @subpackage manualgraded
* @copyright 2011 The Open University
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') || die();
$plugin->component = 'qbehaviour_manualgraded';
$plugin->version = 2011102700;
$plugin->requires = 2011102700;
$plugin->maturity = MATURITY_STABLE;

View File

@ -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 qbehaviour
* @subpackage missing
* @copyright 2011 The Open University
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') || die();
$plugin->component = 'qbehaviour_missing';
$plugin->version = 2011102700;
$plugin->requires = 2011102700;
$plugin->maturity = MATURITY_STABLE;

View File

@ -0,0 +1,11 @@
This files describes API changes for question behaviour plugins.
=== 2.2 ===
* The old
public static function get_required_behaviours()
method is no more. Instead use the ->dependencies facility in version.php. E.g.
$plugin->dependencies = array(
'qbehaviour_immediatefeedback' => 2011102700,
'qbehaviour_deferredcbm' => 2011102700
);

View File

@ -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 '<div class="qtypeoption">' . "\n";
echo '<label for="qtype_' . $qtype->name() . '">';
echo '<input type="radio" name="qtype" id="qtype_' . $qtype->name() . '" value="' . $qtype->name() . '" />';
@ -1788,8 +1794,7 @@ function print_qtype_to_add_option($qtype) {
$fakequestion = new stdClass();
$fakequestion->qtype = $qtype->name();
print_question_icon($fakequestion);
echo $qtype->menu_name() . '</span><span class="qtypesummary">' .
get_string($qtype->name() . 'summary', 'qtype_' . $qtype->name());
echo $qtype->menu_name() . '</span><span class="qtypesummary">' . $summary;
echo "</span></label>\n";
echo "</div>\n";
}

View File

@ -328,17 +328,6 @@ abstract class question_engine {
return get_string('pluginname', 'qbehaviour_' . $behaviour);
}
/**
* Get the translated name of an behaviour, for display in the UI.
* @param string $behaviour the internal name of the model.
* @return string name from the current language pack.
*/
public static function get_behaviour_required_behaviours($behaviour) {
self::load_behaviour_class($behaviour);
$class = 'qbehaviour_' . $behaviour;
return $class::get_required_behaviours();
}
/**
* @return array all the file area names that may contain response files.
*/

View File

@ -51,8 +51,12 @@ class question_export_form extends moodleform {
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');

View File

@ -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';

View File

@ -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;

View File

@ -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.';

View File

@ -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;

View File

@ -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.';

View File

@ -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;

View File

@ -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.';

View File

@ -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;

View File

@ -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';
@ -37,3 +33,5 @@ $string['giftrightbraceerror'] = 'Could not find a }';
$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';

View File

@ -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;

View File

@ -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.';

View File

@ -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;

View File

@ -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';

View File

@ -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;

View File

@ -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';

View File

@ -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 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;

View File

@ -0,0 +1,17 @@
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';

View File

@ -28,10 +28,9 @@ $string['missinganswer'] = 'Too few :ANSWER, :Lx, :Rx statements for question li
$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}) :';

View File

@ -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 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;

View File

@ -23,6 +23,6 @@
* @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';

View File

@ -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 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;

View File

@ -25,11 +25,10 @@
$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';

View File

@ -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 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;

View File

@ -53,8 +53,12 @@ class question_import_form extends moodleform {
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');

View File

@ -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 <strong>{x..}</strong> 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.<br />Modify the answers tolerance settings available as Advanced parameters';
$string['param'] = 'Param {<strong>{$a}</strong>}';
$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';

View File

@ -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

View File

@ -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;

View File

@ -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.';

View File

@ -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;

View File

@ -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;

View File

@ -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 <strong>{x..}</strong> 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';

View File

@ -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;

View File

@ -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.';

View File

@ -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;

View File

@ -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';

View File

@ -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;

View File

@ -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.';

View File

@ -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;

View File

@ -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'] = '<b>This question is of a type that has not been installed on your Moodle yet.<br />Please alert your Moodle administrator.</b>';

View File

@ -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;

View File

@ -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 "<strong>{$a}</strong>" 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';

View File

@ -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;

View File

@ -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;

View File

@ -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%<br />Instead, they add up to {$a}%';
$string['errfractionsnomax'] = 'One of the choices should be 100%, so that it is<br />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%<br />Instead, they add up to {$a}%<br />Do you want to go back and fix this question?';
$string['fractionsnomax'] = 'One of the choices should be 100%, so that it is<br />possible to get a full grade for this question.<br />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?';

View File

@ -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;

View File

@ -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';

View File

@ -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;

View File

@ -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());
}
/**

View File

@ -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}';

View File

@ -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;

View File

@ -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.';

View File

@ -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;

View File

@ -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\'.';

View File

@ -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;

View File

@ -10,7 +10,31 @@ This files describes API changes for question type plugins.
If you do not upgrade your code, it will not break, but there will be PHP
warnings, and it the export will not work 100% correctly.
* Question type plugins should start using a string called 'pluginname' for the
question type name, as with other plugins. Using a string with the same name
as the question type (e.g. get_string('essay', 'qtype_essay') will be supported
for one more release, but will generate a debugging warning.
* 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.