@@ -276,7 +276,7 @@ export default class ClickableArea extends RunestoneBase {
276276 if (
277277 this . ccIndex < this . ccArray . length &&
278278 this . ccCounter ===
279- Math . floor ( this . ccArray [ this . ccIndex ] . split ( "," ) [ 0 ] ) &&
279+ Math . floor ( this . ccArray [ this . ccIndex ] . split ( "," ) [ 0 ] ) &&
280280 Math . floor ( this . ccArray [ this . ccIndex ] . split ( "," ) [ 1 ] ) === 0
281281 ) {
282282 this . manageNewClickable ( tComponentArr [ t ] . children [ i ] ) ;
@@ -285,7 +285,7 @@ export default class ClickableArea extends RunestoneBase {
285285 } else if (
286286 this . ciIndex < this . ciArray . length &&
287287 this . ccCounter ===
288- Math . floor ( this . ciArray [ this . ciIndex ] . split ( "," ) [ 0 ] ) &&
288+ Math . floor ( this . ciArray [ this . ciIndex ] . split ( "," ) [ 0 ] ) &&
289289 Math . floor ( this . ciArray [ this . ciIndex ] . split ( "," ) [ 1 ] ) === 0
290290 ) {
291291 this . manageNewClickable ( tComponentArr [ t ] . children [ i ] ) ;
@@ -302,13 +302,13 @@ export default class ClickableArea extends RunestoneBase {
302302 if (
303303 this . ccIndex < this . ccArray . length &&
304304 tmp ===
305- Math . floor (
306- this . ccArray [ this . ccIndex ] . split ( "," ) [ 1 ]
307- ) &&
305+ Math . floor (
306+ this . ccArray [ this . ccIndex ] . split ( "," ) [ 1 ]
307+ ) &&
308308 this . ccCounter ===
309- Math . floor (
310- this . ccArray [ this . ccIndex ] . split ( "," ) [ 0 ]
311- )
309+ Math . floor (
310+ this . ccArray [ this . ccIndex ] . split ( "," ) [ 0 ]
311+ )
312312 ) {
313313 this . manageNewClickable (
314314 tComponentArr [ t ] . children [ i ] . children [ j ]
@@ -320,13 +320,13 @@ export default class ClickableArea extends RunestoneBase {
320320 } else if (
321321 this . ciIndex < this . ciArray . length &&
322322 tmp ===
323- Math . floor (
324- this . ciArray [ this . ciIndex ] . split ( "," ) [ 1 ]
325- ) &&
323+ Math . floor (
324+ this . ciArray [ this . ciIndex ] . split ( "," ) [ 1 ]
325+ ) &&
326326 this . ccCounter ===
327- Math . floor (
328- this . ciArray [ this . ciIndex ] . split ( "," ) [ 0 ]
329- )
327+ Math . floor (
328+ this . ciArray [ this . ciIndex ] . split ( "," ) [ 0 ]
329+ )
330330 ) {
331331 this . manageNewClickable (
332332 tComponentArr [ t ] . children [ i ] . children [ j ]
@@ -399,13 +399,17 @@ export default class ClickableArea extends RunestoneBase {
399399 this . setLocalStorage ( { correct : this . correct ? "T" : "F" } ) ;
400400 }
401401
402- logCurrentAnswer ( ) {
403- this . logBookEvent ( {
402+ async logCurrentAnswer ( sid ) {
403+ let data = {
404404 event : "clickableArea" ,
405405 act : this . givenIndexArray . join ( ";" ) ,
406406 div_id : this . divid ,
407407 correct : this . correct ? "T" : "F" ,
408- } ) ;
408+ } ;
409+ if ( typeof sid !== "undefined" ) {
410+ data . sid = sid ;
411+ }
412+ await this . logBookEvent ( data ) ;
409413 }
410414
411415 renderFeedback ( ) {
@@ -424,15 +428,15 @@ export default class ClickableArea extends RunestoneBase {
424428 }
425429 $ ( this . feedBackDiv ) . html (
426430 "Incorrect. You clicked on " +
427- this . correctNum +
428- " of the " +
429- this . correctArray . length . toString ( ) +
430- " correct elements and " +
431- this . incorrectNum +
432- " of the " +
433- this . incorrectArray . length . toString ( ) +
434- " incorrect elements. " +
435- this . feedback
431+ this . correctNum +
432+ " of the " +
433+ this . correctArray . length . toString ( ) +
434+ " correct elements and " +
435+ this . incorrectNum +
436+ " of the " +
437+ this . incorrectArray . length . toString ( ) +
438+ " incorrect elements. " +
439+ this . feedback
436440 ) ;
437441 $ ( this . feedBackDiv ) . attr ( "class" , "alert alert-danger" ) ;
438442 }
0 commit comments