Skip to content
Snippets Groups Projects
Commit 8331a05a authored by David Pesce's avatar David Pesce
Browse files

fixes for submitted/reviewed tests

parent 804167c6
No related branches found
No related tags found
No related merge requests found
......@@ -40,30 +40,11 @@ class attempt_reviewed_test extends event_test {
);
}
protected function construct_attempt() {
return array_merge(parent::construct_attempt(), [
'attempt_score_raw' => 1,
'attempt_score_min' => 0,
'attempt_score_max' => 5,
'attempt_score_scaled' => 0.2,
'attempt_success' => false,
'attempt_completed' => true,
'attempt_duration' => 'P01DT',
]);
}
protected function assert_output($input, $output) {
parent::assert_output($input, $output);
$this->assert_verb('http://adlnet.gov/expapi/verbs/reviewed', 'reviewed', $output['verb']);
$this->assert_attempt($input, $output['context']['contextActivities']['grouping'][2]);
$this->assert_verb('http://activitystrea.ms/schema/1.0/start', 'started', $output['verb']);
$this->assert_object('module', $input, $output['context']['contextActivities']['grouping'][2]);
$this->assert_object('course', $input, $output['context']['contextActivities']['grouping'][1]);
$this->assert_object('module', $input, $output['object']);
$this->assertEquals($input['attempt_score_raw'], $output['result']['score']['raw']);
$this->assertEquals($input['attempt_score_min'], $output['result']['score']['min']);
$this->assertEquals($input['attempt_score_max'], $output['result']['score']['max']);
$this->assertEquals($input['attempt_score_scaled'], $output['result']['score']['scaled']);
$this->assertEquals($input['attempt_success'], $output['result']['success']);
$this->assertEquals($input['attempt_completed'], $output['result']['completion']);
$this->assertEquals($input['attempt_duration'], $output['result']['duration']);
$this->assert_attempt($input, $output['object']);
}
}
......@@ -54,7 +54,7 @@ class attempt_submitted_test extends event_test {
protected function assert_output($input, $output) {
parent::assert_output($input, $output);
$this->assert_verb('http://adlnet.gov/expapi/verbs/submitted', 'submitted', $output['verb']);
$this->assert_verb('http://adlnet.gov/expapi/verbs/completed', 'completed', $output['verb']);
$this->assert_attempt($input, $output['context']['contextActivities']['grouping'][2]);
$this->assert_object('course', $input, $output['context']['contextActivities']['grouping'][1]);
$this->assert_object('module', $input, $output['object']);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment