diff --git a/src/e2e/java/teammates/e2e/pageobjects/FeedbackResultsPage.java b/src/e2e/java/teammates/e2e/pageobjects/FeedbackResultsPage.java index 6c4cca5d133..07c75951cb5 100644 --- a/src/e2e/java/teammates/e2e/pageobjects/FeedbackResultsPage.java +++ b/src/e2e/java/teammates/e2e/pageobjects/FeedbackResultsPage.java @@ -251,7 +251,7 @@ private void verifyAnonymousResponseView(FeedbackQuestionAttributes question, List expectedResponses, boolean isGiverVisible) { List anonymousViews = getAllResponseViews(question.getQuestionNumber()).stream() - .filter(v -> isAnonymous(v.findElement(By.id("response-recipient")).getText())) + .filter(v -> isAnonymous(v.findElement(By.className("response-recipient")).getText())) .collect(Collectors.toList()); if (anonymousViews.isEmpty()) { fail("No anonymous views found"); @@ -309,7 +309,7 @@ private boolean isAnonymous(String identifier) { private boolean isAnyAnonymousResponseEqual(FeedbackQuestionAttributes question, WebElement responseView, FeedbackResponseAttributes response) { - List giverNames = responseView.findElements(By.id("response-giver")); + List giverNames = responseView.findElements(By.className("response-giver")); List responseFields = getAllResponseFields(responseView); for (int i = 0; i < giverNames.size(); i++) { if (isAnonymous(giverNames.get(i).getText()) && isResponseEqual(question, responseFields.get(i), response)) { @@ -466,21 +466,15 @@ private String getAdditionalInfo(int questionNum) { } private WebElement getGivenResponseField(int questionNum, String receiver) { - int recipientIndex = getGivenRecipientIndex(questionNum, receiver); - return getQuestionResponsesSection(questionNum) - .findElements(By.cssSelector("#given-responses tm-single-response")) - .get(recipientIndex); - } - - private int getGivenRecipientIndex(int questionNum, String recipient) { - List recipients = getQuestionResponsesSection(questionNum) - .findElements(By.cssSelector("#given-responses #response-recipient")); + WebElement questionResponsesSection = getQuestionResponsesSection(questionNum); + WebElement givenResponses = questionResponsesSection.findElement(By.className("given-responses")); + List recipients = givenResponses.findElements(By.className("response-recipient")); for (int i = 0; i < recipients.size(); i++) { - if (recipients.get(i).getText().split("To: ")[1].equals(recipient)) { - return i; + if (recipients.get(i).getText().split("To: ")[1].equals(receiver)) { + return givenResponses.findElements(By.tagName("tm-single-response")).get(i); } } - throw new AssertionError("Recipient not found: " + recipient); + throw new AssertionError("Recipient not found: " + receiver); } private String getAdditionalInfoString(FeedbackQuestionAttributes question) { @@ -584,7 +578,7 @@ private boolean isCommentByResponseGiver(WebElement commentField) { } private String getCommentGiver(WebElement commentField) { - String commentGiverDescription = commentField.findElement(By.id("comment-giver-name")).getText(); + String commentGiverDescription = commentField.findElement(By.className("comment-giver-name")).getText(); return commentGiverDescription.split(" commented")[0]; } @@ -608,7 +602,7 @@ private WebElement getCommentField(int questionNum, String commentString) { } private int getGiverIndex(WebElement response, String giver) { - List givers = response.findElements(By.id("response-giver")); + List givers = response.findElements(By.className("response-giver")); for (int i = 0; i < givers.size(); i++) { if (givers.get(i).getText().contains(giver)) { return i; @@ -618,7 +612,8 @@ private int getGiverIndex(WebElement response, String giver) { } private int getRecipientIndex(int questionNum, String recipient) { - List recipients = getQuestionResponsesSection(questionNum).findElements(By.id("response-recipient")); + List recipients = + getQuestionResponsesSection(questionNum).findElements(By.className("response-recipient")); for (int i = 0; i < recipients.size(); i++) { if (recipients.get(i).getText().split("To: ")[1].equals(recipient)) { return i; diff --git a/src/e2e/java/teammates/e2e/pageobjects/InstructorFeedbackResultsPage.java b/src/e2e/java/teammates/e2e/pageobjects/InstructorFeedbackResultsPage.java index fd0ebcb7748..e7210e7ae0b 100644 --- a/src/e2e/java/teammates/e2e/pageobjects/InstructorFeedbackResultsPage.java +++ b/src/e2e/java/teammates/e2e/pageobjects/InstructorFeedbackResultsPage.java @@ -1019,7 +1019,7 @@ private WebElement getTeamStats(WebElement parentPanel, int qnNum) { } private String getCommentGiver(WebElement commentField) { - String commentGiverDescription = commentField.findElement(By.id("comment-giver-name")).getText(); + String commentGiverDescription = commentField.findElement(By.className("comment-giver-name")).getText(); return commentGiverDescription.split(" commented")[0]; } diff --git a/src/web/app/components/comment-box/comment-row/comment-row.component.html b/src/web/app/components/comment-box/comment-row/comment-row.component.html index 260f9821f60..c36141f14a1 100755 --- a/src/web/app/components/comment-box/comment-row/comment-row.component.html +++ b/src/web/app/components/comment-box/comment-row/comment-row.component.html @@ -20,7 +20,7 @@ Comment by response giver. - {{ model.commentGiverName ? model.commentGiverName : model.originalComment.commentGiver }} commented at + {{ model.commentGiverName ? model.commentGiverName : model.originalComment.commentGiver }} commented at {{ model.originalComment.createdAt | formatDateBrief: model.timezone! }} diff --git a/src/web/app/components/question-response-panel/__snapshots__/question-response-panel.component.spec.ts.snap b/src/web/app/components/question-response-panel/__snapshots__/question-response-panel.component.spec.ts.snap index 3ce633dd2d2..ce5464cade8 100644 --- a/src/web/app/components/question-response-panel/__snapshots__/question-response-panel.component.spec.ts.snap +++ b/src/web/app/components/question-response-panel/__snapshots__/question-response-panel.component.spec.ts.snap @@ -59,8 +59,7 @@ exports[`QuestionResponsePanelComponent should snap with feedback session with q Responses are not visible to you.
Your own responses (to others): @@ -74,7 +73,7 @@ exports[`QuestionResponsePanelComponent should snap with feedback session with q class="card-header bg-info" > To: @@ -92,7 +91,7 @@ exports[`QuestionResponsePanelComponent should snap with feedback session with q From: @@ -164,8 +163,7 @@ exports[`QuestionResponsePanelComponent should snap with feedback session with q Responses are not visible to you.
Your own responses (to others): @@ -179,7 +177,7 @@ exports[`QuestionResponsePanelComponent should snap with feedback session with q class="card-header bg-info" > To: @@ -197,7 +195,7 @@ exports[`QuestionResponsePanelComponent should snap with feedback session with q From: @@ -226,7 +224,7 @@ exports[`QuestionResponsePanelComponent should snap with feedback session with q class="card-header bg-info" > To: @@ -244,7 +242,7 @@ exports[`QuestionResponsePanelComponent should snap with feedback session with q From: @@ -316,8 +314,7 @@ exports[`QuestionResponsePanelComponent should snap with feedback session with q Responses are not visible to you.
Your own responses (to others): @@ -331,7 +328,7 @@ exports[`QuestionResponsePanelComponent should snap with feedback session with q class="card-header bg-info" > To: @@ -349,7 +346,7 @@ exports[`QuestionResponsePanelComponent should snap with feedback session with q From: @@ -392,7 +389,7 @@ exports[`QuestionResponsePanelComponent should snap with feedback session with q class="text-secondary" > comment-giver-1 commented at @@ -496,8 +493,7 @@ exports[`QuestionResponsePanelComponent should snap with feedback session with q Responses are not visible to you.
Your own responses (to others): @@ -511,7 +507,7 @@ exports[`QuestionResponsePanelComponent should snap with feedback session with q class="card-header bg-info" > To: @@ -529,7 +525,7 @@ exports[`QuestionResponsePanelComponent should snap with feedback session with q From: @@ -558,7 +554,7 @@ exports[`QuestionResponsePanelComponent should snap with feedback session with q class="card-header bg-info" > To: @@ -576,7 +572,7 @@ exports[`QuestionResponsePanelComponent should snap with feedback session with q From: @@ -605,7 +601,7 @@ exports[`QuestionResponsePanelComponent should snap with feedback session with q class="card-header bg-info" > To: @@ -623,7 +619,7 @@ exports[`QuestionResponsePanelComponent should snap with feedback session with q From: @@ -690,8 +686,7 @@ exports[`QuestionResponsePanelComponent should snap with feedback session with q Responses are not visible to you.
Your own responses (to others): @@ -705,7 +700,7 @@ exports[`QuestionResponsePanelComponent should snap with feedback session with q class="card-header bg-info" > To: @@ -723,7 +718,7 @@ exports[`QuestionResponsePanelComponent should snap with feedback session with q From: @@ -867,8 +862,7 @@ exports[`QuestionResponsePanelComponent should snap with questions and responses Responses are not visible to you.
Your own responses (to others): @@ -882,7 +876,7 @@ exports[`QuestionResponsePanelComponent should snap with questions and responses class="card-header bg-info" > To: @@ -900,7 +894,7 @@ exports[`QuestionResponsePanelComponent should snap with questions and responses From: @@ -943,7 +937,7 @@ exports[`QuestionResponsePanelComponent should snap with questions and responses class="text-secondary" > comment-giver-1 commented at @@ -1032,8 +1026,7 @@ exports[`QuestionResponsePanelComponent should snap with questions and responses
Your own responses (to others): @@ -1047,7 +1040,7 @@ exports[`QuestionResponsePanelComponent should snap with questions and responses class="card-header bg-info" > To: @@ -1065,7 +1058,7 @@ exports[`QuestionResponsePanelComponent should snap with questions and responses From: diff --git a/src/web/app/components/question-response-panel/question-response-panel.component.html b/src/web/app/components/question-response-panel/question-response-panel.component.html index 7cb0b48faba..7811dd1dd86 100644 --- a/src/web/app/components/question-response-panel/question-response-panel.component.html +++ b/src/web/app/components/question-response-panel/question-response-panel.component.html @@ -35,7 +35,7 @@ Other responses (to you): Responses are not visible to you.
-
+
Your own responses (to others):
diff --git a/src/web/app/components/question-responses/student-view-responses/student-view-responses.component.html b/src/web/app/components/question-responses/student-view-responses/student-view-responses.component.html index 4aea056e80d..1c5176d2020 100644 --- a/src/web/app/components/question-responses/student-view-responses/student-view-responses.component.html +++ b/src/web/app/components/question-responses/student-view-responses/student-view-responses.component.html @@ -1,13 +1,13 @@
- To: {{ recipient }} + To: {{ recipient }}
- diff --git a/src/web/app/components/question-types/question-response/rubric-question-response.component.html b/src/web/app/components/question-types/question-response/rubric-question-response.component.html index 5fc1e19d15a..1ffca17e966 100644 --- a/src/web/app/components/question-types/question-response/rubric-question-response.component.html +++ b/src/web/app/components/question-types/question-response/rubric-question-response.component.html @@ -10,7 +10,9 @@
+ From: {{ response.giver }}
{{ questionDetails.rubricSubQuestions[i] }} - + + +