You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jun 7, 2023. It is now read-only.
Copy file name to clipboardExpand all lines: runestone/common/js/runestonebase.js
+16-10Lines changed: 16 additions & 10 deletions
Original file line number
Diff line number
Diff line change
@@ -60,10 +60,10 @@ export default class RunestoneBase {
60
60
});
61
61
}
62
62
63
-
// .. _logBookEvent:
64
-
//
65
-
// logBookEvent
66
-
// ------------
63
+
// .. _logBookEvent:
64
+
//
65
+
// logBookEvent
66
+
// ------------
67
67
// This function sends the provided ``eventInfo`` to the `hsblog endpoint` of the server. Awaiting this function returns either ``undefined`` (if Runestone services are not available) or the data returned by the server as a JavaScript object (already JSON-decoded).
68
68
asynclogBookEvent(eventInfo){
69
69
if(this.graderactive){
@@ -99,10 +99,10 @@ export default class RunestoneBase {
99
99
returnpost_return;
100
100
}
101
101
102
-
// .. _logRunEvent:
103
-
//
104
-
// logRunEvent
105
-
// -----------
102
+
// .. _logRunEvent:
103
+
//
104
+
// logRunEvent
105
+
// -----------
106
106
// This function sends the provided ``eventInfo`` to the `runlog endpoint`. When awaited, this function returns the data (decoded from JSON) the server sent back.
107
107
asynclogRunEvent(eventInfo){
108
108
letpost_promise="done";
@@ -121,8 +121,8 @@ export default class RunestoneBase {
121
121
headers: this.jsonHeaders,
122
122
body: JSON.stringify(eventInfo),
123
123
});
124
-
post_promise=awaitfetch(request);
125
-
if(!post_promise.ok){
124
+
letresponse=awaitfetch(request);
125
+
if(!response.ok){
126
126
thrownewError("Failed to log the run");
127
127
}
128
128
post_promise=awaitresponse.json();
@@ -139,6 +139,10 @@ export default class RunestoneBase {
0 commit comments