diff --git a/README.rst b/README.rst index 9d34656a..d36ebd4f 100644 --- a/README.rst +++ b/README.rst @@ -98,8 +98,6 @@ Bugfixes: Docker-Image: -TODO - SEB - SEB Server Compatibility ------------------------------ diff --git a/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/lms/impl/moodle/plugin/MoodlePluginCourseAccess.java b/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/lms/impl/moodle/plugin/MoodlePluginCourseAccess.java index d1028a6b..22046ba5 100644 --- a/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/lms/impl/moodle/plugin/MoodlePluginCourseAccess.java +++ b/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/lms/impl/moodle/plugin/MoodlePluginCourseAccess.java @@ -82,6 +82,9 @@ public class MoodlePluginCourseAccess extends AbstractCachedCourseAccess impleme public static final String PARAM_PAGE_START = "startneedle"; public static final String PARAM_PAGE_SIZE = "perpage"; + public static final String SQL_QUIZ_NAME = "m.name"; + public static final String SQL_COURSE_NAME = "shortname"; + public static final String SQL_CONDITION_TEMPLATE = //"(startdate >= %s or timecreated >=%s) and (enddate is null or enddate = 0 or enddate >= %s)"; "(startdate is null OR startdate = 0 OR startdate >= %s) AND (enddate is null or enddate = 0 OR enddate >= %s)"; @@ -432,9 +435,13 @@ public class MoodlePluginCourseAccess extends AbstractCachedCourseAccess impleme final LinkedMultiValueMap attributes = new LinkedMultiValueMap<>(); if (this.applyNameCriteria && StringUtils.isNotBlank(nameCondition)) { - sqlCondition = sqlCondition + " AND (name LIKE '" + + sqlCondition = sqlCondition + " AND (" + + SQL_QUIZ_NAME + + " LIKE '" + Utils.toSQLWildcard(nameCondition) + - "' OR shortname LIKE '" + + "' OR " + + SQL_COURSE_NAME + + " LIKE '" + Utils.toSQLWildcard(nameCondition) + "')"; }