Merge branch 'MDL-28349_21' of git://github.com/timhunt/moodle into MOODLE_21_STABLE

This commit is contained in:
Eloy Lafuente (stronk7)
2011-08-17 15:40:00 +02:00
3 changed files with 64 additions and 18 deletions
+5 -4
View File
@@ -317,10 +317,11 @@ class qformat_gift extends qformat_default {
return $question;
case ESSAY:
$question->fraction = 0;
$question->feedback['text'] = '';
$question->feedback['format'] = $question->questiontextformat;
$question->feedback['files'] = array();
$question->responseformat = 'editor';
$question->responsefieldlines = 15;
$question->attachments = 0;
$question->graderinfo = array(
'text' => '', 'format' => FORMAT_HTML, 'files' => array());
return $question;
case MULTICHOICE:
@@ -0,0 +1,48 @@
// essay
::Q8:: How are you? {}
// question: 2 name: Moodle activities
::Moodle activities::[html]Match the <b>activity</b> to the description.{
=[html]An activity supporting asynchronous discussions. -> Forum
=[moodle]A teacher asks a question and specifies a choice of multiple responses. -> Choice
=[plain]A bank of record entries which participants can add to. -> Database
=[markdown]A collection of web pages that anyone can add to or edit. -> Wiki
= -> Chat
}
// multiple choice with specified feedback for right and wrong answers
::Q2:: What's between orange and green in the spectrum?
{
=yellow # right; good!
~red # [html]wrong, it's yellow
~[plain]blue # wrong, it's yellow
}
// multiple choice, multiple response with specified feedback for right and wrong answers
::colours:: What's between orange and green in the spectrum?
{
~%50%yellow # right; good!
~%-100%red # [html]wrong
~%50%off-beige # right; good!
~%-100%[plain]blue # wrong
}
// math range question
::Q5:: What is a number from 1 to 5? {#3:2~#Completely wrong}";
// question: 666 name: Shortanswer
::Shortanswer::Which is the best animal?{
=Frog#Good!
=%50%Cat#What is it with Moodlers and cats?
=%0%*#Completely wrong
}
// true/false
::Q1:: 42 is the Absolute Answer to everything.{
FALSE#42 is the Ultimate Answer.#You gave the right answer.}";
// name 0-11
::2-08 TSL::TSL is blablabla.{T}
// name 0-11
::2-08 TSL::TSL is blablabla.{TRUE}
@@ -62,11 +62,13 @@ class qformat_gift_test extends UnitTestCase {
'defaultmark' => 1,
'penalty' => 0.3333333,
'length' => 1,
'feedback' => array(
'responseformat' => 'editor',
'responsefieldlines' => 15,
'attachments' => 0,
'graderinfo' => array(
'text' => '',
'format' => FORMAT_MOODLE,
'files' => array(),
),
'format' => FORMAT_HTML,
'files' => array()),
);
$this->assert(new CheckSpecifiedFieldsExpectation($expectedq), $q);
@@ -85,16 +87,11 @@ class qformat_gift_test extends UnitTestCase {
'length' => 1,
'qtype' => 'essay',
'options' => (object) array(
'answers' => array(
123 => (object) array(
'id' => 123,
'answer' => 666,
'answerformat' => FORMAT_MOODLE,
'fraction' => 0,
'feedback' => '',
'feedbackformat' => FORMAT_MOODLE,
),
),
'responseformat' => 'editor',
'responsefieldlines' => 15,
'attachments' => 0,
'graderinfo' => '',
'graderinfoformat' => FORMAT_HTML,
),
);