| Línea 32... |
Línea 32... |
| 32 |
* @package qbehaviour_deferredcbm
|
32 |
* @package qbehaviour_deferredcbm
|
| 33 |
* @copyright 2009 The Open University
|
33 |
* @copyright 2009 The Open University
|
| 34 |
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
34 |
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
| 35 |
*/
|
35 |
*/
|
| 36 |
class walkthrough_test extends \qbehaviour_walkthrough_test_base {
|
36 |
class walkthrough_test extends \qbehaviour_walkthrough_test_base {
|
| 37 |
public function test_deferred_cbm_truefalse_high_certainty() {
|
37 |
public function test_deferred_cbm_truefalse_high_certainty(): void {
|
| Línea 38... |
Línea 38... |
| 38 |
|
38 |
|
| 39 |
// Create a true-false question with correct answer true.
|
39 |
// Create a true-false question with correct answer true.
|
| 40 |
$tf = \test_question_maker::make_question('truefalse', 'true');
|
40 |
$tf = \test_question_maker::make_question('truefalse', 'true');
|
| Línea 109... |
Línea 109... |
| 109 |
$this->check_current_mark(5);
|
109 |
$this->check_current_mark(5);
|
| 110 |
$autogradedstep = $this->get_step($this->get_step_count() - 2);
|
110 |
$autogradedstep = $this->get_step($this->get_step_count() - 2);
|
| 111 |
$this->assertEqualsWithDelta(-6, $autogradedstep->get_fraction(), 0.0000001);
|
111 |
$this->assertEqualsWithDelta(-6, $autogradedstep->get_fraction(), 0.0000001);
|
| 112 |
}
|
112 |
}
|
| Línea 113... |
Línea 113... |
| 113 |
|
113 |
|
| Línea 114... |
Línea 114... |
| 114 |
public function test_deferred_cbm_truefalse_low_certainty() {
|
114 |
public function test_deferred_cbm_truefalse_low_certainty(): void {
|
| 115 |
|
115 |
|
| 116 |
// Create a true-false question with correct answer true.
|
116 |
// Create a true-false question with correct answer true.
|
| Línea 148... |
Línea 148... |
| 148 |
$this->assertEquals(get_string('true', 'qtype_truefalse') . ' [' .
|
148 |
$this->assertEquals(get_string('true', 'qtype_truefalse') . ' [' .
|
| 149 |
question_cbm::get_short_string(question_cbm::LOW) . ']',
|
149 |
question_cbm::get_short_string(question_cbm::LOW) . ']',
|
| 150 |
$this->quba->get_response_summary($this->slot));
|
150 |
$this->quba->get_response_summary($this->slot));
|
| 151 |
}
|
151 |
}
|
| Línea 152... |
Línea 152... |
| 152 |
|
152 |
|
| Línea 153... |
Línea 153... |
| 153 |
public function test_deferred_cbm_truefalse_default_certainty() {
|
153 |
public function test_deferred_cbm_truefalse_default_certainty(): void {
|
| 154 |
|
154 |
|
| 155 |
// Create a true-false question with correct answer true.
|
155 |
// Create a true-false question with correct answer true.
|
| Línea 181... |
Línea 181... |
| 181 |
$qa->get_last_behaviour_var('_assumedcertainty'))), '/') . '/'));
|
181 |
$qa->get_last_behaviour_var('_assumedcertainty'))), '/') . '/'));
|
| 182 |
$this->assertEquals(get_string('true', 'qtype_truefalse'),
|
182 |
$this->assertEquals(get_string('true', 'qtype_truefalse'),
|
| 183 |
$this->quba->get_response_summary($this->slot));
|
183 |
$this->quba->get_response_summary($this->slot));
|
| 184 |
}
|
184 |
}
|
| Línea 185... |
Línea 185... |
| 185 |
|
185 |
|
| Línea 186... |
Línea 186... |
| 186 |
public function test_deferredcbm_resume_multichoice_single() {
|
186 |
public function test_deferredcbm_resume_multichoice_single(): void {
|
| 187 |
|
187 |
|
| Línea 188... |
Línea 188... |
| 188 |
// Create a multiple-choice question.
|
188 |
// Create a multiple-choice question.
|
| Línea 248... |
Línea 248... |
| 248 |
$this->assertMatchesRegularExpression(
|
248 |
$this->assertMatchesRegularExpression(
|
| 249 |
'/(A) \[' . preg_quote(question_cbm::get_short_string(question_cbm::HIGH), '/') . '\]/',
|
249 |
'/(A) \[' . preg_quote(question_cbm::get_short_string(question_cbm::HIGH), '/') . '\]/',
|
| 250 |
$this->quba->get_response_summary($this->slot));
|
250 |
$this->quba->get_response_summary($this->slot));
|
| 251 |
}
|
251 |
}
|
| Línea 252... |
Línea 252... |
| 252 |
|
252 |
|
| Línea 253... |
Línea 253... |
| 253 |
public function test_deferred_cbm_truefalse_no_certainty_feedback_when_not_answered() {
|
253 |
public function test_deferred_cbm_truefalse_no_certainty_feedback_when_not_answered(): void {
|
| 254 |
|
254 |
|
| 255 |
// Create a true-false question with correct answer true.
|
255 |
// Create a true-false question with correct answer true.
|