Merge remote-tracking branch 'origin/dev-1.3' into development
Conflicts: src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/exam/impl/ExamAdminServiceImpl.java
This commit is contained in:
commit
22c0dd872d
1 changed files with 11 additions and 1 deletions
|
@ -34,11 +34,21 @@ public interface SEBRestrictionAPI {
|
|||
Result<SEBRestriction> getSEBClientRestriction(Exam exam);
|
||||
|
||||
/** Use this to check if there is a SEB restriction available on the LMS for the specified exam.
|
||||
*
|
||||
* A SEB Restriction is available if there it can get from LMS and if there is either a Config-Key
|
||||
* or a BrowserExam-Key set or both. If none of this keys is set, the SEB Restriction is been
|
||||
* considdered to not set on the LMS.
|
||||
*
|
||||
* @param exam exam the exam to get the SEB restriction data for
|
||||
* @return true if there is a SEB restriction set on the LMS for the exam or false otherwise */
|
||||
default boolean hasSEBClientRestriction(final Exam exam) {
|
||||
return getSEBClientRestriction(exam).hasError();
|
||||
final Result<SEBRestriction> sebClientRestriction = getSEBClientRestriction(exam);
|
||||
if (sebClientRestriction.hasError()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
final SEBRestriction sebRestriction = sebClientRestriction.get();
|
||||
return !sebRestriction.configKeys.isEmpty() || !sebRestriction.browserExamKeys.isEmpty();
|
||||
}
|
||||
|
||||
/** Applies SEB Client restrictions to the LMS with the given attributes.
|
||||
|
|
Loading…
Reference in a new issue