2984 PO Include credits when supervisor is forced to report pass/fail grades.
This commit is contained in:
parent
565216dc7b
commit
206dd24d4c
core/src/main/java/se/su/dsv/scipro/grading
view/src
main
java/se/su/dsv/scipro/grading
resources/se/su/dsv/scipro/grading
test/java/se/su/dsv/scipro
@ -3,6 +3,7 @@ package se.su.dsv.scipro.grading;
|
||||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.*;
|
||||
|
||||
@JsonIgnoreProperties(ignoreUnknown = true)
|
||||
@ -10,6 +11,7 @@ public record Examination(
|
||||
@JsonProperty("id") int id,
|
||||
@JsonProperty("name") Name name,
|
||||
@JsonProperty("provkod") String provkod,
|
||||
@JsonProperty("points") BigDecimal points,
|
||||
@JsonProperty("grades") List<Grade> grades)
|
||||
{
|
||||
public boolean hasManyPassingGrades() {
|
||||
|
@ -124,6 +124,7 @@ abstract class AbstractExaminationsPanel extends GenericPanel<User> {
|
||||
}
|
||||
});
|
||||
queue(new Label("examinationName1", examinationModel.map(Examination::name).map(Name::english)));
|
||||
queue(new Label("points", examinationModel.map(Examination::points)));
|
||||
queue(new Label("letter", resultModel.map(Result::letter)));
|
||||
queue(new Label("reported", resultModel.map(Result::reported)));
|
||||
|
||||
|
@ -8,7 +8,10 @@
|
||||
<wicket:container wicket:id="allowedToGrade">
|
||||
<wicket:container wicket:id="resultContainer">
|
||||
<div class="mb-3">
|
||||
<label class="col-form-label" wicket:id="examinationName1">Problem and method</label>
|
||||
<label class="col-form-label">
|
||||
<wicket:container wicket:id="examinationName1">Problem and method</wicket:container>
|
||||
(<wicket:container wicket:id="points"></wicket:container> hec)
|
||||
</label>
|
||||
<p class="form-control-plaintext" wicket:id="letter"></p>
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
|
@ -18,6 +18,7 @@ import se.su.dsv.scipro.system.ProjectType;
|
||||
import se.su.dsv.scipro.system.User;
|
||||
import se.su.dsv.scipro.util.Either;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDate;
|
||||
import java.time.LocalTime;
|
||||
import java.time.Month;
|
||||
@ -30,7 +31,6 @@ import java.util.Set;
|
||||
import static org.mockito.ArgumentMatchers.any;
|
||||
import static org.mockito.ArgumentMatchers.anyInt;
|
||||
import static org.mockito.ArgumentMatchers.anyLong;
|
||||
import static org.mockito.Mockito.lenient;
|
||||
import static org.mockito.Mockito.verify;
|
||||
import static org.mockito.Mockito.when;
|
||||
|
||||
@ -69,6 +69,7 @@ public class SendToExaminerTest extends SciProTest {
|
||||
1,
|
||||
new Name("Problem och metod", "Problem and method"),
|
||||
"KX1P",
|
||||
BigDecimal.valueOf(6),
|
||||
List.of(
|
||||
new Grade(Grade.Type.PASSING, "P"),
|
||||
new Grade(Grade.Type.FAILING, "F")));
|
||||
@ -76,6 +77,7 @@ public class SendToExaminerTest extends SciProTest {
|
||||
2,
|
||||
new Name("Examensarbete", "Graduation work"),
|
||||
"KX1E",
|
||||
BigDecimal.valueOf(9),
|
||||
List.of(
|
||||
new Grade(Grade.Type.PASSING, "A"),
|
||||
new Grade(Grade.Type.PASSING, "B"),
|
||||
|
@ -22,6 +22,7 @@ import se.su.dsv.scipro.system.User;
|
||||
import se.su.dsv.scipro.test.DomainObjects;
|
||||
import se.su.dsv.scipro.util.Either;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.net.URISyntaxException;
|
||||
import java.time.Duration;
|
||||
import java.time.Instant;
|
||||
@ -54,7 +55,7 @@ public class RoughDraftApprovalDecisionPageTest extends SciProTest {
|
||||
when(roughDraftApprovalService.findBy(project)).thenReturn(Optional.of(roughDraftApproval));
|
||||
tester.getSession().setMetaData(OAuth.TOKEN, "abc");
|
||||
tester.getSession().setMetaData(OAuth.EXPIRATION, Instant.now().plus(Duration.ofHours(1)));
|
||||
Examination problemAndMethod = new Examination(614, new Name("Problem", "Problem"), "KX1P", List.of(new Grade(Grade.Type.PASSING, "P")));
|
||||
Examination problemAndMethod = new Examination(614, new Name("Problem", "Problem"), "KX1P", BigDecimal.valueOf(6), List.of(new Grade(Grade.Type.PASSING, "P")));
|
||||
lenient().when(gradingService.getExaminations(anyString(), anyLong(), anyLong()))
|
||||
.thenReturn(List.of(problemAndMethod));
|
||||
lenient().when(gradingService.reportGrade(any(), anyLong(), anyLong(), anyInt(), any(), any()))
|
||||
|
Loading…
x
Reference in New Issue
Block a user