some more preparation

This commit is contained in:
anhefti 2021-05-19 15:17:09 +02:00
parent 054a4f9e31
commit a0dbe72a1b

View file

@ -212,6 +212,8 @@ public class OlatLmsAPITemplate extends AbstractCachedCourseAccess implements Lm
final String quizName = filterMap.getString(QuizData.FILTER_ATTR_QUIZ_NAME); final String quizName = filterMap.getString(QuizData.FILTER_ATTR_QUIZ_NAME);
final DateTime quizFromTime = (filterMap != null) ? filterMap.getQuizFromTime() : null; final DateTime quizFromTime = (filterMap != null) ? filterMap.getQuizFromTime() : null;
return () -> {
// TODO Get all course / quiz data from remote LMS that matches the filter criteria. // TODO Get all course / quiz data from remote LMS that matches the filter criteria.
// If the LMS API uses paging, go through all pages using the filter criteria // If the LMS API uses paging, go through all pages using the filter criteria
// and collect the course data. // and collect the course data.
@ -219,7 +221,6 @@ public class OlatLmsAPITemplate extends AbstractCachedCourseAccess implements Lm
// Put loaded QuizData objects to the cache: super.putToCache(quizDataCollection); // Put loaded QuizData objects to the cache: super.putToCache(quizDataCollection);
// before returning it. // before returning it.
return () -> {
throw new RuntimeException("TODO"); throw new RuntimeException("TODO");
}; };
} }
@ -227,12 +228,13 @@ public class OlatLmsAPITemplate extends AbstractCachedCourseAccess implements Lm
@Override @Override
protected Supplier<Collection<QuizData>> quizzesSupplier(final Set<String> ids) { protected Supplier<Collection<QuizData>> quizzesSupplier(final Set<String> ids) {
return () -> {
// TODO get all quiz / course data for specified identifiers from remote LMS // TODO get all quiz / course data for specified identifiers from remote LMS
// Transform the data from courses / quizzes from LMS into QuizData objects // Transform the data from courses / quizzes from LMS into QuizData objects
// and put it to the cache: super.putToCache(quizDataCollection); // and put it to the cache: super.putToCache(quizDataCollection);
// before returning it. // before returning it.
return () -> {
throw new RuntimeException("TODO"); throw new RuntimeException("TODO");
}; };
} }
@ -240,11 +242,12 @@ public class OlatLmsAPITemplate extends AbstractCachedCourseAccess implements Lm
@Override @Override
protected Supplier<QuizData> quizSupplier(final String id) { protected Supplier<QuizData> quizSupplier(final String id) {
return () -> {
// TODO get the specified quiz / course data for specified identifier from remote LMS // TODO get the specified quiz / course data for specified identifier from remote LMS
// and put it to the cache: super.putToCache(quizDataCollection); // and put it to the cache: super.putToCache(quizDataCollection);
// before returning it. // before returning it.
return () -> {
throw new RuntimeException("TODO"); throw new RuntimeException("TODO");
}; };
} }
@ -252,10 +255,11 @@ public class OlatLmsAPITemplate extends AbstractCachedCourseAccess implements Lm
@Override @Override
protected Supplier<ExamineeAccountDetails> accountDetailsSupplier(final String examineeSessionId) { protected Supplier<ExamineeAccountDetails> accountDetailsSupplier(final String examineeSessionId) {
return () -> {
// TODO get the examinee's account details by the given examineeSessionId from remote LMS. // TODO get the examinee's account details by the given examineeSessionId from remote LMS.
// Currently only the name is needed to display on monitoring view. // Currently only the name is needed to display on monitoring view.
return () -> {
throw new RuntimeException("TODO"); throw new RuntimeException("TODO");
}; };
} }
@ -263,7 +267,7 @@ public class OlatLmsAPITemplate extends AbstractCachedCourseAccess implements Lm
@Override @Override
protected Supplier<Chapters> getCourseChaptersSupplier(final String courseId) { protected Supplier<Chapters> getCourseChaptersSupplier(final String courseId) {
return () -> { return () -> {
throw new UnsupportedOperationException("not available yet"); throw new UnsupportedOperationException("No Course Chapter available for OpenOLAT LMS");
}; };
} }
@ -272,10 +276,13 @@ public class OlatLmsAPITemplate extends AbstractCachedCourseAccess implements Lm
final String quizId = exam.externalId; final String quizId = exam.externalId;
return Result.tryCatch(() -> {
// TODO get the SEB client restrictions that are currently set on the remote LMS for // TODO get the SEB client restrictions that are currently set on the remote LMS for
// the given quiz / course derived from the given exam // the given quiz / course derived from the given exam
return Result.ofRuntimeError("TODO"); throw new RuntimeException("TODO");
});
} }
@Override @Override
@ -283,11 +290,14 @@ public class OlatLmsAPITemplate extends AbstractCachedCourseAccess implements Lm
final String externalExamId, final String externalExamId,
final SEBRestriction sebRestrictionData) { final SEBRestriction sebRestrictionData) {
return Result.tryCatch(() -> {
// TODO apply the given sebRestrictionData settings as current SEB client restriction setting // TODO apply the given sebRestrictionData settings as current SEB client restriction setting
// to the remote LMS for the given quiz / course. // to the remote LMS for the given quiz / course.
// Mainly SEBRestriction.configKeys and SEBRestriction.browserExamKeys // Mainly SEBRestriction.configKeys and SEBRestriction.browserExamKeys
return Result.ofRuntimeError("TODO"); throw new RuntimeException("TODO");
});
} }
@Override @Override
@ -295,10 +305,13 @@ public class OlatLmsAPITemplate extends AbstractCachedCourseAccess implements Lm
final String quizId = exam.externalId; final String quizId = exam.externalId;
return Result.tryCatch(() -> {
// TODO Release respectively delete all SEB client restrictions for the given // TODO Release respectively delete all SEB client restrictions for the given
// course / quize on the remote LMS. // course / quize on the remote LMS.
return Result.ofRuntimeError("TODO"); throw new RuntimeException("TODO");
});
} }
// TODO: This is an example of how to create a RestTemplate for the service to access the LMS API // TODO: This is an example of how to create a RestTemplate for the service to access the LMS API