コード例 #1
0
  public void testForSingleMemberClassWithEmptyAssessment() throws Exception {
    // given
    Group group = createClass(1);
    Assessment a = createAssessment(group, 0, 0);

    // when
    AssessmentGradebook g = gradebookService.getForAssessment(a);

    // then
    BaseTestCase.assertEquals(0, g.getQuestionCount());
    BaseTestCase.assertEquals("averages", array(0), g.getAverages());
    assertResults(g, 0);
  }
コード例 #2
0
  public void testForEmptyClassWithAssessmentWithManyQuestionsAndReinforcements() throws Exception {
    // given
    Group group = createClass(0);
    Assessment a = createAssessment(group, 3, 7);

    // when
    AssessmentGradebook g = gradebookService.getForAssessment(a);

    // then
    BaseTestCase.assertEquals(3, g.getQuestionCount());
    BaseTestCase.assertEquals("averages", array(0, 0, 0, 0), g.getAverages());
    BaseTestCase.assertEquals(0, g.getResults().length);
  }
コード例 #3
0
  public void testForSingleMemberClassWithAssessmentWithAQuestionAndAReinforcementAndAResponse()
      throws Exception {
    // given
    Group group = createClass(1);
    Contact c = getContacts(group)[0];
    Assessment a = createAssessment(group, 1, 1);
    createResponse(c, a, 0, true);

    // when
    AssessmentGradebook g = gradebookService.getForAssessment(a);

    // then
    BaseTestCase.assertEquals(1, g.getQuestionCount());
    BaseTestCase.assertEquals("averages", array(100, 100), g.getAverages());
    assertResults(g, 0, 100);
  }
コード例 #4
0
  public void
      testForSingleMemberClassWithAssessmentWithManyQuestionsAndReinforcementsAndSomeResponses()
          throws Exception {
    // given
    Group group = createClass(1);
    Contact c = getContacts(group)[0];
    Assessment a = createAssessment(group, 3, 7);
    createResponse(c, a, 0, true);
    createResponse(c, a, 2, false);

    // when
    AssessmentGradebook g = gradebookService.getForAssessment(a);

    // then
    BaseTestCase.assertEquals(3, g.getQuestionCount());
    BaseTestCase.assertEquals("averages", array(100, 0, 0, 33), g.getAverages());
    assertResults(g, array(0, null, 1, 33));
  }