Commit 769fd123 authored by Jamie Pratt's avatar Jamie Pratt
Browse files

MDL-47494 gapselect: Merge branch 'master' of git://github.com/timhunt/moodle-qtype_gapselect

parents a821983e f1f181f4
......@@ -286,7 +286,8 @@ abstract class qtype_gapselect_question_base extends question_graded_automatical
$choice = $this->choices[$group][$choiceno];
$parts[$place] = new question_classified_response(
$choiceno, html_to_text($choice->text, 0, false),
$this->get_right_choice_for($place) == $response[$fieldname]);
($this->get_right_choice_for($place) == $response[$fieldname])
/ count($this->places));
}
return $parts;
}
......
......@@ -299,7 +299,8 @@ abstract class qtype_gapselect_base extends question_type {
foreach ($question->choices[$group] as $i => $choice) {
$choices[$i] = new question_possible_response(
html_to_text($choice->text, 0, false),
$question->rightchoices[$place] == $i);
($question->rightchoices[$place] == $i)
/ count($question->places));
}
$choices[null] = question_possible_response::no_response();
......
......@@ -236,13 +236,13 @@ class qtype_gapselect_question_test extends UnitTestCase {
$gapselect->start_attempt(new question_attempt_step(), 1);
$this->assertEqual(array(
1 => new question_classified_response(1, 'quick', 1),
1 => new question_classified_response(1, 'quick', 1/3),
2 => new question_classified_response(2, 'dog', 0),
3 => new question_classified_response(1, 'lazy', 1),
3 => new question_classified_response(1, 'lazy', 1/3),
), $gapselect->classify_response(array('p1' => '1', 'p2' => '2', 'p3' => '1')));
$this->assertEqual(array(
1 => question_classified_response::no_response(),
2 => new question_classified_response(1, 'fox', 1),
2 => new question_classified_response(1, 'fox', 1/3),
3 => new question_classified_response(2, 'assiduous', 0),
), $gapselect->classify_response(array('p1' => '0', 'p2' => '1', 'p3' => '2')));
}
......
......@@ -129,15 +129,15 @@ class qtype_gapselect_test extends UnitTestCase {
$this->assertEqual(array(
1 => array(
1 => new question_possible_response('quick', 1),
1 => new question_possible_response('quick', 1/3),
2 => new question_possible_response('slow', 0),
null => question_possible_response::no_response()),
2 => array(
1 => new question_possible_response('fox', 1),
1 => new question_possible_response('fox', 1/3),
2 => new question_possible_response('dog', 0),
null => question_possible_response::no_response()),
3 => array(
1 => new question_possible_response('lazy', 1),
1 => new question_possible_response('lazy', 1/3),
2 => new question_possible_response('assiduous', 0),
null => question_possible_response::no_response()),
), $this->qtype->get_possible_responses($q));
......
......@@ -15,30 +15,6 @@
padding-bottom: 0.5em;
}
.que.gapselect .group1 {
background-color: #E4F1FA;
}
.que.gapselect .group2 {
background-color: #DCDCDC;
}
.que.gapselect .group3 {
background-color: #B0C4DE;
}
.que.gapselect .group4 {
background-color: #D8BFD8;
}
.que.gapselect .group5 {
background-color: #87CEFA;
}
.que.gapselect .group6 {
background-color: #DAA520;
}
.que.gapselect .group7 {
background-color: #FFD700;
}
.que.gapselect .group8 {
background-color: #F0E68C;
}
.que.sddl .control {
padding: 0.2em;
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment