Merge branch 'MDL-72517-master' of git://github.com/cescobedo/moodle

This commit is contained in:
Shamim Rezaie 2021-10-07 13:03:06 +11:00
commit 6e2f35ae18
11 changed files with 18 additions and 1065 deletions

View file

@ -1726,7 +1726,7 @@ class core_plugin_manager {
// branch, listed should be no plugins that were removed at 1.9.x - 2.1.x versions as
// Moodle 2.3 supports upgrades from 2.2.x only.
$plugins = array(
'qformat' => array('blackboard', 'learnwise'),
'qformat' => array('blackboard', 'learnwise', 'examview'),
'auth' => array('radius', 'fc', 'nntp', 'pam', 'pop3', 'imap'),
'block' => array('course_overview', 'messages', 'community', 'participants'),
'cachestore' => array('memcache'),
@ -1972,7 +1972,7 @@ class core_plugin_manager {
),
'qformat' => array(
'aiken', 'blackboard_six', 'examview', 'gift',
'aiken', 'blackboard_six', 'gift',
'missingword', 'multianswer',
'xhtml', 'xml'
),

View file

@ -2882,5 +2882,15 @@ function xmldb_main_upgrade($oldversion) {
upgrade_main_savepoint(true, 2021100300.02);
}
if ($oldversion < 2021100600.01) {
// Remove qformat_examview (unless it has manually been added back).
if (!file_exists($CFG->dirroot . '/question/format/examview/format.php')) {
unset_all_config_for_plugin('qformat_examview');
}
// Main savepoint reached.
upgrade_main_savepoint(true, 2021100600.01);
}
return true;
}

View file

@ -1,46 +0,0 @@
<?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/>.
/**
* Privacy Subsystem implementation for qformat_examview.
*
* @package qformat_examview
* @copyright 2018 Andrew Nicols <andrew@nicols.co.uk>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
namespace qformat_examview\privacy;
defined('MOODLE_INTERNAL') || die();
/**
* Privacy Subsystem for qformat_examview implementing null_provider.
*
* @copyright 2018 Andrew Nicols <andrew@nicols.co.uk>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class provider implements \core_privacy\local\metadata\null_provider {
/**
* Get the language string identifier with the component's language
* file to explain why this plugin stores no data.
*
* @return string
*/
public static function get_reason() : string {
return 'privacy:metadata';
}
}

View file

@ -1,327 +0,0 @@
<?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/>.
/**
* Examview question importer.
*
* @package qformat_examview
* @copyright 2005 Howard Miller
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') || die();
require_once($CFG->libdir . '/xmlize.php');
/**
* Examview question importer.
*
* @copyright 2005 Howard Miller
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class qformat_examview extends qformat_based_on_xml {
public $qtypes = array(
'tf' => 'truefalse',
'mc' => 'multichoice',
'yn' => 'truefalse',
'co' => 'shortanswer',
'ma' => 'match',
'mtf' => 99,
'nr' => 'numerical',
'pr' => 99,
'es' => 'essay',
'ca' => 99,
'ot' => 99,
'sa' => 'shortanswer',
);
public $matchingquestions = array();
public function provide_import() {
return true;
}
public function mime_type() {
return 'application/xml';
}
/**
* unxmlise reconstructs part of the xml data structure in order
* to identify the actual data therein
* @param array $xml section of the xml data structure
* @return string data with evrything else removed
*/
protected function unxmlise( $xml ) {
// If it's not an array then it's probably just data.
if (!is_array($xml)) {
$text = s($xml);
} else {
// Otherwise parse the array.
$text = '';
foreach ($xml as $tag => $data) {
// If tag is '@' then it's attributes and we don't care.
if ($tag!=='@') {
$text = $text . $this->unxmlise( $data );
}
}
}
// Currently we throw the tags we found.
$text = strip_tags($text);
return $text;
}
public function parse_matching_groups($matchinggroups) {
if (empty($matchinggroups)) {
return;
}
foreach ($matchinggroups as $matchgroup) {
$newgroup = new stdClass();
$groupname = trim($matchgroup['@']['name']);
$questiontext = $this->unxmlise($matchgroup['#']['text'][0]['#']);
$newgroup->questiontext = trim($questiontext);
$newgroup->subchoices = array();
$newgroup->subquestions = array();
$newgroup->subanswers = array();
$choices = $matchgroup['#']['choices']['0']['#'];
foreach ($choices as $key => $value) {
if (strpos(trim($key), 'choice-') !== false) {
$key = strtoupper(trim(str_replace('choice-', '', $key)));
$newgroup->subchoices[$key] = trim($value['0']['#']);
}
}
$this->matching_questions[$groupname] = $newgroup;
}
}
protected function parse_ma($qrec, $groupname) {
$matchgroup = $this->matching_questions[$groupname];
$phrase = trim($this->unxmlise($qrec['text']['0']['#']));
$answer = trim($this->unxmlise($qrec['answer']['0']['#']));
$answer = strip_tags( $answer );
$matchgroup->mappings[$phrase] = $matchgroup->subchoices[$answer];
$this->matching_questions[$groupname] = $matchgroup;
return null;
}
protected function process_matches(&$questions) {
if (empty($this->matching_questions)) {
return;
}
foreach ($this->matching_questions as $matchgroup) {
$question = $this->defaultquestion();
$htmltext = s($matchgroup->questiontext);
$question->questiontext = $htmltext;
$question->questiontextformat = FORMAT_HTML;
$question->questiontextfiles = array();
$question->name = $this->create_default_question_name($question->questiontext, get_string('questionname', 'question'));
$question->qtype = 'match';
$question = $this->add_blank_combined_feedback($question);
$question->subquestions = array();
$question->subanswers = array();
foreach ($matchgroup->subchoices as $subchoice) {
$fiber = array_keys ($matchgroup->mappings, $subchoice);
$subquestion = '';
foreach ($fiber as $subquestion) {
$question->subquestions[] = $this->text_field($subquestion);
$question->subanswers[] = $subchoice;
}
if ($subquestion == '') { // Then in this case, $subchoice is a distractor.
$question->subquestions[] = $this->text_field('');
$question->subanswers[] = $subchoice;
}
}
$questions[] = $question;
}
}
protected function cleanunicode($text) {
return str_replace('&#x2019;', "'", $text);
}
public function readquestions($lines) {
// Parses an array of lines into an array of questions,
// where each item is a question object as defined by
// readquestion().
$questions = array();
$currentquestion = array();
$text = implode(' ', $lines);
$text = $this->cleanunicode($text);
$xml = xmlize($text, 0);
if (!empty($xml['examview']['#']['matching-group'])) {
$this->parse_matching_groups($xml['examview']['#']['matching-group']);
}
$questionnode = $xml['examview']['#']['question'];
foreach ($questionnode as $currentquestion) {
if ($question = $this->readquestion($currentquestion)) {
$questions[] = $question;
}
}
$this->process_matches($questions);
return $questions;
}
public function readquestion($qrec) {
global $OUTPUT;
$type = trim($qrec['@']['type']);
$question = $this->defaultquestion();
if (array_key_exists($type, $this->qtypes)) {
$question->qtype = $this->qtypes[$type];
} else {
$question->qtype = null;
}
$question->single = 1;
// Only one answer is allowed.
$htmltext = $this->unxmlise($qrec['#']['text'][0]['#']);
$question->questiontext = $this->cleaninput($htmltext);
$question->questiontextformat = FORMAT_HTML;
$question->questiontextfiles = array();
$question->name = $this->create_default_question_name($question->questiontext, get_string('questionname', 'question'));
switch ($question->qtype) {
case 'multichoice':
$question = $this->parse_mc($qrec['#'], $question);
break;
case 'match':
$groupname = trim($qrec['@']['group']);
$question = $this->parse_ma($qrec['#'], $groupname);
break;
case 'truefalse':
$question = $this->parse_tf_yn($qrec['#'], $question);
break;
case 'shortanswer':
$question = $this->parse_co($qrec['#'], $question);
break;
case 'essay':
$question = $this->parse_es($qrec['#'], $question);
break;
case 'numerical':
$question = $this->parse_nr($qrec['#'], $question);
break;
break;
default:
echo $OUTPUT->notification(get_string('unknownorunhandledtype', 'question', $type));
$question = null;
}
return $question;
}
protected function parse_tf_yn($qrec, $question) {
$choices = array('T' => 1, 'Y' => 1, 'F' => 0, 'N' => 0 );
$answer = trim($qrec['answer'][0]['#']);
$question->answer = $choices[$answer];
$question->correctanswer = $question->answer;
if ($question->answer == 1) {
$question->feedbacktrue = $this->text_field(get_string('correct', 'question'));
$question->feedbackfalse = $this->text_field(get_string('incorrect', 'question'));
} else {
$question->feedbacktrue = $this->text_field(get_string('incorrect', 'question'));
$question->feedbackfalse = $this->text_field(get_string('correct', 'question'));
}
return $question;
}
protected function parse_mc($qrec, $question) {
$question = $this->add_blank_combined_feedback($question);
$answer = 'choice-'.strtolower(trim($qrec['answer'][0]['#']));
$choices = $qrec['choices'][0]['#'];
foreach ($choices as $key => $value) {
if (strpos(trim($key), 'choice-') !== false) {
$question->answer[] = $this->text_field(s($this->unxmlise($value[0]['#'])));
if (strcmp($key, $answer) == 0) {
$question->fraction[] = 1;
$question->feedback[] = $this->text_field(get_string('correct', 'question'));
} else {
$question->fraction[] = 0;
$question->feedback[] = $this->text_field(get_string('incorrect', 'question'));
}
}
}
return $question;
}
protected function parse_co($qrec, $question) {
$question->usecase = 0;
$answer = trim($this->unxmlise($qrec['answer'][0]['#']));
$answer = strip_tags( $answer );
$answers = explode("\n", $answer);
foreach ($answers as $key => $value) {
$value = trim($value);
if (strlen($value) > 0) {
$question->answer[] = $value;
$question->fraction[] = 1;
$question->feedback[] = $this->text_field(get_string('correct', 'question'));
}
}
$question->answer[] = '*';
$question->fraction[] = 0;
$question->feedback[] = $this->text_field(get_string('incorrect', 'question'));
return $question;
}
protected function parse_es($qrec, $question) {
$feedback = trim($this->unxmlise($qrec['answer'][0]['#']));
$question->graderinfo = $this->text_field($feedback);
$question->responsetemplate = $this->text_field('');
$question->responserequired = 1;
$question->feedback = $feedback;
$question->responseformat = 'editor';
$question->responsefieldlines = 15;
$question->attachments = 0;
$question->attachmentsrequired = 0;
$question->fraction = 0;
return $question;
}
protected function parse_nr($qrec, $question) {
$answer = trim($this->unxmlise($qrec['answer'][0]['#']));
$answer = strip_tags( $answer );
$answers = explode("\n", $answer);
foreach ($answers as $key => $value) {
$value = trim($value);
if (is_numeric($value)) {
$errormargin = 0;
$question->answer[] = $value;
$question->fraction[] = 1;
$question->feedback[] = $this->text_field(get_string('correct', 'question'));
$question->tolerance[] = $errormargin;
}
}
return $question;
}
}
// End class.

View file

@ -1,27 +0,0 @@
<?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/>.
/**
* Strings for component 'qformat_examview', language 'en', branch 'MOODLE_20_STABLE'
*
* @package qformat_examview
* @copyright 2010 Helen Foster
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
$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.';
$string['privacy:metadata'] = 'The Examview question format plugin does not store any personal data.';

View file

@ -1,305 +0,0 @@
<?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/>.
/**
* Unit tests for the Moodle Examview format.
*
* @package qformat_examview
* @copyright 2012 jean-Michel Vedrine
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') || die();
global $CFG;
require_once($CFG->libdir . '/questionlib.php');
require_once($CFG->dirroot . '/question/format.php');
require_once($CFG->dirroot . '/question/format/examview/format.php');
require_once($CFG->dirroot . '/question/engine/tests/helpers.php');
/**
* Unit tests for the examview question import format.
*
* @copyright 2012 Jean-Michel Vedrine
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class qformat_examview_test extends question_testcase {
public function make_test_xml() {
$xml = $xml = file_get_contents(__DIR__ . '/fixtures/examview_sample.xml');
return array(0=>$xml);
}
public function test_import_truefalse() {
$xml = $this->make_test_xml();
$questions = array();
$importer = new qformat_examview();
$questions = $importer->readquestions($xml);
$q = $questions[0];
$expectedq = new stdClass();
$expectedq->qtype = 'truefalse';
$expectedq->name = '42 is the Absolute Answer to everything.';
$expectedq->questiontext = "42 is the Absolute Answer to everything.";
$expectedq->questiontextformat = FORMAT_HTML;
$expectedq->generalfeedback = '';
$expectedq->generalfeedbackformat = FORMAT_MOODLE;
$expectedq->defaultmark = 1;
$expectedq->length = 1;
$expectedq->correctanswer = 0;
$expectedq->feedbacktrue = array(
'text' => get_string('incorrect', 'question'),
'format' => FORMAT_HTML,
'files' => array(),
);
$expectedq->feedbackfalse = array(
'text' => get_string('correct', 'question'),
'format' => FORMAT_HTML,
'files' => array(),
);
$this->assert(new question_check_specified_fields_expectation($expectedq), $q);
}
public function test_import_multichoice_single() {
$xml = $this->make_test_xml();
$questions = array();
$importer = new qformat_examview();
$questions = $importer->readquestions($xml);
$q = $questions[1];
$expectedq = new stdClass();
$expectedq->qtype = 'multichoice';
$expectedq->single = 1;
$expectedq->name = "What's between orange and green in the spectrum?";
$expectedq->questiontext = "What's between orange and green in the spectrum?";
$expectedq->questiontextformat = FORMAT_HTML;
$expectedq->correctfeedback = array('text' => '',
'format' => FORMAT_HTML, 'files' => array());
$expectedq->partiallycorrectfeedback = array('text' => '',
'format' => FORMAT_HTML, 'files' => array());
$expectedq->incorrectfeedback = array('text' => '',
'format' => FORMAT_HTML, 'files' => array());
$expectedq->generalfeedback = '';
$expectedq->generalfeedbackformat = FORMAT_MOODLE;
$expectedq->defaultmark = 1;
$expectedq->length = 1;
$expectedq->penalty = 0.3333333;
$expectedq->shuffleanswers = get_config('quiz', 'shuffleanswers');
$expectedq->answer = array(
0 => array(
'text' => 'red',
'format' => FORMAT_HTML,
'files' => array(),
),
1 => array(
'text' => 'yellow',
'format' => FORMAT_HTML,
'files' => array(),
),
2 => array(
'text' => 'blue',
'format' => FORMAT_HTML,
'files' => array(),
)
);
$expectedq->fraction = array(0, 1, 0);
$expectedq->feedback = array(
0 => array(
'text' => get_string('incorrect', 'question'),
'format' => FORMAT_HTML,
'files' => array(),
),
1 => array(
'text' => get_string('correct', 'question'),
'format' => FORMAT_HTML,
'files' => array(),
),
2 => array(
'text' => get_string('incorrect', 'question'),
'format' => FORMAT_HTML,
'files' => array(),
)
);
$this->assert(new question_check_specified_fields_expectation($expectedq), $q);
}
public function test_import_numerical() {
$xml = $this->make_test_xml();
$questions = array();
$importer = new qformat_examview();
$questions = $importer->readquestions($xml);
$q = $questions[2];
$expectedq = new stdClass();
$expectedq->qtype = 'numerical';
$expectedq->name = 'This is a numeric response question. How much is 12 * 2?';
$expectedq->questiontext = 'This is a numeric response question. How much is 12 * 2?';
$expectedq->questiontextformat = FORMAT_HTML;
$expectedq->generalfeedback = '';
$expectedq->generalfeedbackformat = FORMAT_MOODLE;
$expectedq->defaultmark = 1;
$expectedq->length = 1;
$expectedq->penalty = 0.3333333;
$expectedq->shuffleanswers = get_config('quiz', 'shuffleanswers');
$expectedq->answer = array('24');
$expectedq->fraction = array(1);
$expectedq->feedback = array(
0 => array(
'text' => get_string('correct', 'question'),
'format' => FORMAT_HTML,
'files' => array(),
),
);
$this->assert(new question_check_specified_fields_expectation($expectedq), $q);
}
public function test_import_fill_in_the_blank() {
$xml = $this->make_test_xml();
$questions = array();
$importer = new qformat_examview();
$questions = $importer->readquestions($xml);
$q = $questions[3];
$expectedq = new stdClass();
$expectedq->qtype = 'shortanswer';
$expectedq->name = 'Name an amphibian: __________.';
$expectedq->questiontext = 'Name an amphibian: __________.';
$expectedq->questiontextformat = FORMAT_HTML;
$expectedq->generalfeedback = '';
$expectedq->generalfeedbackformat = FORMAT_MOODLE;
$expectedq->defaultmark = 1;
$expectedq->length = 1;
$expectedq->usecase = 0;
$expectedq->answer = array('frog', '*');
$expectedq->fraction = array(1, 0);
$expectedq->feedback = array(
0 => array(
'text' => get_string('correct', 'question'),
'format' => FORMAT_HTML,
'files' => array(),
),
1 => array(
'text' => get_string('incorrect', 'question'),
'format' => FORMAT_HTML,
'files' => array(),
)
);
$this->assert(new question_check_specified_fields_expectation($expectedq), $q);
}
public function test_import_essay() {
$xml = $this->make_test_xml();
$questions = array();
$importer = new qformat_examview();
$questions = $importer->readquestions($xml);
$q = $questions[4];
$expectedq = new stdClass();
$expectedq->qtype = 'essay';
$expectedq->name = 'How are you?';
$expectedq->questiontext = 'How are you?';
$expectedq->questiontextformat = FORMAT_HTML;
$expectedq->generalfeedback = '';
$expectedq->generalfeedbackformat = FORMAT_MOODLE;
$expectedq->defaultmark = 1;
$expectedq->length = 1;
$expectedq->responseformat = 'editor';
$expectedq->responsefieldlines = 15;
$expectedq->attachments = 0;
$expectedq->graderinfo = array(
'text' => 'Examview answer for essay questions will be imported as informations for graders.',
'format' => FORMAT_HTML,
'files' => array());
$this->assert(new question_check_specified_fields_expectation($expectedq), $q);
}
// Due to the way matching questions are parsed,
// the test for matching questions is somewhat different.
// First we test the parse_matching_groups method alone.
// Then we test the whole process wich involve parse_matching_groups,
// parse_ma and process_matches methods.
public function test_parse_matching_groups() {
$lines = $this->make_test_xml();
$importer = new qformat_examview();
$text = implode(' ', $lines);
$xml = xmlize($text, 0);
$importer->parse_matching_groups($xml['examview']['#']['matching-group']);
$matching = $importer->matching_questions;
$group = new stdClass();
$group->questiontext = 'Classify the animals.';
$group->subchoices = array('A' => 'insect', 'B' => 'amphibian', 'C' =>'mammal');
$group->subquestions = array();
$group->subanswers = array();
$expectedmatching = array( 'Matching 1' => $group);
$this->assertEquals($matching, $expectedmatching);
}
public function test_import_match() {
$xml = $this->make_test_xml();
$questions = array();
$importer = new qformat_examview();
$questions = $importer->readquestions($xml);
$q = $questions[5];
$expectedq = new stdClass();
$expectedq->qtype = 'match';
$expectedq->name = 'Classify the animals.';
$expectedq->questiontext = 'Classify the animals.';
$expectedq->questiontextformat = FORMAT_HTML;
$expectedq->correctfeedback = array('text' => '',
'format' => FORMAT_HTML, 'files' => array());
$expectedq->partiallycorrectfeedback = array('text' => '',
'format' => FORMAT_HTML, 'files' => array());
$expectedq->incorrectfeedback = array('text' => '',
'format' => FORMAT_HTML, 'files' => array());
$expectedq->generalfeedback = '';
$expectedq->generalfeedbackformat = FORMAT_MOODLE;
$expectedq->defaultmark = 1;
$expectedq->length = 1;
$expectedq->penalty = 0.3333333;
$expectedq->shuffleanswers = get_config('quiz', 'shuffleanswers');
$expectedq->subquestions = array(
array('text' => '', 'format' => FORMAT_HTML, 'files' => array()),
array('text' => 'frog', 'format' => FORMAT_HTML, 'files' => array()),
array('text' => 'newt', 'format' => FORMAT_HTML, 'files' => array()),
array('text' => 'cat', 'format' => FORMAT_HTML, 'files' => array()));
$expectedq->subanswers = array('insect', 'amphibian', 'amphibian', 'mammal');
$this->assert(new question_check_specified_fields_expectation($expectedq), $q);
}
}

View file

@ -1,161 +0,0 @@
<?xml version='1.0' encoding='utf-8' standalone='yes'?>
<examview type='test' platform='Windows' app-version='4.0.2'>
<header>
<title>Moodle Example</title>
<version>A</version>
</header>
<font-table>
<font-entry number='1'>
<charset>ansi</charset>
<name>Times New Roman</name>
<pitch>variable</pitch>
<family>roman</family>
</font-entry>
</font-table>
<preferences>
<show>
<show-answer value='yes'/>
<show-difficulty value='yes'/>
<show-reference value='yes'/>
<show-text-objective value='yes'/>
<show-state-objective value='yes'/>
<show-topic value='yes'/>
<show-keywords value='yes'/>
<show-misc value='yes'/>
<show-notes value='yes'/>
<show-rationale value='yes'/>
</show>
<leave-answer-space>
<tf value='yes'/>
<mtf value='yes'/>
<mc value='yes'/>
<yn value='yes'/>
<nr value='no'/>
<co value='no'/>
<ma value='yes'/>
<sa value='no'/>
<pr value='no'/>
<es value='no'/>
<ca value='no'/>
<ot value='no'/>
</leave-answer-space>
<question-type-order value='tf,mtf,mc,yn,nr,co,ma,sa,pr,es,ca,ot'/>
<section-page-break value='no'/>
<bi-display-mode value='mc'/>
<tf-show-choices value='no'/>
<mc-conserve-paper value='no'/>
<mc-choice-sequence value='abcde'/>
<show-answer-lines value='no'/>
<question-numbering value='continuous'/>
<answer-style template='a.' style='none'/>
<number-style template='1.' style='none'/>
<max-question-id value='9'/>
<max-narrative-id value='0'/>
<max-group-id value='1'/>
<default-font target='title'>
<number>1</number>
<size>13</size>
<style>bold</style>
<text-rgb>#000000</text-rgb>
</default-font>
<default-font target='sectiontitle'>
<number>1</number>
<size>11</size>
<style>bold</style>
<text-rgb>#000000</text-rgb>
</default-font>
<default-font target='questionnumber'>
<number>1</number>
<size>11</size>
<text-rgb>#000000</text-rgb>
</default-font>
<default-font target='answerchoice'>
<number>1</number>
<size>11</size>
<text-rgb>#000000</text-rgb>
</default-font>
<default-font target='newquestiondefault'>
<number>1</number>
<size>11</size>
<text-rgb>#000000</text-rgb>
</default-font>
</preferences>
<test-header page='first'><para tabs='R10440'><b>Name: ________________________ Class: ___________________ Date: __________ ID: <field field-type='version'/></b></para></test-header>
<test-header page='subsequent'><para tabs='R10440'><b>Name: ________________________ ID: <field field-type='version'/></b></para></test-header>
<test-footer page='first'><para justify='center'><field field-type='pageNumber'/>
</para></test-footer>
<test-footer page='subsequent'><para justify='center'><field field-type='pageNumber'/>
</para></test-footer>
<instruction type='tf'><b>True/False</b><font size='10'>
</font><i>Indicate whether the sentence or statement is true or false.</i></instruction>
<instruction type='mtf'><b>Modified True/False</b><font size='10'>
</font><i>Indicate whether the sentence or statement is true or false. If false, change the identified word or phrase to make the sentence or statement true.</i></instruction>
<instruction type='mc'><b>Multiple Choice</b><font size='10'>
</font><i>Identify the letter of the choice that best completes the statement or answers the question.</i></instruction>
<instruction type='yn'><b>Yes/No</b><font size='10'>
</font><i>Indicate whether you agree with the sentence or statement.</i></instruction>
<instruction type='nr'><b>Numeric Response</b></instruction>
<instruction type='co'><b>Completion</b><font size='10'>
</font><i>Complete each sentence or statement.</i></instruction>
<instruction type='ma'><b>Matching</b></instruction>
<instruction type='sa'><b>Short Answer</b></instruction>
<instruction type='pr'><b>Problem</b></instruction>
<instruction type='es'><b>Essay</b></instruction>
<instruction type='ca'><b>Case</b></instruction>
<instruction type='ot'><b>Other</b></instruction>
<question type='tf' question-id='1' bank-id='0'>
<text>42 is the Absolute Answer to everything.</text>
<rationale>42 is the Ultimate Answer.</rationale>
<answer>F</answer>
</question>
<question type='mc' question-id='2' bank-id='0'>
<text><font size='10'>What's between orange and green in the spectrum?</font></text>
<choices columns='2'>
<choice-a><font size='10'>red</font></choice-a>
<choice-b><font size='10'>yellow</font></choice-b>
<choice-c><font size='10'>blue</font></choice-c>
</choices>
<answer>B</answer>
</question>
<question type='nr' question-id='3' bank-id='0'>
<text>This is a numeric response question. How much is 12 * 2?</text>
<answer>24</answer>
<info>
<answer-space>-1</answer-space>
</info>
</question>
<matching-group group-id='1' bank-id='0' name='Matching 1'>
<text>Classify the animals.</text>
<choices columns='2'>
<choice-a>insect</choice-a>
<choice-b>amphibian</choice-b>
<choice-c>mammal</choice-c>
</choices>
</matching-group>
<question type='ma' question-id='6' bank-id='0' group='Matching 1'>
<text>cat</text>
<answer>C</answer>
</question>
<question type='ma' question-id='7' bank-id='0' group='Matching 1'>
<text>frog</text>
<answer>B</answer>
</question>
<question type='ma' question-id='8' bank-id='0' group='Matching 1'>
<text>newt</text>
<answer>B</answer>
</question>
<question type='sa' question-id='5' bank-id='0'>
<text>Name an amphibian: __________.</text>
<answer>frog</answer>
<info>
<answer-space>-1</answer-space>
</info>
</question>
<question type='es' question-id='4' bank-id='0'>
<text>How are you?</text>
<answer>Examview answer for essay questions will be imported as informations for graders.</answer>
<info>
<answer-space>-1</answer-space>
</info>
</question>
</examview>

View file

@ -1,164 +0,0 @@
<?xml version='1.0' encoding='utf-8' standalone='yes'?>
<examview type='test' platform='Windows' app-version='4.0.2'>
<header>
<title>Moodle Example</title>
<version>A</version>
</header>
<font-table>
<font-entry number='1'>
<charset>ansi</charset>
<name>Times New Roman</name>
<pitch>variable</pitch>
<family>roman</family>
</font-entry>
</font-table>
<preferences>
<show>
<show-answer value='yes'/>
<show-difficulty value='yes'/>
<show-reference value='yes'/>
<show-text-objective value='yes'/>
<show-state-objective value='yes'/>
<show-topic value='yes'/>
<show-keywords value='yes'/>
<show-misc value='yes'/>
<show-notes value='yes'/>
<show-rationale value='yes'/>
</show>
<leave-answer-space>
<tf value='yes'/>
<mtf value='yes'/>
<mc value='yes'/>
<yn value='yes'/>
<nr value='no'/>
<co value='no'/>
<ma value='yes'/>
<sa value='no'/>
<pr value='no'/>
<es value='no'/>
<ca value='no'/>
<ot value='no'/>
</leave-answer-space>
<question-type-order value='tf,mtf,mc,yn,nr,co,ma,sa,pr,es,ca,ot'/>
<section-page-break value='no'/>
<bi-display-mode value='mc'/>
<tf-show-choices value='no'/>
<mc-conserve-paper value='no'/>
<mc-choice-sequence value='abcde'/>
<show-answer-lines value='no'/>
<question-numbering value='continuous'/>
<answer-style template='a.' style='none'/>
<number-style template='1.' style='none'/>
<max-question-id value='9'/>
<max-narrative-id value='0'/>
<max-group-id value='1'/>
<default-font target='title'>
<number>1</number>
<size>13</size>
<style>bold</style>
<text-rgb>#000000</text-rgb>
</default-font>
<default-font target='sectiontitle'>
<number>1</number>
<size>11</size>
<style>bold</style>
<text-rgb>#000000</text-rgb>
</default-font>
<default-font target='questionnumber'>
<number>1</number>
<size>11</size>
<text-rgb>#000000</text-rgb>
</default-font>
<default-font target='answerchoice'>
<number>1</number>
<size>11</size>
<text-rgb>#000000</text-rgb>
</default-font>
<default-font target='newquestiondefault'>
<number>1</number>
<size>11</size>
<text-rgb>#000000</text-rgb>
</default-font>
</preferences>
<test-header page='first'><para tabs='R10440'><b>Name: ________________________ Class: ___________________ Date: __________ ID: <field field-type='version'/></b></para></test-header>
<test-header page='subsequent'><para tabs='R10440'><b>Name: ________________________ ID: <field field-type='version'/></b></para></test-header>
<test-footer page='first'><para justify='center'><field field-type='pageNumber'/>
</para></test-footer>
<test-footer page='subsequent'><para justify='center'><field field-type='pageNumber'/>
</para></test-footer>
<instruction type='tf'><b>True/False</b><font size='10'>
</font><i>Indicate whether the sentence or statement is true or false.</i></instruction>
<instruction type='mtf'><b>Modified True/False</b><font size='10'>
</font><i>Indicate whether the sentence or statement is true or false. If false, change the identified word or phrase to make the sentence or statement true.</i></instruction>
<instruction type='mc'><b>Multiple Choice</b><font size='10'>
</font><i>Identify the letter of the choice that best completes the statement or answers the question.</i></instruction>
<instruction type='yn'><b>Yes/No</b><font size='10'>
</font><i>Indicate whether you agree with the sentence or statement.</i></instruction>
<instruction type='nr'><b>Numeric Response</b></instruction>
<instruction type='co'><b>Completion</b><font size='10'>
</font><i>Complete each sentence or statement.</i></instruction>
<instruction type='ma'><b>Matching</b></instruction>
<instruction type='sa'><b>Short Answer</b></instruction>
<instruction type='pr'><b>Problem</b></instruction>
<instruction type='es'><b>Essay</b></instruction>
<instruction type='ca'><b>Case</b></instruction>
<instruction type='ot'><b>Other</b></instruction>
<question type='tf' question-id='1' bank-id='0'>
<text>This is a T/F question. Tim and Jean-Michael are great people.</text>
<rationale>Examview allows for this &#x201c;Rationale&#x201d; field</rationale>
<answer>T</answer>
</question>
<question type='mc' question-id='2' bank-id='0'>
<text>This is an example of a multiple choice question. This is only an ________</text>
<choices columns='2'>
<choice-a>example</choice-a>
<choice-b>the real thing</choice-b>
<choice-c>a true false question</choice-c>
<choice-d>none of these</choice-d>
</choices>
<answer>A</answer>
</question>
<question type='nr' question-id='3' bank-id='0'>
<text>This is a numeric response question. How much is 12 * 2?</text>
<answer>24</answer>
<info>
<answer-space>-1</answer-space>
</info>
</question>
<matching-group group-id='1' bank-id='0' name='Matching 1'>
<text>This is a matching question type.
</text>
<choices columns='2'>
<choice-a>Question 1</choice-a>
<choice-b>Question 2</choice-b>
<choice-c>Question 3</choice-c>
<choice-d>Question 4</choice-d>
</choices>
</matching-group>
<question type='ma' question-id='6' bank-id='0' group='Matching 1'>
<text>This is question 1.</text>
<answer>A</answer>
</question>
<question type='ma' question-id='7' bank-id='0' group='Matching 1'>
<text>This is question 2.</text>
<answer>B</answer>
</question>
<question type='ma' question-id='8' bank-id='0' group='Matching 1'>
<text>This is question 3.</text>
<answer>C</answer>
</question>
<question type='sa' question-id='5' bank-id='0'>
<text>This is a short answer question. This is a ___________ answer question.</text>
<answer>short</answer>
<info>
<answer-space>-1</answer-space>
</info>
</question>
<question type='es' question-id='4' bank-id='0'>
<text>This is an essay question. I am not sure if an answer is needed.</text>
<answer>This is the answer in Examview. I am curious to see how this shows in Moodle.</answer>
<info>
<answer-space>-1</answer-space>
</info>
</question>
</examview>

View file

@ -1,32 +0,0 @@
<?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_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 = 2021052500;
$plugin->requires = 2021052500;
$plugin->maturity = MATURITY_STABLE;

View file

@ -2,6 +2,11 @@ This files describes API changes for question import/export format plugins.
=== 4.0 ===
* The ExamView question format has been completely removed.
The last posts in http://forum.examview.com/index.php?
are from over 10 years ago and there are no moodle.org
discussions about Examview in the last 10 years.
* The WebCT question format has been completely removed (WebCT was acquired by Blackboard in 2006).

View file

@ -29,7 +29,7 @@
defined('MOODLE_INTERNAL') || die();
$version = 2021100600.00; // YYYYMMDD = weekly release date of this DEV branch.
$version = 2021100600.01; // YYYYMMDD = weekly release date of this DEV branch.
// RR = release increments - 00 in DEV branches.
// .XX = incremental changes.
$release = '4.0dev+ (Build: 20211006)'; // Human-friendly version name