Skip to content

Commit

Permalink
Merge branch 'master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
TalesRG authored Nov 28, 2023
2 parents da1a2a3 + a9292bb commit 164a149
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,8 @@ private boolean isRubricResponseEqual(WebElement responseField, FeedbackResponse
FeedbackRubricResponseDetails responseDetails = (FeedbackRubricResponseDetails) response.getResponseDetailsCopy();
List<Integer> answers = responseDetails.getAnswer();
for (int i = 0; i < answers.size(); i++) {
WebElement rubricRow = responseField.findElements(By.cssSelector("#rubric-answers tr")).get(i);
WebElement rubricTableBody = responseField.findElement(By.className("rubric-answers"));
WebElement rubricRow = rubricTableBody.findElements(By.cssSelector("tr")).get(i);
WebElement rubricCell = rubricRow.findElements(By.tagName("td")).get(answers.get(i) + 1);
if (rubricCell.findElements(By.className("fa-check")).size() == 0) {
return false;
Expand Down
11 changes: 7 additions & 4 deletions src/main/java/teammates/logic/core/FeedbackSessionsLogic.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import java.time.Instant;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.function.Consumer;
Expand Down Expand Up @@ -632,15 +633,17 @@ private void updateFeedbackSessionsDeadlinesForUser(String courseId, String emai
if (!instructorDeadlines.containsKey(emailAddress)) {
return;
}
deadlinesUpdater.accept(instructorDeadlines);
updateOptionsBuilder.withInstructorDeadlines(instructorDeadlines);
Map<String, Instant> newInstructorDeadlines = new HashMap<>(instructorDeadlines);
deadlinesUpdater.accept(newInstructorDeadlines);
updateOptionsBuilder.withInstructorDeadlines(newInstructorDeadlines);
} else {
Map<String, Instant> studentDeadlines = feedbackSession.getStudentDeadlines();
if (!studentDeadlines.containsKey(emailAddress)) {
return;
}
deadlinesUpdater.accept(studentDeadlines);
updateOptionsBuilder.withStudentDeadlines(studentDeadlines);
Map<String, Instant> newStudentDeadlines = new HashMap<>(studentDeadlines);
deadlinesUpdater.accept(newStudentDeadlines);
updateOptionsBuilder.withStudentDeadlines(newStudentDeadlines);
}
try {
fsDb.updateFeedbackSession(updateOptionsBuilder.build());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -785,6 +785,9 @@ public void testUpdateFeedbackSessionsStudentDeadlinesWithNewEmail() {

fsLogic.updateFeedbackSessionsStudentDeadlinesWithNewEmail(courseId, oldEmailAddress, newEmailAddress);

// Clear the Objectify cache to fetch the latest FeedbackSessions from the db
clearObjectifyCache();

assertTrue(fsLogic.getFeedbackSessionsForCourse(courseId)
.stream()
.noneMatch(feedbackSessionAttributes -> feedbackSessionAttributes.getStudentDeadlines()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -178,4 +178,8 @@ protected boolean doPutDocuments(DataBundle dataBundle) {
}
}

protected void clearObjectifyCache() {
ObjectifyService.ofy().clear();
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<th class="text-center" *ngFor="let choice of questionDetails.rubricChoices">{{ choice }}</th>
</tr>
</thead>
<tbody id="rubric-answers">
<tbody class="rubric-answers">
<tr *ngFor="let answer of answers; let i = index">
<td>{{ questionDetails.rubricSubQuestions[i] }}</td>
<td class="text-center" *ngFor="let choice of questionDetails.rubricChoices">
Expand Down

0 comments on commit 164a149

Please sign in to comment.