This repository was archived by the owner on Jun 7, 2023. It is now read-only.
File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff 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 ;
Original file line number Diff line number Diff 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 ) {
You can’t perform that action at this time.
0 commit comments