use of teammates.common.datatransfer.TeamEvalResult in project teammates by TEAMMATES.
the class FeedbackContributionResponseDetails method getContributionQuestionResponseAnswerHtml.
private String getContributionQuestionResponseAnswerHtml(FeedbackResponseAttributes response, FeedbackQuestionAttributes question, FeedbackSessionResultsBundle feedbackSessionResultsBundle) {
Map<String, TeamEvalResult> teamResults = getContribQnTeamEvalResult(question, feedbackSessionResultsBundle);
// Need to get actual team name and giver/recipient emails here,
// only for getting the responseAnswer.
FeedbackResponseAttributes actualResponse = feedbackSessionResultsBundle.getActualResponse(response);
String giverTeamName = feedbackSessionResultsBundle.emailTeamNameTable.get(actualResponse.giver);
TeamEvalResult teamResult = teamResults.get(giverTeamName);
int giverIndex = teamResult.studentEmails.indexOf(actualResponse.giver);
int recipientIndex = teamResult.studentEmails.indexOf(actualResponse.recipient);
if (giverIndex == -1 || recipientIndex == -1) {
if (giverIndex == -1) {
log.severe("getContributionQuestionResponseAnswerHtml - giverIndex is -1\n" + "Cannot find giver: " + actualResponse.giver + "\n" + "CourseId: " + feedbackSessionResultsBundle.feedbackSession.getCourseId() + "\n" + "Session Name: " + feedbackSessionResultsBundle.feedbackSession.getFeedbackSessionName() + "\n" + "Response Id: " + actualResponse.getId());
}
if (recipientIndex == -1) {
log.severe("getContributionQuestionResponseAnswerHtml - recipientIndex is -1\n" + "Cannot find recipient: " + actualResponse.recipient + "\n" + "CourseId: " + feedbackSessionResultsBundle.feedbackSession.getCourseId() + "\n" + "Session Name: " + feedbackSessionResultsBundle.feedbackSession.getFeedbackSessionName() + "\n" + "Response Id: " + actualResponse.getId());
}
return "";
}
Map<String, StudentResultSummary> stats = getContribQnStudentResultSummary(question, feedbackSessionResultsBundle);
if (response.giver.equals(response.recipient)) {
StudentResultSummary studentResult = stats.get(response.giver);
String responseAnswerHtml = FeedbackContributionQuestionDetails.convertToEqualShareFormatHtml(studentResult.claimedToInstructor);
// For CONTRIB qns, We want to show PC if giver == recipient.
int pc = studentResult.perceivedToInstructor;
return responseAnswerHtml + FeedbackContributionQuestionDetails.getPerceivedContributionInEqualShareFormatHtml(pc);
}
return FeedbackContributionQuestionDetails.convertToEqualShareFormatHtml(teamResult.normalizedPeerContributionRatio[giverIndex][recipientIndex]);
}
use of teammates.common.datatransfer.TeamEvalResult in project teammates by TEAMMATES.
the class TeamEvalResultTest method verifyCalculatePoints.
// --------------------------------------------------------------------
private void verifyCalculatePoints(int[][] input, int[][] expected) {
TeamEvalResult t = new TeamEvalResult(input);
String actual = TeamEvalResult.pointsToString(t.normalizedClaimed) + "=======================" + System.lineSeparator() + TeamEvalResult.pointsToString(t.normalizedPeerContributionRatio) + "=======================" + System.lineSeparator() + Arrays.toString(t.normalizedAveragePerceived) + System.lineSeparator() + "=======================" + System.lineSeparator() + TeamEvalResult.pointsToString(t.denormalizedAveragePerceived);
actual = TeamEvalResult.replaceMagicNumbers(actual);
assertEquals(TeamEvalResult.pointsToString(expected), actual);
}
use of teammates.common.datatransfer.TeamEvalResult in project teammates by TEAMMATES.
the class TeamEvalResultCalculations method showCalculationSteps.
private static void showCalculationSteps(int[][] input) {
TeamEvalResult t = new TeamEvalResult(input);
System.out.println(t.toString());
}
Aggregations