Merge branch 'dev-1.6' into development
This commit is contained in:
commit
91212c65be
2 changed files with 19 additions and 1 deletions
|
@ -416,7 +416,7 @@ public class SEBClientConfigForm implements TemplateComposer {
|
|||
SEBClientConfig.ATTR_EXAM_SELECTION,
|
||||
FORM_EXAM_SELECTION_TEXT_KEY,
|
||||
StringUtils.join(clientConfig.selectedExams, Constants.LIST_SEPARATOR),
|
||||
() -> pageService.getResourceService().getExamLogSelectionResources())
|
||||
() -> pageService.getResourceService().getActiveExamResources())
|
||||
.withInputSpan(5))
|
||||
.withDefaultSpanEmptyCell(1);
|
||||
|
||||
|
|
|
@ -717,6 +717,24 @@ public class ResourceService {
|
|||
.collect(Collectors.toList());
|
||||
}
|
||||
|
||||
public List<Tuple<String>> getActiveExamResources() {
|
||||
final UserInfo userInfo = this.currentUser.get();
|
||||
return this.restService.getBuilder(GetExams.class)
|
||||
.withQueryParam(Entity.FILTER_ATTR_INSTITUTION, String.valueOf(userInfo.getInstitutionId()))
|
||||
.withQueryParam(Exam.FILTER_CACHED_QUIZZES, Constants.TRUE_STRING)
|
||||
.call()
|
||||
.getOr(Collections.emptyList())
|
||||
.stream()
|
||||
.filter(exam -> exam != null &&
|
||||
exam.getStatus() != ExamStatus.FINISHED &&
|
||||
exam.getStatus() != ExamStatus.ARCHIVED)
|
||||
.map(exam -> new Tuple<>(
|
||||
exam.getModelId(),
|
||||
StringUtils.isBlank(exam.name) ? exam.externalId : exam.name))
|
||||
.sorted(RESOURCE_COMPARATOR)
|
||||
.collect(Collectors.toList());
|
||||
}
|
||||
|
||||
public List<Tuple<String>> getExamResources() {
|
||||
final UserInfo userInfo = this.currentUser.get();
|
||||
return this.restService.getBuilder(GetExamNames.class)
|
||||
|
|
Loading…
Reference in a new issue