Search in sources :

Example 6 with TeamEvalResult

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]);
}
Also used : FeedbackResponseAttributes(teammates.common.datatransfer.attributes.FeedbackResponseAttributes) TeamEvalResult(teammates.common.datatransfer.TeamEvalResult) StudentResultSummary(teammates.common.datatransfer.StudentResultSummary)

Example 7 with TeamEvalResult

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);
}
Also used : TeamEvalResult(teammates.common.datatransfer.TeamEvalResult)

Example 8 with TeamEvalResult

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());
}
Also used : TeamEvalResult(teammates.common.datatransfer.TeamEvalResult)

Aggregations

TeamEvalResult (teammates.common.datatransfer.TeamEvalResult)8 FeedbackResponseAttributes (teammates.common.datatransfer.attributes.FeedbackResponseAttributes)5 StudentResultSummary (teammates.common.datatransfer.StudentResultSummary)4 ArrayList (java.util.ArrayList)3 LinkedHashMap (java.util.LinkedHashMap)3 List (java.util.List)3 Map (java.util.Map)2 FeedbackParticipantType (teammates.common.datatransfer.FeedbackParticipantType)2