Skip to content
This repository has been archived by the owner on Apr 8, 2022. It is now read-only.

Commit

Permalink
MDL-49075 mod_assign: Add assertions to marking workflow unit test
Browse files Browse the repository at this point in the history
Make sure grades aren't pushed to gradebook for marking workflow
states other than 'released'.
  • Loading branch information
tonyjbutler committed Feb 26, 2015
1 parent 251d85c commit 5047b0e
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions mod/assign/tests/locallib_test.php
Original file line number Diff line number Diff line change
Expand Up @@ -1787,6 +1787,10 @@ public function test_markingworkflow() {
$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();
Expand All @@ -1799,6 +1803,10 @@ public function test_markingworkflow() {
$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();
Expand All @@ -1811,6 +1819,10 @@ public function test_markingworkflow() {
$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();
Expand All @@ -1823,6 +1835,10 @@ public function test_markingworkflow() {
$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();
Expand All @@ -1835,6 +1851,10 @@ public function test_markingworkflow() {
$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();
Expand All @@ -1846,6 +1866,10 @@ public function test_markingworkflow() {
$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() {
Expand Down

0 comments on commit 5047b0e

Please sign in to comment.