diff --git a/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/lms/impl/moodle/MoodleCourseAccess.java b/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/lms/impl/moodle/MoodleCourseAccess.java index c5eed8e4..7815ef03 100644 --- a/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/lms/impl/moodle/MoodleCourseAccess.java +++ b/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/lms/impl/moodle/MoodleCourseAccess.java @@ -21,6 +21,7 @@ import java.util.regex.Pattern; import java.util.stream.Collectors; import java.util.stream.Stream; +import org.apache.commons.lang3.BooleanUtils; import org.apache.commons.lang3.StringUtils; import org.joda.time.DateTime; import org.slf4j.Logger; @@ -94,6 +95,7 @@ public class MoodleCourseAccess extends AbstractCourseAccess { private final MoodleRestTemplateFactory moodleRestTemplateFactory; private final MoodleCourseDataAsyncLoader moodleCourseDataAsyncLoader; private final CircuitBreaker> allQuizzesRequest; + private final boolean prependShortCourseName; private MoodleAPIRestTemplate restTemplate; @@ -122,6 +124,10 @@ public class MoodleCourseAccess extends AbstractCourseAccess { "sebserver.webservice.circuitbreaker.allQuizzesRequest.timeToRecover", Long.class, Constants.MINUTE_IN_MILLIS)); + + this.prependShortCourseName = BooleanUtils.toBoolean(environment.getProperty( + "sebserver.webservice.lms.moodle.prependShortCourseName", + Constants.TRUE_STRING)); } APITemplateDataSupplier getApiTemplateDataSupplier() { @@ -648,7 +654,9 @@ public class MoodleCourseAccess extends AbstractCourseAccess { lmsSetup.getInstitutionId(), lmsSetup.id, lmsSetup.getLmsType(), - courseQuizData.name, + (this.prependShortCourseName) + ? courseData.short_name + " : " + courseQuizData.name + : courseQuizData.name, Constants.EMPTY_NOTE, (courseQuizData.time_open != null && courseQuizData.time_open > 0) ? Utils.toDateTimeUTCUnix(courseQuizData.time_open) diff --git a/src/main/resources/config/application-ws.properties b/src/main/resources/config/application-ws.properties index b289725e..33f0a4ff 100644 --- a/src/main/resources/config/application-ws.properties +++ b/src/main/resources/config/application-ws.properties @@ -65,6 +65,7 @@ sebserver.webservice.api.pagination.maxPageSize=500 # comma separated list of known possible OpenEdX API access token request endpoints sebserver.webservice.lms.openedx.api.token.request.paths=/oauth2/access_token sebserver.webservice.lms.moodle.api.token.request.paths=/login/token.php +sebserver.webservice.lms.moodle.prependShortCourseName=true sebserver.webservice.lms.address.alias= sebserver.webservice.proctoring.resetBroadcastOnLeav=true diff --git a/src/main/resources/messages.properties b/src/main/resources/messages.properties index 4481c782..23b8a2a3 100644 --- a/src/main/resources/messages.properties +++ b/src/main/resources/messages.properties @@ -404,16 +404,16 @@ sebserver.quizdiscovery.quiz.details.url=Start URL sebserver.quizdiscovery.quiz.details.url.tooltip=The start URL on the LMS for the exam

This is defined by the LMS setup and the exam URL sebserver.quizdiscovery.quiz.details.additional.timecreated=Creation Time sebserver.quizdiscovery.quiz.details.additional.timecreated.tooltip=The time when the LMS exam was first created

This time is defined by the corresponding LMS -sebserver.quizdiscovery.quiz.details.additional.course_shortname=Short Name -sebserver.quizdiscovery.quiz.details.additional.course_shortname.tooltip=The short name of the LMS exam

This is defined on the corresponding LMS -sebserver.quizdiscovery.quiz.details.additional.course_fullname=Full Name -sebserver.quizdiscovery.quiz.details.additional.course_fullname.tooltip=The full name of the LMS exam

This is defined on the corresponding LMS -sebserver.quizdiscovery.quiz.details.additional.course_displayname=Display Name -sebserver.quizdiscovery.quiz.details.additional.course_displayname.tooltip=The display name of the LMS exam

This is defined on the corresponding LMS +sebserver.quizdiscovery.quiz.details.additional.course_short_name=Short Name +sebserver.quizdiscovery.quiz.details.additional.course_short_name.tooltip=The short name of the LMS exam

This is defined on the corresponding LMS +sebserver.quizdiscovery.quiz.details.additional.course_full_name=Full Name +sebserver.quizdiscovery.quiz.details.additional.course_full_name.tooltip=The full name of the LMS exam

This is defined on the corresponding LMS +sebserver.quizdiscovery.quiz.details.additional.course_display_name=Display Name +sebserver.quizdiscovery.quiz.details.additional.course_display_name.tooltip=The display name of the LMS exam

This is defined on the corresponding LMS sebserver.quizdiscovery.quiz.details.additional.course_summary=Summary sebserver.quizdiscovery.quiz.details.additional.course_summary.tooltip=The summary of the LMS exam

This is defined on the corresponding LMS -sebserver.quizdiscovery.quiz.details.additional.timelimit=Time Limit -sebserver.quizdiscovery.quiz.details.additional.timelimit.toolitp=The time limit of the LMS exam

This is defined on the corresponding LMS +sebserver.quizdiscovery.quiz.details.additional.time_limit=Time Limit +sebserver.quizdiscovery.quiz.details.additional.time_limit.toolitp=The time limit of the LMS exam

This is defined on the corresponding LMS ################################ # Exam