minor fixes

This commit is contained in:
anhefti 2022-06-01 12:57:39 +02:00
parent 22bbee1117
commit 9627940fbb
2 changed files with 7 additions and 7 deletions

View file

@ -669,8 +669,10 @@ public class ResourceService {
.call() .call()
.getOr(Collections.emptyList()) .getOr(Collections.emptyList())
.stream() .stream()
.filter(exam -> exam != null .filter(exam -> exam != null &&
&& (exam.getStatus() == ExamStatus.RUNNING || exam.getStatus() == ExamStatus.FINISHED)) (exam.getStatus() == ExamStatus.RUNNING ||
exam.getStatus() == ExamStatus.FINISHED ||
exam.getStatus() == ExamStatus.ARCHIVED))
.map(exam -> new Tuple<>( .map(exam -> new Tuple<>(
exam.getModelId(), exam.getModelId(),
StringUtils.isBlank(exam.name) ? exam.externalId : exam.name)) StringUtils.isBlank(exam.name) ? exam.externalId : exam.name))

View file

@ -125,11 +125,9 @@ public class ExamSessionServiceImpl implements ExamSessionService {
return Result.tryCatch(() -> { return Result.tryCatch(() -> {
final Collection<APIMessage> result = new ArrayList<>(); final Collection<APIMessage> result = new ArrayList<>();
final Exam exam = (this.isExamRunning(examId)) final Exam exam = this.examDAO
? this.examSessionCacheService.getRunningExam(examId) .byPK(examId)
: this.examDAO .getOrThrow();
.byPK(examId)
.getOrThrow();
// check lms connection // check lms connection
if (!exam.isLmsAvailable()) { if (!exam.isLmsAvailable()) {