Exemplo n.º 1
0
  @Test
  public void testAddNewOutcomeEvaluationForAssignmentFeedback() {
    Student student = studentDao.getStudentById(1000000L);
    AssignmentRecord r = student.getRecord().getSbgGrades().get(0);
    AssignmentFeedback f = r.getFeedback().get(0);
    Assert.assertEquals(2, f.getGrades().size());

    OutcomeEvaluation grade = new OutcomeEvaluation();
    Outcome o = new Outcome();
    o.setId(100002L); // Should be 'Pipeline outputs between various programs'
    grade.setOutcome(o);
    grade.setComment("Woops");
    f.getGrades().add(grade);

    studentDao.createOrUpdateStudent(student);
    Student student2 = studentDao.getStudentById(1000000L);
    AssignmentRecord r2 = student2.getRecord().getSbgGrades().get(0);
    AssignmentFeedback f2 = r2.getFeedback().get(0);
    Assert.assertEquals(3, f2.getGrades().size());
    OutcomeEvaluation eval = f2.getGrades().get(0);
    Assert.assertEquals("Woops", eval.getComment());
    Assert.assertEquals(
        "Pipeline outputs between various programs", eval.getOutcome().getDescription());
    Assert.assertEquals(Long.valueOf(100002L), eval.getOutcome().getId());
  }
Exemplo n.º 2
0
 /*
  * Tests for SBG Student records
  */
 @Test
 public void testCheckStudentSBGGradeRecord() {
   Student student = studentDao.getStudentById(1000000L);
   Assert.assertEquals(1, student.getRecord().getSbgGrades().size());
   AssignmentRecord r = student.getRecord().getSbgGrades().get(0);
   Assert.assertEquals(Long.valueOf(100001L), r.getId());
   Assert.assertEquals(1, r.getFeedback().size());
   AssignmentFeedback f = r.getFeedback().get(0);
   Assert.assertEquals(Long.valueOf(100001L), f.getAssignment().getId());
   Assert.assertEquals(2, f.getGrades().size());
   Assert.assertEquals("Good job!", f.getGrades().get(0).getComment());
   Assert.assertEquals("Needs work...", f.getGrades().get(1).getComment());
 }
Exemplo n.º 3
0
  @Test
  public void testUpdatingAssignmentFeedback() {
    Student student = studentDao.getStudentById(1000000L);
    Assert.assertEquals(1, student.getRecord().getSbgGrades().size());
    AssignmentRecord r = student.getRecord().getSbgGrades().get(0);
    AssignmentFeedback f = r.getFeedback().get(0);
    OutcomeEvaluation eval = f.getGrades().get(0);
    Assert.assertEquals("Good job!", eval.getComment());
    Assert.assertEquals(Long.valueOf(100001L), eval.getId());
    eval.setComment("Bad job!");

    studentDao.createOrUpdateStudent(student);
    Student student2 = studentDao.getStudentById(1000000L);
    AssignmentRecord r2 = student2.getRecord().getSbgGrades().get(0);
    AssignmentFeedback f2 = r2.getFeedback().get(0);
    OutcomeEvaluation eval2 = f2.getGrades().get(0);
    Assert.assertEquals("Bad job!", eval2.getComment());
    Assert.assertEquals(Long.valueOf(100001L), eval2.getId());
  }