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

Commit 8be18a9

Browse files
committed
💡 Add documentation for restoring answer from server data in hparsons directory
1 parent e57add5 commit 8be18a9

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

runestone/hparsons/js/hparsons.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,9 +168,20 @@ export default class HParsons extends RunestoneBase {
168168
}
169169
// RunestoneBase: Sent when the server has data
170170
restoreAnswers(serverData) {
171+
// TODO: not tested with server data yet.
172+
// Server side data should be:
173+
/*
174+
{
175+
answer: Array<string>, // list of answer block content
176+
count: ?number // number of previous attempts if block-based feedback
177+
}
178+
*/
171179
if (serverData.answer){
172180
this.hparsonsInput.restoreAnswer(serverData.answer);
173181
}
182+
if (serverData.count) {
183+
this.feedbackController.checkCount = serverData.count;
184+
}
174185
}
175186
// RunestoneBase: Load what is in local storage
176187
checkLocalStorage() {

0 commit comments

Comments
 (0)