@@ -5,6 +5,12 @@ import BlockFeedback from "./BlockFeedback.js";
55import SQLFeedback from "./SQLFeedback.js" ;
66import { InitMicroParsons } from 'micro-parsons/micro-parsons/micro-parsons.js' ;
77import 'micro-parsons/micro-parsons/micro-parsons.css' ;
8+ // If you need to debug something in the micro-parsons library then
9+ // gh repo clone amy21206/micro-parsons-element
10+ // run npm install and npm build
11+ // copy everything from bin into the hparsons/js folder and build the components.
12+ /*import {InitMicroParsons} from './micro-parsons.js';
13+ import './micro-parsons.css';*/
814
915export var hpList ;
1016// Dictionary that contains all instances of horizontal Parsons problem objects
@@ -32,7 +38,7 @@ export default class HParsons extends RunestoneBase {
3238 // Set the storageId (key for storing data)
3339 var storageId = super . localStorageKey ( ) ;
3440 this . storageId = storageId ;
35-
41+
3642 this . origElem = orig ;
3743 this . origText = this . origElem . textContent ;
3844 this . code = $ ( orig ) . text ( ) || "\n\n\n\n\n" ;
@@ -76,7 +82,7 @@ export default class HParsons extends RunestoneBase {
7682
7783 // initializing functionalities for different feedback
7884 this . feedbackController . init ( ) ;
79- this . checkServer ( 'hparsons ' , true ) ;
85+ this . checkServer ( 'hparsonsAnswer ' , true ) ;
8086 }
8187
8288 // copied from activecode, already modified to add parsons
@@ -152,7 +158,7 @@ export default class HParsons extends RunestoneBase {
152158 }
153159
154160 // Return previous answers in local storage
155- //
161+ //
156162 localData ( ) {
157163 var data = localStorage . getItem ( this . storageId ) ;
158164 if ( data !== null ) {
@@ -168,7 +174,7 @@ export default class HParsons extends RunestoneBase {
168174 }
169175 // RunestoneBase: Sent when the server has data
170176 restoreAnswers ( serverData ) {
171- // TODO: not tested with server data yet.
177+ // TODO: not tested with server data yet.
172178 // Server side data should be:
173179 /*
174180 {
@@ -177,7 +183,7 @@ export default class HParsons extends RunestoneBase {
177183 }
178184 */
179185 if ( serverData . answer ) {
180- this . hparsonsInput . restoreAnswer ( serverData . answer ) ;
186+ this . hparsonsInput . restoreAnswer ( serverData . answer . blocks ) ;
181187 }
182188 if ( serverData . count ) {
183189 this . feedbackController . checkCount = serverData . count ;
0 commit comments