Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exam mode: Display assessment check table in ExamChecklist component #8120

Merged
merged 66 commits into from
May 18, 2024
Merged
Show file tree
Hide file tree
Changes from 62 commits
Commits
Show all changes
66 commits
Select commit Hold shift + click to select a range
6270f89
Initial functionality to show unfinished submissions is added
eceeeren Mar 3, 2024
2b61c71
Fix result query
eceeeren Mar 3, 2024
eee32a6
Merge branch 'develop' into feature/display-warning-in-checklist
eceeeren Mar 5, 2024
a6bf576
Merge branch 'develop' into feature/display-warning-in-checklist
eceeeren Mar 5, 2024
e49d049
Merge branch 'develop' into feature/display-warning-in-checklist
eceeeren Mar 7, 2024
a2b849d
Add Assessment Details to Assessment list
eceeeren Mar 10, 2024
6a864b2
Merge branch 'develop' into feature/display-warning-in-checklist
eceeeren Mar 10, 2024
d448d00
Merge branch 'develop' into feature/display-warning-in-checklist
eceeeren Mar 17, 2024
2d6eada
Merge branch 'develop' into feature/display-warning-in-checklist
eceeeren Mar 17, 2024
acfd394
Merge branch 'develop' into feature/display-warning-in-checklist
eceeeren Mar 17, 2024
f93de4a
Checklist translation is added
eceeeren Mar 17, 2024
e3e3a41
Fix button behavior & lagging
eceeeren Mar 18, 2024
7aa2bf4
Merge branch 'develop' into feature/display-warning-in-checklist
eceeeren Mar 20, 2024
799d1d1
Merge branch 'develop' into feature/display-warning-in-checklist
eceeeren Mar 20, 2024
65d34c6
Merge branch 'develop' into feature/display-warning-in-checklist
eceeeren Mar 21, 2024
867f8fc
Merge branch 'develop' into feature/display-warning-in-checklist
eceeeren Mar 22, 2024
dd8fb01
Change exercise list to inline
eceeeren Mar 22, 2024
0eeb30d
Merge branch 'develop' into feature/display-warning-in-checklist
eceeeren Mar 28, 2024
a72eb14
Fix assessment url structure
eceeeren Mar 28, 2024
15546d4
Fix missing type
eceeeren Mar 28, 2024
ab4cd02
Merge branch 'develop' into feature/display-warning-in-checklist
eceeeren Mar 30, 2024
ef8e270
Merge branch 'develop' into feature/display-warning-in-checklist
eceeeren Apr 4, 2024
76d8df8
Remove the space before the comma
eceeeren Apr 5, 2024
f5509d0
Merge branch 'develop' into feature/display-warning-in-checklist
eceeeren Apr 7, 2024
cae708c
Merge branch 'develop' into feature/display-warning-in-checklist
eceeeren Apr 8, 2024
f92fcc2
Make assessment list invisible when no publish result date
eceeeren Apr 8, 2024
10d5290
Merge branch 'develop' into feature/display-warning-in-checklist
eceeeren Apr 9, 2024
499cb34
Merge branch 'develop' into feature/display-warning-in-checklist
eceeeren Apr 10, 2024
d212ffc
Merge branch 'develop' into feature/display-warning-in-checklist
eceeeren Apr 11, 2024
a10149e
Merge branch 'develop' into feature/display-warning-in-checklist
bassner Apr 15, 2024
55f3629
Merge branch 'develop' into feature/display-warning-in-checklist
eceeeren Apr 17, 2024
13f6a87
Merge branch 'develop' into feature/display-warning-in-checklist
eceeeren Apr 18, 2024
48e6aca
Merge branch 'develop' into feature/display-warning-in-checklist
eceeeren Apr 25, 2024
67daf4b
Merge branch 'develop' into feature/display-warning-in-checklist
eceeeren Apr 27, 2024
cbb562f
Merge branch 'develop' into feature/display-warning-in-checklist
eceeeren Apr 28, 2024
e0cf5e4
Add assessment check table to exam checklist
eceeeren Apr 30, 2024
62d52b2
Remove unnecessary variables & files
eceeeren Apr 30, 2024
cdd14ff
Give functionality to checklist table buttons
eceeeren May 2, 2024
4cae158
Update src/main/webapp/i18n/de/exam.json
eceeeren May 3, 2024
b191e38
Merge branch 'develop' into feature/display-warning-in-checklist
eceeeren May 3, 2024
9c53e61
Add server tests
eceeeren May 3, 2024
dfd5fb7
Merge remote-tracking branch 'origin/feature/display-warning-in-check…
eceeeren May 3, 2024
8ba409e
Add and fix client tests
eceeeren May 3, 2024
d7eff6b
Fix client tests 2
eceeeren May 4, 2024
f11a472
Merge branch 'develop' into feature/display-warning-in-checklist
eceeeren May 4, 2024
20c76b6
Fix tests
eceeeren May 4, 2024
9dcbd6b
isExamOver check is added
eceeeren May 4, 2024
946449f
Small fixes & JavaDoc comments are added
eceeeren May 4, 2024
7938f72
Fix getLongestWorkingTimeForExam call
eceeeren May 4, 2024
8e94837
Boolean checks are configured again
eceeeren May 4, 2024
bd2facb
Add exam is not over check
eceeeren May 4, 2024
6b1b363
Fix typos & translate pipe
eceeeren May 5, 2024
d0ce53d
Error handling structure is changed
eceeeren May 5, 2024
0adb203
Add unsubscription logic
eceeeren May 5, 2024
d80dc7d
Remove translatePipe from the exam-detail test
eceeeren May 6, 2024
519e0b6
Merge branch 'develop' into feature/display-warning-in-checklist
eceeeren May 7, 2024
5ae2c3c
Review changes are added
eceeeren May 8, 2024
3313876
Merge branch 'feature/display-warning-in-checklist' of https://github…
eceeeren May 8, 2024
0a8c3c6
Add test comments
eceeeren May 9, 2024
52ba117
Add authorization to the server
eceeeren May 10, 2024
539ce71
existsUnassessedQuizzesByExamId Description is changed
eceeeren May 10, 2024
f9c5ede
Update src/main/java/de/tum/in/www1/artemis/web/rest/StudentExamResou…
eceeeren May 10, 2024
7cd19da
Added courseId to longestWorkingTime endpoint
eceeeren May 12, 2024
7da6825
Remove courseId from the query
eceeeren May 12, 2024
9609003
CoderabbotAI changes
eceeeren May 12, 2024
55f25ef
Change console.log to captureException
eceeeren May 12, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -474,4 +474,18 @@ private Exercise selectRandomExercise(SecureRandom random, ExerciseGroup exercis
WHERE se.id IN :ids
""")
List<StudentExam> findAllWithEagerExercisesById(@Param("ids") List<Long> ids);

/**
* Gets the longest working time of the exam with the given id
*
* @param examId the id of the exam
* @return number longest working time of the exam
*/
@Query("""
SELECT MAX(se.workingTime)
FROM StudentExam se
JOIN se.exam e
WHERE e.id = :examId
""")
Integer findLongestWorkingTimeForExam(@Param("examId") Long examId);
}
Original file line number Diff line number Diff line change
Expand Up @@ -555,4 +555,41 @@ SELECT MAX(s2.submissionDate)
default Submission findByIdElseThrow(long submissionId) {
return findById(submissionId).orElseThrow(() -> new EntityNotFoundException("Submission", submissionId));
}

/**
* GChecks if unassessed Quiz Submissions exist for the given exam
*
* @param examId the ID of the exam
* @return boolean indicating if there are unassessed Quiz Submission
*/
@Query("""
SELECT COUNT(p.exercise) > 0
FROM StudentParticipation p
JOIN p.submissions s
LEFT JOIN s.results r
WHERE p.exercise.exerciseGroup.exam.id = :examId
AND p.testRun IS FALSE
AND TYPE(s) = QuizSubmission
AND s.submitted IS TRUE
AND r.id IS NULL
""")
boolean existsUnassessedQuizzesByExamId(@Param("examId") long examId);

/**
* Checks if unsubmitted text and modeling submissions exist for the exam with the given id
*
* @param examId the ID of the exam
* @return boolean indicating if there are unsubmitted text and modelling submissions
*/
@Query("""
SELECT COUNT(p.exercise) > 0
FROM StudentParticipation p
JOIN p.submissions s
WHERE p.exercise.exerciseGroup.exam.id = :examId
AND p.testRun IS FALSE
AND TYPE(s) IN (TextSubmission, ModelingSubmission)
AND (s.submitted IS NULL OR s.submitted IS FALSE)
AND s.submissionDate IS NULL
""")
boolean existsUnsubmittedExercisesByExamId(@Param("examId") long examId);
}
Original file line number Diff line number Diff line change
Expand Up @@ -1123,6 +1123,10 @@ public ExamChecklistDTO getStatsForChecklist(Exam exam, boolean isInstructor) {
examChecklistDTO.setNumberOfExamsSubmitted(numberOfStudentExamsSubmitted);
}
examChecklistDTO.setNumberOfTotalParticipationsForAssessment(totalNumberOfParticipationsForAssessment);
boolean existsUnassessedQuizzes = submissionRepository.existsUnassessedQuizzesByExamId(exam.getId());
examChecklistDTO.setExistsUnassessedQuizzes(existsUnassessedQuizzes);
boolean existsUnsubmittedExercises = submissionRepository.existsUnsubmittedExercisesByExamId(exam.getId());
examChecklistDTO.setExistsUnsubmittedExercises(existsUnsubmittedExercises);
eceeeren marked this conversation as resolved.
Show resolved Hide resolved
return examChecklistDTO;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -890,4 +890,18 @@ public ResponseEntity<StudentExam> unsubmitStudentExam(@PathVariable Long course

return ResponseEntity.ok(studentExamRepository.save(studentExam));
}

/**
* GET exams/{examId}/longest-working-time : Returns the value of
eceeeren marked this conversation as resolved.
Show resolved Hide resolved
* the longest working time of the exam
*
* @param examId the exam to which the student exams belong to
* @return the longest working time of the exam (in seconds)
*/
@EnforceAtLeastInstructor
@GetMapping("exams/{examId}/longest-working-time")
public ResponseEntity<Integer> getLongestWorkingTimeForExam(@PathVariable Long examId) {
eceeeren marked this conversation as resolved.
Show resolved Hide resolved
JohannesStoehr marked this conversation as resolved.
Show resolved Hide resolved
Integer longestWorkingTime = studentExamRepository.findLongestWorkingTimeForExam(examId);
return ResponseEntity.ok().body(longestWorkingTime);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,26 @@ public class ExamChecklistDTO {

private boolean allExamExercisesAllStudentsPrepared;

private boolean existsUnassessedQuizzes;

private boolean existsUnsubmittedExercises;

public boolean getExistsUnassessedQuizzes() {
return existsUnassessedQuizzes;
}
eceeeren marked this conversation as resolved.
Show resolved Hide resolved

public void setExistsUnassessedQuizzes(boolean existsUnassessedQuizzes) {
this.existsUnassessedQuizzes = existsUnassessedQuizzes;
}

public boolean getExistsUnsubmittedExercises() {
return existsUnsubmittedExercises;
}

public void setExistsUnsubmittedExercises(boolean existsUnsubmittedExercises) {
this.existsUnsubmittedExercises = existsUnsubmittedExercises;
}

public Long getNumberOfTotalParticipationsForAssessment() {
return numberOfTotalParticipationsForAssessment;
}
Expand Down
4 changes: 4 additions & 0 deletions src/main/webapp/app/entities/exam-checklist.model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,8 @@ export class ExamChecklist {
public numberOfAllComplaintsDone?: number;

public allExamExercisesAllStudentsPrepared?: boolean;

public existsUnassessedQuizzes: boolean;

public existsUnsubmittedExercises: boolean;
}
Original file line number Diff line number Diff line change
Expand Up @@ -462,8 +462,105 @@ <h3>{{ 'artemisApp.examStatus.correction.examCorrection' | artemisTranslate }}</
<ul class="list-unstyled">
<li class="list-group-item border-1">
<span>
<jhi-checklist-check [checkAttribute]="!!exam.publishResultsDate" />
<span>{{ 'artemisApp.examManagement.checklist.textitems.pulishingdateset' | artemisTranslate }}</span>
<li class="list-group-item border-1">
<jhi-checklist-check [checkAttribute]="!!exam.publishResultsDate" />
<span>{{ 'artemisApp.examManagement.checklist.textitems.pulishingdateset' | artemisTranslate }}</span>
</li>
@if (exam.publishResultsDate) {
<hr />
<div class="table-responsive">
<table class="table table-striped">
<thead>
<tr>
<th>
<span jhiTranslate="artemisApp.examManagement.checklist.textitems.assessmentCheckType"></span>
</th>
<th>
<span jhiTranslate="artemisApp.examManagement.checklist.textitems.assessmentStatus"></span>
</th>
<th>
<span jhiTranslate="artemisApp.examManagement.checklist.textitems.assessmentAction"></span>
</th>
</tr>
</thead>
<tbody>
<tr>
<th>
<span jhiTranslate="artemisApp.examManagement.checklist.textitems.checkUnfinishedAssessments"></span>
</th>
<th>
<jhi-checklist-check [checkAttribute]="!isExamOver || (isExamOver && !existsUnfinishedAssessments)" />
</th>
<th>
<button
[routerLink]="getExamRoutesByIdentifier('assessment-dashboard')"
class="btn btn-primary"
id="tutor-exam-dashboard-button_table_assessment_check"
[disabled]="!isExamOver || isLoading || (isExamOver && !existsUnfinishedAssessments)"
>
<fa-icon [icon]="faThList" />
<span jhiTranslate="artemisApp.examManagement.assessmentDashboard"></span>
</button>
</th>
</tr>
<tr>
<th>
<span jhiTranslate="artemisApp.examManagement.checklist.textitems.checkUnassessedQuizzes"></span>
</th>
<th>
@if (isEvaluatingQuizExercises) {
<span class="spinner-border spinner-border-sm" role="status" aria-hidden="true"></span>
} @else {
<jhi-checklist-check [checkAttribute]="!isExamOver || (isExamOver && !existsUnassessedQuizzes)" />
}
</th>
<th>
<button
id="evaluateQuizExercisesButton"
class="btn btn-primary mt-1"
(click)="evaluateQuizExercises()"
[disabled]="
!isExamOver || isLoading || (isExamOver && (!existsUnassessedQuizzes || isEvaluatingQuizExercises))
"
>
@if (isEvaluatingQuizExercises) {
<span class="spinner-border spinner-border-sm" role="status" aria-hidden="true"></span>
}
<span jhiTranslate="artemisApp.studentExams.evaluateQuizExercises"></span>
</button>
</th>
</tr>
<tr>
<th>
<span jhiTranslate="artemisApp.examManagement.checklist.textitems.checkUnsubmittedExercises"></span>
</th>
<th>
@if (isAssessingUnsubmittedExams) {
<span class="spinner-border spinner-border-sm" role="status" aria-hidden="true"></span>
} @else {
<jhi-checklist-check [checkAttribute]="!isExamOver || (isExamOver && !existsUnsubmittedExercises)" />
}
</th>
<th>
<button
class="btn btn-primary mt-1"
id="assessUnsubmittedExamModelingAndTextParticipationsButton"
(click)="assessUnsubmittedExamModelingAndTextParticipations()"
[disabled]="
!isExamOver || isLoading || (isExamOver && (!existsUnsubmittedExercises || isAssessingUnsubmittedExams))
"
>
@if (isAssessingUnsubmittedExams) {
<span class="spinner-border spinner-border-sm" role="status" aria-hidden="true"></span>
}
<span jhiTranslate="artemisApp.studentExams.assessUnsubmittedStudentExams"></span>
</button>
</th>
</tr>
</tbody>
</table>
</div>
}
eceeeren marked this conversation as resolved.
Show resolved Hide resolved
</span>
</li>
</ul>
Expand Down
Loading
Loading