SEBSERV-168 fixed. Missed to apply the filter after refactoring
This commit is contained in:
parent
e5f9cf33cf
commit
256b59e566
4 changed files with 21 additions and 5 deletions
|
@ -115,9 +115,11 @@ public class QuizLookupList implements TemplateComposer {
|
||||||
private final ResourceService resourceService;
|
private final ResourceService resourceService;
|
||||||
private final PageService pageService;
|
private final PageService pageService;
|
||||||
private final int pageSize;
|
private final int pageSize;
|
||||||
|
private final DateTime filterStartDate;
|
||||||
|
|
||||||
protected QuizLookupList(
|
protected QuizLookupList(
|
||||||
final PageService pageService,
|
final PageService pageService,
|
||||||
|
@Value("${sebserver.gui.filter.date.from.years:2}") final Integer startYearFromNow,
|
||||||
@Value("${sebserver.gui.list.page.size:20}") final Integer pageSize) {
|
@Value("${sebserver.gui.list.page.size:20}") final Integer pageSize) {
|
||||||
|
|
||||||
this.pageService = pageService;
|
this.pageService = pageService;
|
||||||
|
@ -125,6 +127,10 @@ public class QuizLookupList implements TemplateComposer {
|
||||||
this.resourceService = pageService.getResourceService();
|
this.resourceService = pageService.getResourceService();
|
||||||
this.pageSize = pageSize;
|
this.pageSize = pageSize;
|
||||||
|
|
||||||
|
this.filterStartDate = Utils
|
||||||
|
.toDateTimeUTC(Utils.getMillisecondsNow())
|
||||||
|
.minusYears(startYearFromNow);
|
||||||
|
|
||||||
this.institutionFilter = new TableFilterAttribute(
|
this.institutionFilter = new TableFilterAttribute(
|
||||||
CriteriaType.SINGLE_SELECTION,
|
CriteriaType.SINGLE_SELECTION,
|
||||||
Entity.FILTER_ATTR_INSTITUTION,
|
Entity.FILTER_ATTR_INSTITUTION,
|
||||||
|
@ -194,9 +200,7 @@ public class QuizLookupList implements TemplateComposer {
|
||||||
.withFilter(new TableFilterAttribute(
|
.withFilter(new TableFilterAttribute(
|
||||||
CriteriaType.DATE,
|
CriteriaType.DATE,
|
||||||
QuizData.FILTER_ATTR_START_TIME,
|
QuizData.FILTER_ATTR_START_TIME,
|
||||||
Utils.toDateTimeUTC(Utils.getMillisecondsNow())
|
this.filterStartDate.toString()))
|
||||||
.minusYears(1)
|
|
||||||
.toString()))
|
|
||||||
.sortable())
|
.sortable())
|
||||||
|
|
||||||
.withColumn(new ColumnDefinition<>(
|
.withColumn(new ColumnDefinition<>(
|
||||||
|
|
|
@ -28,6 +28,7 @@ import ch.ethz.seb.sebserver.gbl.model.institution.LmsSetupTestResult;
|
||||||
import ch.ethz.seb.sebserver.gbl.model.user.ExamineeAccountDetails;
|
import ch.ethz.seb.sebserver.gbl.model.user.ExamineeAccountDetails;
|
||||||
import ch.ethz.seb.sebserver.gbl.util.Result;
|
import ch.ethz.seb.sebserver.gbl.util.Result;
|
||||||
import ch.ethz.seb.sebserver.webservice.servicelayer.dao.FilterMap;
|
import ch.ethz.seb.sebserver.webservice.servicelayer.dao.FilterMap;
|
||||||
|
import ch.ethz.seb.sebserver.webservice.servicelayer.lms.LmsAPIService;
|
||||||
import ch.ethz.seb.sebserver.webservice.servicelayer.lms.LmsAPITemplate;
|
import ch.ethz.seb.sebserver.webservice.servicelayer.lms.LmsAPITemplate;
|
||||||
|
|
||||||
final class OpenEdxLmsAPITemplate implements LmsAPITemplate {
|
final class OpenEdxLmsAPITemplate implements LmsAPITemplate {
|
||||||
|
@ -65,7 +66,11 @@ final class OpenEdxLmsAPITemplate implements LmsAPITemplate {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Result<List<QuizData>> getQuizzes(final FilterMap filterMap) {
|
public Result<List<QuizData>> getQuizzes(final FilterMap filterMap) {
|
||||||
return this.openEdxCourseAccess.getQuizzes(filterMap);
|
return this.openEdxCourseAccess
|
||||||
|
.getQuizzes(filterMap)
|
||||||
|
.map(quizzes -> quizzes.stream()
|
||||||
|
.filter(LmsAPIService.quizFilterPredicate(filterMap))
|
||||||
|
.collect(Collectors.toList()));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -28,6 +28,7 @@ import ch.ethz.seb.sebserver.gbl.model.institution.LmsSetupTestResult;
|
||||||
import ch.ethz.seb.sebserver.gbl.model.user.ExamineeAccountDetails;
|
import ch.ethz.seb.sebserver.gbl.model.user.ExamineeAccountDetails;
|
||||||
import ch.ethz.seb.sebserver.gbl.util.Result;
|
import ch.ethz.seb.sebserver.gbl.util.Result;
|
||||||
import ch.ethz.seb.sebserver.webservice.servicelayer.dao.FilterMap;
|
import ch.ethz.seb.sebserver.webservice.servicelayer.dao.FilterMap;
|
||||||
|
import ch.ethz.seb.sebserver.webservice.servicelayer.lms.LmsAPIService;
|
||||||
import ch.ethz.seb.sebserver.webservice.servicelayer.lms.LmsAPITemplate;
|
import ch.ethz.seb.sebserver.webservice.servicelayer.lms.LmsAPITemplate;
|
||||||
import ch.ethz.seb.sebserver.webservice.servicelayer.lms.impl.NoSEBRestrictionException;
|
import ch.ethz.seb.sebserver.webservice.servicelayer.lms.impl.NoSEBRestrictionException;
|
||||||
|
|
||||||
|
@ -67,7 +68,11 @@ public class MoodleLmsAPITemplate implements LmsAPITemplate {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Result<List<QuizData>> getQuizzes(final FilterMap filterMap) {
|
public Result<List<QuizData>> getQuizzes(final FilterMap filterMap) {
|
||||||
return this.moodleCourseAccess.getQuizzes(filterMap);
|
return this.moodleCourseAccess
|
||||||
|
.getQuizzes(filterMap)
|
||||||
|
.map(quizzes -> quizzes.stream()
|
||||||
|
.filter(LmsAPIService.quizFilterPredicate(filterMap))
|
||||||
|
.collect(Collectors.toList()));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -31,6 +31,8 @@ sebserver.gui.webservice.moodle-lms-enabled=true
|
||||||
sebserver.gui.seb.client.config.download.filename=SEBServerSettings.seb
|
sebserver.gui.seb.client.config.download.filename=SEBServerSettings.seb
|
||||||
sebserver.gui.seb.exam.config.download.filename=SEBExamSettings.seb
|
sebserver.gui.seb.exam.config.download.filename=SEBExamSettings.seb
|
||||||
|
|
||||||
|
sebserver.gui.filter.date.from.years=2
|
||||||
|
|
||||||
# remote proctoring
|
# remote proctoring
|
||||||
sebserver.gui.remote.proctoring.entrypoint=/remote-proctoring
|
sebserver.gui.remote.proctoring.entrypoint=/remote-proctoring
|
||||||
sebserver.gui.remote.proctoring.api-servler.endpoint=/remote-view-servlet
|
sebserver.gui.remote.proctoring.api-servler.endpoint=/remote-view-servlet
|
||||||
|
|
Loading…
Reference in a new issue