Skip to content
This repository was archived by the owner on Jun 7, 2023. It is now read-only.

Commit 1483db5

Browse files
committed
Testing and fixes
1 parent 9336f63 commit 1483db5

2 files changed

Lines changed: 19 additions & 2 deletions

File tree

runestone/fitb/js/fitb.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ export default class FITB extends RunestoneBase {
203203
}
204204
}
205205

206-
async logCurrentAnswer() {
206+
async logCurrentAnswer(sid) {
207207
let answer = JSON.stringify(this.given_arr);
208208
// Save the answer locally.
209209
let feedback = true;

runestone/groupsub/js/groupsub.js

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,23 @@ class GroupSub extends RunestoneBase {
4343
// get the classlist to populate
4444
if (eBookConfig.useRunestoneServices) {
4545
// get classlist from admin/course_students
46+
let request = new Request("/runestone/admin/course_students", {
47+
method: "GET",
48+
headers: this.jsonHeaders,
49+
});
50+
try {
51+
let response = await fetch(request);
52+
if (!response.ok) {
53+
throw new Error("Failed to save the log entry");
54+
}
55+
this.studentList = await response.json();
56+
} catch (e) {
57+
if (this.isTimed) {
58+
alert(`Error: Your action was not saved! The error was ${e}`);
59+
}
60+
console.log(`Error: ${e}`);
61+
}
62+
4663
} else {
4764
this.studentList = {
4865
s1: "User 1",
@@ -77,7 +94,7 @@ class GroupSub extends RunestoneBase {
7794
}
7895
// If the leader forgets to add themselves, add them here.
7996
let username = eBookConfig.username;
80-
if (username && !(username in group)) {
97+
if (username && !group.includes(username)) {
8198
group.push(username)
8299
}
83100
if (group.len > this.limit) {

0 commit comments

Comments
 (0)