Allow changes to the reflection to be made after it's been submitted #13
|
@ -14,4 +14,12 @@ public interface ReflectionService {
|
|||
* @return the reflection, or {@code null} if none has been submitted
|
||||
*/
|
||||
String getSubmittedReflection(Project project, User author);
|
||||
|
||||
/**
|
||||
* Used by the supervisor when the currently submitted reflection does not meet the minimum requirements.
|
||||
* This is done individually by author.
|
||||
*
|
||||
* @param author the author whose reflection does not meet the minimum requirements.
|
||||
*/
|
||||
void requestNewReflection(Project project, User author);
|
||||
}
|
||||
|
|
|
@ -45,4 +45,9 @@ class ReflectionServiceImpl implements ReflectionService {
|
|||
.map(Author::getReflection)
|
||||
.orElse(null);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void requestNewReflection(Project project, User author) {
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -101,6 +101,26 @@ public class ReflectionServiceTest extends IntegrationTest {
|
|||
assertTrue(reflectionService.hasReachedReflectionProcess(project));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void request_resubmission() {
|
||||
LocalDate seminarDate = scheduleSeminar();
|
||||
clock.setDate(seminarDate.plusDays(1));
|
||||
assertTrue(reflectionService.hasToFillInReflection(project, author),
|
||||
"After the final seminar the author should be required to submit a reflection");
|
||||
|
||||
String myReflection = "my reflection";
|
||||
reflectionService.submitReflection(project, author, myReflection);
|
||||
assertEquals(myReflection, reflectionService.getSubmittedReflection(project, author));
|
||||
assertFalse(reflectionService.hasToFillInReflection(project, author),
|
||||
"After submitting the initial reflection it should no longer be required");
|
||||
|
||||
reflectionService.requestNewReflection(project, author);
|
||||
assertTrue(reflectionService.hasToFillInReflection(project, author),
|
||||
"After supervisor requests resubmission the author should now be required to submit a new reflection");
|
||||
assertEquals(myReflection, reflectionService.getSubmittedReflection(project, author),
|
||||
"The old reflection should be saved to make it easier for the student to update it");
|
||||
}
|
||||
|
||||
private LocalDate scheduleSeminar() {
|
||||
project.setFinalSeminarRuleExempted(true); // to bypass rough draft approval
|
||||
FinalSeminarDetails details = new FinalSeminarDetails("Zoom", false, 1, 1, Language.SWEDISH, Language.ENGLISH, "zoom id 123");
|
||||
|
|
Loading…
Reference in New Issue
Block a user