This repository has been archived by the owner on Apr 24, 2022. It is now read-only.
forked from TEAMMATES/teammates
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[TEAMMATES#11585] Remove unnecessary data read (TEAMMATES#11646)
- Loading branch information
Showing
9 changed files
with
138 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -77,7 +77,9 @@ public void testDeleteFeedbackQuestions_byCourseIdAndSessionName_shouldDeleteQue | |
|
||
@Test | ||
public void allTests() throws Exception { | ||
testHasFeedbackQuestionsForInstructor(); | ||
testGetFeedbackQuestionsForInstructor(); | ||
testHasFeedbackQuestionsForStudents(); | ||
testGetFeedbackQuestionsForStudents(); | ||
testAddQuestion(); | ||
} | ||
|
@@ -905,6 +907,20 @@ public void testBuildCompleteGiverRecipientMap_teamQuestion_shouldBuildMapCorrec | |
assertTrue(completeGiverRecipientMap.get("Team 1.2").contains("Team 1.1</td></div>'\"")); | ||
} | ||
|
||
private void testHasFeedbackQuestionsForInstructor() { | ||
______TS("Valid session valid instructor should have questions"); | ||
assertTrue(fqLogic.hasFeedbackQuestionsForInstructors( | ||
"First feedback session", "idOfTypicalCourse1", "[email protected]")); | ||
|
||
______TS("Valid session without questions for instructor should return false"); | ||
assertFalse(fqLogic.hasFeedbackQuestionsForInstructors( | ||
"session without instructor questions", "idOfTestingSanitizationCourse", "[email protected]")); | ||
|
||
______TS("Invalid session should not have questions"); | ||
assertFalse(fqLogic.hasFeedbackQuestionsForInstructors( | ||
"Zeroth feedback session", "idOfTypicalCourse1", "[email protected]")); | ||
} | ||
|
||
private void testGetFeedbackQuestionsForInstructor() { | ||
List<FeedbackQuestionAttributes> expectedQuestions; | ||
List<FeedbackQuestionAttributes> actualQuestions; | ||
|
@@ -963,6 +979,20 @@ private void testGetFeedbackQuestionsForInstructor() { | |
assertEquals(actualQuestions, expectedQuestions); | ||
} | ||
|
||
private void testHasFeedbackQuestionsForStudents() { | ||
______TS("Valid session should have questions"); | ||
assertTrue(fqLogic.hasFeedbackQuestionsForStudents( | ||
"First feedback session", "idOfTypicalCourse1")); | ||
|
||
______TS("Valid session without questions for students should return false"); | ||
assertFalse(fqLogic.hasFeedbackQuestionsForStudents( | ||
"session without student questions", "idOfArchivedCourse")); | ||
|
||
______TS("Invalid session should not have questions"); | ||
assertFalse(fqLogic.hasFeedbackQuestionsForStudents( | ||
"Zeroth feedback session", "idOfTypicalCourse1")); | ||
} | ||
|
||
private void testGetFeedbackQuestionsForStudents() { | ||
List<FeedbackQuestionAttributes> expectedQuestions; | ||
List<FeedbackQuestionAttributes> actualQuestions; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -903,6 +903,27 @@ | |
"gracePeriod": 5, | ||
"sentOpeningSoonEmail": true, | ||
"sentOpenEmail": true, | ||
"sentClosingEmail": true, | ||
"sentClosedEmail": true, | ||
"sentPublishedEmail": true, | ||
"isOpeningEmailEnabled": true, | ||
"isClosingEmailEnabled": true, | ||
"isPublishedEmailEnabled": true | ||
}, | ||
"archiveCourse.session2": { | ||
"feedbackSessionName": "session without instructor questions", | ||
"courseId": "idOfArchivedCourse", | ||
"creatorEmail": "[email protected]", | ||
"instructions": "Please please fill in the following questions.", | ||
"createdTime": "2013-01-20T23:00:00Z", | ||
"startTime": "2013-02-20T23:00:00Z", | ||
"endTime": "2026-04-28T23:00:00Z", | ||
"sessionVisibleFromTime": "2013-02-20T23:00:00Z", | ||
"resultsVisibleFromTime": "2026-04-29T23:00:00Z", | ||
"timeZone": "Africa/Johannesburg", | ||
"gracePeriod": 5, | ||
"sentOpeningSoonEmail": true, | ||
"sentOpenEmail": true, | ||
"sentClosingEmail": false, | ||
"sentClosedEmail": false, | ||
"sentPublishedEmail": false, | ||
|
@@ -1356,6 +1377,27 @@ | |
"RECEIVER" | ||
] | ||
}, | ||
"qn1InSession2InArchivedCourse": { | ||
"feedbackSessionName": "session without instructor questions", | ||
"courseId": "idOfArchivedCourse", | ||
"questionDetails": { | ||
"questionType": "TEXT", | ||
"questionText": "Give feedback to each other" | ||
}, | ||
"questionNumber": 1, | ||
"giverType": "STUDENTS", | ||
"recipientType": "STUDENTS", | ||
"numberOfEntitiesToGiveFeedbackTo": 4, | ||
"showResponsesTo": [ | ||
"RECEIVER" | ||
], | ||
"showGiverNameTo": [ | ||
"RECEIVER" | ||
], | ||
"showRecipientNameTo": [ | ||
"RECEIVER" | ||
] | ||
}, | ||
"qn1InSession1InCourse2": { | ||
"feedbackSessionName": "Instructor feedback session", | ||
"courseId": "idOfTypicalCourse2", | ||
|