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); }
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); }
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); }
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)); }