Retrieve start_url from Ans Assignment

This commit is contained in:
Carol Alexandru 2021-08-30 03:54:31 +02:00
parent b767178d75
commit 6e31ad5e0e
2 changed files with 10 additions and 5 deletions

View file

@ -259,16 +259,15 @@ public class AnsLmsAPITemplate extends AbstractCachedCourseAccess implements Lms
lmsSetup.id, lmsSetup.id,
lmsSetup.getLmsType(), lmsSetup.getLmsType(),
String.format("%s", a.name), String.format("%s", a.name),
String.format(""), // TODO: what to show here? String.format(""),
startTime, startTime,
endTime, endTime,
// TODO: Waiting for Ans to implement supplying of the correct URL a.start_url,
String.format("not implemented by Ans"),
Map.of("assignment_id", String.valueOf(a.id))); Map.of("assignment_id", String.valueOf(a.id)));
} }
private List<AssignmentData> getAssignments(final RestTemplate restTemplate) { private List<AssignmentData> getAssignments(final RestTemplate restTemplate) {
// TODO: at the moment, seb_server_enabled cannot be set inside the Ans GUI, // NOTE: at the moment, seb_server_enabled cannot be set inside the Ans GUI,
// only via the API, so we need to list all assignments. Maybe in the future, // only via the API, so we need to list all assignments. Maybe in the future,
// we can only list those for which seb server has been enabled in Ans (like in OLAT): // we can only list those for which seb server has been enabled in Ans (like in OLAT):
//final String url = "/api/v2/search/assignments?query=seb_server_enabled:true"; //final String url = "/api/v2/search/assignments?query=seb_server_enabled:true";

View file

@ -35,6 +35,8 @@ public final class AnsLmsData {
"end_at": "2021-08-18T12:00:00.000+02:00", "end_at": "2021-08-18T12:00:00.000+02:00",
"created_at": "2021-06-21T12:24:28.538+02:00", "created_at": "2021-06-21T12:24:28.538+02:00",
"updated_at": "2021-08-17T03:41:56.747+02:00", "updated_at": "2021-08-17T03:41:56.747+02:00",
"trashed": false,
"start_url": "https://staging.ans.app/digital_test/assignments/78805/results/new",
"accessibility_settings": { "accessibility_settings": {
"attempts": 1, "attempts": 1,
"restricted_access_to_other_pages": false, "restricted_access_to_other_pages": false,
@ -43,7 +45,10 @@ public final class AnsLmsData {
"feedback": false, "feedback": false,
"forced_test_navigation": false, "forced_test_navigation": false,
"cannot_reopen_question_groups": false, "cannot_reopen_question_groups": false,
"seb_server_enabled": true "seb_server_enabled": true,
"config_keys": [
"9dd14ac828617116a1230c71b9a1aa9e06f43b32d9fa7db67f4fa113a6896e83e"
]
}, },
"grades_settings": { "grades_settings": {
"grade_calculation": "formula", "grade_calculation": "formula",
@ -64,6 +69,7 @@ public final class AnsLmsData {
public String external_id; public String external_id;
public String start_at; public String start_at;
public String end_at; public String end_at;
public String start_url;
public AccessibilitySettingsData accessibility_settings; public AccessibilitySettingsData accessibility_settings;
} }