mirror of
https://github.com/moodle/moodle.git
synced 2025-03-22 08:30:04 +01:00
MDL-49075 mod_assign: Add assertions to marking workflow unit test
Make sure grades aren't pushed to gradebook for marking workflow states other than 'released'.
This commit is contained in:
parent
251d85c013
commit
5047b0ea8f
@ -1787,6 +1787,10 @@ class mod_assign_locallib_testcase extends mod_assign_base_testcase {
|
||||
$output = $assign->view_student_summary($this->students[0], true);
|
||||
$this->assertEquals(false, strpos($output, '50.0'));
|
||||
|
||||
// Make sure the grade isn't pushed to the gradebook.
|
||||
$grades = $assign->get_user_grades_for_gradebook($this->students[0]->id);
|
||||
$this->assertEmpty($grades);
|
||||
|
||||
// Mark the submission and set to inmarking.
|
||||
$this->setUser($this->teachers[0]);
|
||||
$data = new stdClass();
|
||||
@ -1799,6 +1803,10 @@ class mod_assign_locallib_testcase extends mod_assign_base_testcase {
|
||||
$output = $assign->view_student_summary($this->students[0], true);
|
||||
$this->assertEquals(false, strpos($output, '50.0'));
|
||||
|
||||
// Make sure the grade isn't pushed to the gradebook.
|
||||
$grades = $assign->get_user_grades_for_gradebook($this->students[0]->id);
|
||||
$this->assertEmpty($grades);
|
||||
|
||||
// Mark the submission and set to readyforreview.
|
||||
$this->setUser($this->teachers[0]);
|
||||
$data = new stdClass();
|
||||
@ -1811,6 +1819,10 @@ class mod_assign_locallib_testcase extends mod_assign_base_testcase {
|
||||
$output = $assign->view_student_summary($this->students[0], true);
|
||||
$this->assertEquals(false, strpos($output, '50.0'));
|
||||
|
||||
// Make sure the grade isn't pushed to the gradebook.
|
||||
$grades = $assign->get_user_grades_for_gradebook($this->students[0]->id);
|
||||
$this->assertEmpty($grades);
|
||||
|
||||
// Mark the submission and set to inreview.
|
||||
$this->setUser($this->teachers[0]);
|
||||
$data = new stdClass();
|
||||
@ -1823,6 +1835,10 @@ class mod_assign_locallib_testcase extends mod_assign_base_testcase {
|
||||
$output = $assign->view_student_summary($this->students[0], true);
|
||||
$this->assertEquals(false, strpos($output, '50.0'));
|
||||
|
||||
// Make sure the grade isn't pushed to the gradebook.
|
||||
$grades = $assign->get_user_grades_for_gradebook($this->students[0]->id);
|
||||
$this->assertEmpty($grades);
|
||||
|
||||
// Mark the submission and set to readyforrelease.
|
||||
$this->setUser($this->teachers[0]);
|
||||
$data = new stdClass();
|
||||
@ -1835,6 +1851,10 @@ class mod_assign_locallib_testcase extends mod_assign_base_testcase {
|
||||
$output = $assign->view_student_summary($this->students[0], true);
|
||||
$this->assertEquals(false, strpos($output, '50.0'));
|
||||
|
||||
// Make sure the grade isn't pushed to the gradebook.
|
||||
$grades = $assign->get_user_grades_for_gradebook($this->students[0]->id);
|
||||
$this->assertEmpty($grades);
|
||||
|
||||
// Mark the submission and set to released.
|
||||
$this->setUser($this->teachers[0]);
|
||||
$data = new stdClass();
|
||||
@ -1846,6 +1866,10 @@ class mod_assign_locallib_testcase extends mod_assign_base_testcase {
|
||||
$this->setUser($this->students[0]);
|
||||
$output = $assign->view_student_summary($this->students[0], true);
|
||||
$this->assertNotEquals(false, strpos($output, '50.0'));
|
||||
|
||||
// Make sure the grade is pushed to the gradebook.
|
||||
$grades = $assign->get_user_grades_for_gradebook($this->students[0]->id);
|
||||
$this->assertEquals(50, (int)$grades[$this->students[0]->id]->rawgrade);
|
||||
}
|
||||
|
||||
public function test_markerallocation() {
|
||||
|
Loading…
x
Reference in New Issue
Block a user