public function test_all_ungraded()
 {
     $sixmonthsago = time() - YEARSECS / 2;
     $expected = 0;
     $this->setUser($this->teachers[0]);
     $actual = local::all_ungraded($this->teachers[0]->id, $sixmonthsago);
     $this->assertcount($expected, $actual);
     $this->setUser($this->teachers[1]);
     $actual = local::all_ungraded($this->teachers[1]->id, $sixmonthsago);
     $this->assertcount($expected, $actual);
     $this->setUser($this->editingteachers[0]);
     $actual = local::all_ungraded($this->editingteachers[0]->id, $sixmonthsago);
     $this->assertcount($expected, $actual);
     $this->create_one_ungraded_submission();
     $expected = 1;
     $this->setUser($this->teachers[0]);
     $actual = local::all_ungraded($this->teachers[0]->id, $sixmonthsago);
     $this->assertcount($expected, $actual);
     $this->setUser($this->teachers[1]);
     $actual = local::all_ungraded($this->teachers[1]->id, $sixmonthsago);
     $this->assertcount($expected, $actual);
     $this->setUser($this->editingteachers[0]);
     $actual = local::all_ungraded($this->editingteachers[0]->id, $sixmonthsago);
     $this->assertcount($expected, $actual);
     // Limit time to after the assignment is due
     $afterduedate = time() - WEEKSECS;
     $this->setUser($this->teachers[0]);
     $actual = local::all_ungraded($this->teachers[0]->id, $afterduedate);
     $this->assertcount(0, $actual);
     $this->setUser($this->teachers[1]);
     $actual = local::all_ungraded($this->teachers[1]->id, $afterduedate);
     $this->assertcount(0, $actual);
     $this->setUser($this->editingteachers[0]);
     $actual = local::all_ungraded($this->editingteachers[0]->id, $afterduedate);
     $this->assertcount(0, $actual);
 }
Esempio n. 2
0
 public function test_all_ungraded()
 {
     $sixmonthsago = time() - YEARSECS / 2;
     $expected = 0;
     $this->setUser($this->teachers[0]);
     $actual = local::all_ungraded($this->teachers[0]->id, $sixmonthsago);
     $this->assertcount($expected, $actual);
     $this->setUser($this->teachers[1]);
     $actual = local::all_ungraded($this->teachers[1]->id, $sixmonthsago);
     $this->assertcount($expected, $actual);
     $this->setUser($this->editingteachers[0]);
     $actual = local::all_ungraded($this->editingteachers[0]->id, $sixmonthsago);
     $this->assertcount($expected, $actual);
     $this->create_one_ungraded_submission();
     $expected = 1;
     $this->setUser($this->teachers[0]);
     $actual = local::all_ungraded($this->teachers[0]->id, $sixmonthsago);
     $this->assertcount($expected, $actual);
     $this->setUser($this->teachers[1]);
     $actual = local::all_ungraded($this->teachers[1]->id, $sixmonthsago);
     $this->assertcount($expected, $actual);
     $this->setUser($this->editingteachers[0]);
     $actual = local::all_ungraded($this->editingteachers[0]->id, $sixmonthsago);
     $this->assertcount($expected, $actual);
 }