generate proper exam url using updated OLAT api
This commit is contained in:
parent
cdd393aecd
commit
ae5149226a
2 changed files with 13 additions and 11 deletions
|
@ -252,7 +252,7 @@ public class OlatLmsAPITemplate extends AbstractCachedCourseAccess implements Lm
|
||||||
final List<AssessmentData> as = this.apiGetList(restTemplate, url, new ParameterizedTypeReference<List<AssessmentData>>(){});
|
final List<AssessmentData> as = this.apiGetList(restTemplate, url, new ParameterizedTypeReference<List<AssessmentData>>(){});
|
||||||
return as.stream()
|
return as.stream()
|
||||||
.map(a -> new QuizData(
|
.map(a -> new QuizData(
|
||||||
String.format("%d", a.key),
|
String.format("%d", a.assessmentModeKey),
|
||||||
lmsSetup.getInstitutionId(),
|
lmsSetup.getInstitutionId(),
|
||||||
lmsSetup.id,
|
lmsSetup.id,
|
||||||
lmsSetup.getLmsType(),
|
lmsSetup.getLmsType(),
|
||||||
|
@ -260,7 +260,7 @@ public class OlatLmsAPITemplate extends AbstractCachedCourseAccess implements Lm
|
||||||
a.description,
|
a.description,
|
||||||
Utils.toDateTimeUTC(a.dateFrom),
|
Utils.toDateTimeUTC(a.dateFrom),
|
||||||
Utils.toDateTimeUTC(a.dateTo),
|
Utils.toDateTimeUTC(a.dateTo),
|
||||||
examUrl(a.key),
|
examUrl(a.repositoryEntryKey),
|
||||||
new HashMap<String, String>()))
|
new HashMap<String, String>()))
|
||||||
.collect(Collectors.toList());
|
.collect(Collectors.toList());
|
||||||
}
|
}
|
||||||
|
@ -283,7 +283,7 @@ public class OlatLmsAPITemplate extends AbstractCachedCourseAccess implements Lm
|
||||||
final String url = String.format("/restapi/assessment_modes/%s", id);
|
final String url = String.format("/restapi/assessment_modes/%s", id);
|
||||||
final AssessmentData a = this.apiGet(restTemplate, url, AssessmentData.class);
|
final AssessmentData a = this.apiGet(restTemplate, url, AssessmentData.class);
|
||||||
return new QuizData(
|
return new QuizData(
|
||||||
String.format("%d", a.key),
|
String.format("%d", a.assessmentModeKey),
|
||||||
lmsSetup.getInstitutionId(),
|
lmsSetup.getInstitutionId(),
|
||||||
lmsSetup.id,
|
lmsSetup.id,
|
||||||
lmsSetup.getLmsType(),
|
lmsSetup.getLmsType(),
|
||||||
|
@ -291,7 +291,7 @@ public class OlatLmsAPITemplate extends AbstractCachedCourseAccess implements Lm
|
||||||
a.description,
|
a.description,
|
||||||
Utils.toDateTimeUTC(a.dateFrom),
|
Utils.toDateTimeUTC(a.dateFrom),
|
||||||
Utils.toDateTimeUTC(a.dateTo),
|
Utils.toDateTimeUTC(a.dateTo),
|
||||||
examUrl(a.key),
|
examUrl(a.repositoryEntryKey),
|
||||||
new HashMap<String, String>());
|
new HashMap<String, String>());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -19,15 +19,17 @@ public final class OlatLmsData {
|
||||||
static public final class AssessmentData {
|
static public final class AssessmentData {
|
||||||
/* OLAT API example:
|
/* OLAT API example:
|
||||||
{
|
{
|
||||||
"key":7405568,
|
"courseName": "course 1",
|
||||||
"name":"Test1",
|
"dateFrom": 1624420800000,
|
||||||
|
"dateTo": 1624658400000,
|
||||||
"description": "",
|
"description": "",
|
||||||
"courseName":"test",
|
"assessmentModeKey": 6356992,
|
||||||
"dateFrom":1626515100000,
|
“repositoryEntryKey”: 462324,
|
||||||
"dateTo":1626523260000
|
"name": "SEB test"
|
||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
public long key;
|
public long assessmentModeKey;
|
||||||
|
public long repositoryEntryKey;
|
||||||
public String name;
|
public String name;
|
||||||
public String description;
|
public String description;
|
||||||
public String courseName;
|
public String courseName;
|
||||||
|
|
Loading…
Add table
Reference in a new issue