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
+15-5Lines changed: 15 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -57,7 +57,11 @@ export default class RunestoneBase {
57
57
}
58
58
}
59
59
60
-
// 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).
60
+
// .. _logBookEvent:
61
+
//
62
+
// logBookEvent
63
+
// ------------
64
+
// 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).
61
65
asynclogBookEvent(eventInfo){
62
66
if(this.graderactive){
63
67
return;
@@ -95,8 +99,14 @@ export default class RunestoneBase {
95
99
}
96
100
returnpost_return;
97
101
}
102
+
103
+
// .. _logRunEvent:
104
+
//
105
+
// logRunEvent
106
+
// -----------
107
+
// This function sends the provided ``eventInfo`` to the `runlog endpoint`. When awaited, this function returns the data (decoded from JSON) the server sent back.
98
108
asynclogRunEvent(eventInfo){
99
-
letpost_promise=Promise.resolve("done");
109
+
letpost_promise="done";
100
110
if(this.graderactive){
101
111
return;
102
112
}
@@ -116,11 +126,11 @@ export default class RunestoneBase {
Copy file name to clipboardExpand all lines: runestone/overview.rst
+22-24Lines changed: 22 additions & 24 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,27 +3,27 @@ Consistent Component API
3
3
4
4
A standardized API will make the Runestone Components easier to work on and more maintainable. For example in trying to find out how to JUST score a component in a timed exam (not render any feedback) I found the following methods:
5
5
6
-
* processXXXSubmissions - mchoice
7
-
* startEvaluation - fitb
8
-
* dragEval - dragndrop
9
-
* checkMe - parsons
10
-
* clickableEval - clickaablearea
11
-
* activecode - runProg
12
-
* submitJournal - short answer
6
+
* processXXXSubmissions - mchoice
7
+
* startEvaluation - fitb
8
+
* dragEval - dragndrop
9
+
* checkMe - parsons
10
+
* clickableEval - clickaablearea
11
+
* activecode - runProg
12
+
* submitJournal - short answer
13
13
14
14
All of the above mix the scoring of the component with rendering the feedback. I would like to separate those two things and standardize on some names for doing so.
15
15
16
16
Base Class Provides
17
17
-------------------
18
-
* shouldUseServer
19
-
* checkServer
20
-
* logRunEvent
21
-
* logBookEvent
22
-
* loadData
23
-
* repopulateFromStorage
24
-
* localStorageKey
25
-
* addCaption
26
-
* constructor that takes opts
18
+
* shouldUseServer
19
+
* checkServer
20
+
* `logRunEvent` - send the results of executing an ActiveCode exercise to the `runlog endpoint`.
21
+
* `logBookEvent` - send the results of answering a question to the `hsblog endpoint`.
22
+
* loadData
23
+
* repopulateFromStorage
24
+
* localStorageKey
25
+
* addCaption
26
+
* constructor that takes opts
27
27
28
28
All Components
29
29
--------------
@@ -33,14 +33,12 @@ All Components
33
33
* setLocalStorage
34
34
* checkLocalStorage
35
35
* hasUserActivity
36
-
*
37
-
Gradable
38
-
--------
39
36
37
+
Gradable
38
+
--------
40
39
Each Gradable should provide these three functions as an external API. We want to separate checking, from logging and providing feedback
41
-
* checkCurrentAnswer - async? so that for server side grading we can await
42
-
* logCurrentAnswer
43
-
* renderFeedback
44
-
* disableInteraction
45
-
46
40
41
+
* checkCurrentAnswer - async? so that for server side grading we can await
0 commit comments