-
Notifications
You must be signed in to change notification settings - Fork 0
/
Question.js
1298 lines (1298 loc) · 69.8 KB
/
Question.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
cp.QuizButtonCH = function(a) {
if (!cp.disableInteractions) {
a.stopPropagation && a.stopPropagation();
var c = a.target.id,
a = a.target,
b = cp.D[c];
b && (b.sicbs && void 0 !== b.bstiid && -1 !== b.bstiid) && (c = cp.getDisplayObjNameByCP_UID(b.bstiid), a = cp(c));
c = cp.D[c].chfn;
c(a)
}
};
cp.QuestionSlideReviewLabel = function(a, c) {
cp.QuestionSlideReviewLabel.baseConstructor.call(this, a);
this.textAlign = this.getAttribute("ta");
this.bold = this.getAttribute("B");
this.color = this.getAttribute("c");
this.font = this.getAttribute("f");
this.italic = this.getAttribute("i");
this.size = this.getAttribute("sz");
this.underline = this.getAttribute("u");
this.id = this.getAttribute("id");
this.canvasObj = cp.D[this.element.id];
this.visible = this.getAttribute("visible");
this.re = this.getAttribute("re");
this.sh = this.getAttribute("sh");
var b = this.getAttribute("b");
this.parentDivName = this.getAttribute("dn");
this.relatedQuestionSlide = this.getAttribute("rqs");
cp.responsive && (this.responsiveCSS = this.getAttribute("css"));
if (void 0 != this.relatedQuestionSlide) {
var d = cp.getQuestionObject(this.relatedQuestionSlide);
void 0 != d && (d.m_correctFeedbackText = this.getAttribute("cf"), d.m_partialCorrectFeedbackText = this.getAttribute("pcf"), d.m_incorrectDisplayChosenText = this.getAttribute("idc"), d.m_incorrectDisplayCorrectText = this.getAttribute("ict"))
}
this.bounds = {
minX: b[0],
minY: b[1],
maxX: b[2],
maxY: b[3]
};
b = this.getAttribute("vb");
this.vbounds = {
minX: b[0],
minY: b[1],
maxX: b[2],
maxY: b[3]
};
this.args = c;
this.element && (this.element.parentElement.drawingBoard = this.element.parentElement, this.element.parentElement.bounds = this.bounds);
this.isDrawn = !1
};
cp.inherits(cp.QuestionSlideReviewLabel, cp.DisplayObject);
cp.QuestionSlideReviewLabel.prototype.start = function(a) {
this.addIfNeeded();
if (!this.effectIsStarted || a) this.updateEffects(this.hasEffect), this.effectIsStarted = !0
};
cp.QuestionSlideReviewLabel.prototype.reset = function() {
delete cp.ropMap[this.element.id];
this.isDrawn = !1;
this.element.width = "0";
this.element.height = "0";
this.element.style.width = "0px";
this.element.style.height = "0px";
this.element.left = "0";
this.element.top = "0";
this.element.style.left = "0px";
this.element.style.top = "0px"
};
cp.QuestionSlideReviewLabel.prototype.drawForResponsive = function(a, c) {
var b = cp.getQuestionObject(this.relatedQuestionSlide);
if (!b || !b.getIsStarted() || !this.responsiveCSS) return !1;
if (this.isDrawn && !a) return !0;
var d = cp.getResponsiveCSS(this.responsiveCSS);
cp.getCSSFromLayouter(d, this);
var e = !1,
e = this.re || this.sh && !this.sh.i || this.fillOuterArea,
f = void 0 != this.tr;
if (this.currentCSS == d && !e && !f && !a) return !0;
this.currentCSS = d;
if (!cp.movie.playbackController) return !1;
e = cp.movie.playbackController.GetQuizController();
if (!e || !1 == e.GetIsInReviewMode()) return !1;
this.actualParent = cp(this.parentDivName);
if (!b.getIsIncomplete() || b.getIsSurvey() || b.getIsPretest()) return this.isDrawn = b.showCustomReviewArea(this.element.id), this.drawComplete(c), !0 == this.isDrawn;
this.zIndex = cp.D[this.parentDivName].zIndex;
cp.applyResponsiveStyles(this.element.parentElement, d, !0);
this.element.parentElement.offsetHeight = this.element.parentElement.offsetHeight;
this.actualParentClientBoundingRect = this.element.parentElement.getBoundingClientRect();
e = cp("re-" + this.element.id);
e || (e = cp.newElem("div"), e.id = "re-" + this.element.id, cp.fixWebkitScaling(e), cp.addRewrapObjectAsPerRestOfProjectItem(e));
cp.applyResponsiveStyles(e, d, !0);
e.offsetHeight = e.offsetHeight;
this.parentElementClientBoundingRect = e.getBoundingClientRect();
this.element.style.left = "0px";
this.element.style.top = "0px";
this.element.style.width = "100%";
this.element.style.height = "100%";
this.isDrawn || (this.sh && (this.element.style.textShadow = (this.sh.i ? "inset " : "") + this.sh.d * Math.cos(Math.PI *
this.sh.a / 180) + "px " + this.sh.d * Math.sin(Math.PI * this.sh.a / 180) + "px " + this.sh.b + "px " + cp.ConvertRGBToRGBA(this.sh.c, this.sh.o)), this.re && (e.style.webkitBoxReflect = "below " + this.re.d + "px -webkit-gradient(linear, left top, left bottom, from(transparent), color-stop(" + (1 - this.re.s / 100) + ", transparent), to(rgba(255, 255, 255, " + (1 - this.re.p / 100) + ")))"), this.element.style.position = "absolute", this.visible = 1, this.text = b.getIsIncomplete() ? this.getAttribute("icf") : "", void 0 != this.getAttribute("accstr") && (this.element.setAttribute("tabIndex",
"-1"), this.element.setAttribute("aria-label", this.text), cp.removeAccessibilityOutline(this.element), this.element.setAttribute("role", "img")), "" == this.element.innerHTML && (this.element.innerHTML += this.text), this.element.parentNode.removeChild(this.element), e.setAttribute("class", "cp-rewrap"), e.style.zIndex = this.zIndex, e.appendChild(this.element));
b = this.getAttribute("rpfont")[cp.ResponsiveProjWidth].font;
this.element.style.fontWeight = b.B ? "bold" : "normal";
this.element.style.fontStyle = b.i ? "italic" : "normal";
this.element.style.textDecoration = b.u ? "underline" : "none";
this.element.style.color = b.c;
this.element.style.fontFamily = b.n;
this.element.style.fontSize = b.s + "px";
this.element.style.textAlign = this.textAlign;
this.element.style.verticalAlign = "middle";
this.isDrawn = !0;
this.drawComplete(c);
this.visible || cp.hide(this.parentDivName);
return !0
};
cp.QuestionSlideReviewLabel.prototype.addIfNeeded = function(a, c) {
if ((!cp.responsive || !this.drawForResponsive(a)) && !this.isDrawn) {
var b = cp.getQuestionObject(this.relatedQuestionSlide);
if (b && b.getIsStarted() && cp.movie.playbackController) {
var d = cp.movie.playbackController.GetQuizController();
d && !1 != d.GetIsInReviewMode() && ((this.actualParent = cp(this.parentDivName), !b.getIsIncomplete() || b.getIsSurvey() || b.getIsPretest()) ? (this.isDrawn = b.showCustomReviewArea(this.element.id), this.drawComplete(c)) : (this.zIndex =
cp.D[this.parentDivName].zIndex, d = cp.newElem("div"), d.id = "re-" + this.element.id, cp.fixWebkitScaling(d), d.style.position = "absolute", d.style.left = this.vbounds.minX + "px", d.style.top = this.vbounds.minY + "px", d.style.width = this.vbounds.maxX - this.vbounds.minX + "px", d.style.height = this.vbounds.maxY - this.vbounds.minY + "px", this.element.parentElement.style.position = "absolute", this.element.parentElement.style.left = this.bounds.minX + "px", this.element.parentElement.style.top = this.bounds.minY + "px", this.element.parentElement.style.width =
this.bounds.maxX - this.bounds.minX + "px", this.element.parentElement.style.height = this.bounds.maxY - this.bounds.minY + "px", this.element.style.left = "0px", this.element.style.top = "0px", this.element.style.width = "100%", this.element.style.height = "100%", this.sh && (this.element.style.textShadow = (this.sh.i ? "inset " : "") + this.sh.d * Math.cos(Math.PI * this.sh.a / 180) + "px " + this.sh.d * Math.sin(Math.PI * this.sh.a / 180) + "px " + this.sh.b + "px " + cp.ConvertRGBToRGBA(this.sh.c, this.sh.o)), this.re && (d.style.webkitBoxReflect = "below " +
this.re.d + "px -webkit-gradient(linear, left top, left bottom, from(transparent), color-stop(" + (1 - this.re.s / 100) + ", transparent), to(rgba(255, 255, 255, " + (1 - this.re.p / 100) + ")))"), this.element.style.position = "absolute", this.element.style.textAlign = this.textAlign, this.element.style.verticalAlign = "middle", this.visible = 1, this.text = b.getIsIncomplete() ? this.getAttribute("icf") : "", void 0 != this.getAttribute("accstr") && (this.element.setAttribute("tabIndex", "-1"), this.element.setAttribute("aria-label", this.text),
cp.removeAccessibilityOutline(this.element), this.element.setAttribute("role", "img")), this.element.style.color = this.color, this.element.style.fontFamily = this.font, this.element.style.fontSize = this.size + "px", this.element.style.fontWeight = this.bold ? "bold" : "normal", this.element.style.fontStyle = this.italic ? "italic" : "normal", this.element.style.textDecoration = this.underline ? "underline" : "none", "" == this.element.innerHTML && (this.element.innerHTML += this.text), this.element.parentNode.removeChild(this.element),
cp.addRewrapObjectAsPerRestOfProjectItem(d), d.setAttribute("class", "cp-rewrap"), d.appendChild(this.element), d.style.zIndex = this.zIndex, this.isDrawn = !0, this.drawComplete(c), this.visible || cp.hide(this.parentDivName)))
}
}
};
cp.ProgressSlideLabel = function(a, c) {
cp.ProgressSlideLabel.baseConstructor.call(this, a);
this.id = this.getAttribute("id");
this.visible = this.getAttribute("visible");
this.textAlign = this.getAttribute("ta");
this.bold = this.getAttribute("B");
this.color = this.getAttribute("c");
this.font = this.getAttribute("f");
this.italic = this.getAttribute("i");
this.size = this.getAttribute("sz");
this.underline = this.getAttribute("u");
this.quizParam = this.getAttribute("qp");
if (cp.movie.playbackController) {
var b = cp.movie.playbackController.GetQuizController();
b && (b.GetParameterValueByName(this.quizParam), this.relatedQuestionSlide = this.getAttribute("rqs"), cp.responsive && (this.responsiveCSS = this.getAttribute("css")), this.parentDivName = this.getAttribute("dn"), b = this.getAttribute("b"), this.bounds = {
minX: b[0],
minY: b[1],
maxX: b[2],
maxY: b[3]
}, this.tr = this.getAttribute("tr"), this.re = this.getAttribute("re"), this.sh = this.getAttribute("sh"), b = this.getAttribute("vb"), this.vbounds = {
minX: b[0],
minY: b[1],
maxX: b[2],
maxY: b[3]
}, this.element && (this.element.parentElement.drawingBoard =
this.element.parentElement, this.element.parentElement.bounds = this.bounds), this.args = c, this.isDrawn = !1)
}
};
cp.inherits(cp.ProgressSlideLabel, cp.DisplayObject);
cp.ProgressSlideLabel.prototype.start = function(a) {
this.addIfNeeded();
if (!this.effectIsStarted || a) this.updateEffects(this.hasEffect), this.effectIsStarted = !0
};
cp.ProgressSlideLabel.prototype.reset = function() {
delete cp.ropMap[this.element.id];
this.isDrawn = !1;
this.element.width = "0";
this.element.height = "0";
this.element.style.width = "0px";
this.element.style.height = "0px";
this.element.left = "0";
this.element.top = "0";
this.element.style.left = "0px";
this.element.style.top = "0px"
};
cp.ProgressSlideLabel.prototype.drawForResponsive = function(a) {
var c = cp.getQuestionObject(this.relatedQuestionSlide);
if (!c || !c.getIsStarted() || !this.responsiveCSS) return !1;
if (this.isDrawn && !a) return !0;
var b = cp.getResponsiveCSS(this.responsiveCSS);
cp.getCSSFromLayouter(b, this);
var d = !1,
d = this.re || this.sh && !this.sh.i || this.fillOuterArea,
e = void 0 != this.tr;
if (this.currentCSS == b && !d && !e && !a) return !0;
this.currentCSS = b;
var f = !0,
a = cp.D[this.parentDivName],
e = cp.D[a.mdi],
d = cp("re-" + this.element.id);
d || (d = cp.newElem("div"),
d.id = "re-" + this.element.id, cp.fixWebkitScaling(d), cp.addRewrapObjectAsPerRestOfProjectItem(d));
var h = b;
this.getAttribute("useV") && (h = cp.createResponsiveStyleObj(b, b.p, b.vl, b.vt, b.vr, b.vb, b.vw, b.vh, b.crop));
cp.applyResponsiveStyles(this.element.parentElement, b, f);
this.element.parentElement.offsetHeight = this.element.parentElement.offsetHeight;
this.parentElementClientBoundingRect = this.element.parentElement.getBoundingClientRect();
var g = 0;
this.tr && (g = cp.getAngleFromRotateStr(this.tr), f = cp.getCenterForRotation(this.element.parentElement),
g = cp.getBoundsForRotatedItem(this.element.parentElement.clientWidth, this.element.parentElement.clientHeight, f, g), h = cp.createResponsiveStyleObj(b, b.p, g.l, g.t, g.r, g.b, g.w, g.h, b.crop), cp.applyTransform(this.element, this.tr), g = cp.getAngleFromRotateStr(this.tr), this.element.tr = this.tr, this.element.parentElement.tr = this.tr, cp.applyTransform(this.element.parentElement, this.tr), f = !1);
cp.applyResponsiveStyles(d, h, f);
this.element.rotateAngle = g;
this.element.parentElement.rotateAngle = g;
this.element.style.left =
"0px";
this.element.style.top = "0px";
this.element.style.width = "100%";
this.element.style.height = "100%";
this.element.style.display = "block";
this.element.style.position = "absolute";
this.isDrawn || (this.text = this.getAttribute("text"), this.text = c ? c.getProgressString(this.text) : "", !0 === e.hasOwnProperty("accstr") && (c = document.getElementById(this.parentDivName), cp.createAlternativeAccessibleText(c, this.text, "img"), cp.removeAccessibilityOutline(c)), this.zIndex = a.zIndex, this.sh && (this.element.style.textShadow = this.sh.d *
Math.cos(Math.PI * this.sh.a / 180) + "px " + this.sh.d * Math.sin(Math.PI * this.sh.a / 180) + "px " + this.sh.b + "px " + cp.ConvertRGBToRGBA(this.sh.c, this.sh.o) + (this.sh.i ? " inset" : "")), this.re && (d.style.webkitBoxReflect = "below " + this.re.d + "px -webkit-gradient(linear, left top, left bottom, from(transparent), color-stop(" + (1 - this.re.s / 100) + ", transparent), to(rgba(255, 255, 255, " + (1 - this.re.p / 100) + ")))"), "" == this.element.innerHTML && (this.element.innerHTML += "<table style='width=100%;height:100%;'><tr style='width=100%;height:100%;'><td style='width=100%;height:100%;vertical-align:middle;'>" +
this.text + "</td></tr></table>"), this.element.parentNode.removeChild(this.element), d.setAttribute("class", "cp-rewrap"), d.appendChild(this.element), d.style.zIndex = this.zIndex);
c = this.getAttribute("rpfont")[cp.ResponsiveProjWidth].font;
this.element.style.fontWeight = c.B ? "bold" : "normal";
this.element.style.fontStyle = c.i ? "italic" : "normal";
this.element.style.textDecoration = c.u ? "underline" : "none";
this.element.style.color = c.c;
this.element.style.fontFamily = c.n;
this.element.style.fontSize = c.s + "px";
this.element.style.textAlign =
this.textAlign;
this.element.style.verticalAlign = "middle";
this.isDrawn = !0;
this.visible || cp.hide(this.parentDivName);
return !0
};
cp.ProgressSlideLabel.prototype.addIfNeeded = function(a) {
if (!cp.responsive || !this.drawForResponsive(a))
if ((a = cp.getQuestionObject(this.relatedQuestionSlide)) && a.getIsStarted() && !this.isDrawn) {
this.text = this.getAttribute("text");
this.text = a ? a.getProgressString(this.text) : "";
var a = this.bounds,
c = cp.D[this.parentDivName];
if (!0 === cp.D[c.mdi].hasOwnProperty("accstr")) {
var b = document.getElementById(this.parentDivName);
cp.createAlternativeAccessibleText(b, this.text, "img");
cp.removeAccessibilityOutline(b)
}
this.zIndex =
c.zIndex;
this.element.style.width = a.maxX - a.minX + "px";
this.element.style.height = a.maxY - a.minY + "px";
c = cp.newElem("div");
c.id = "re-" + this.element.id;
cp.fixWebkitScaling(c);
this.element.style.textAlign = this.textAlign;
this.element.style.verticalAlign = "middle";
b = 0;
this.tr && (cp.applyTransform(this.element, this.tr), b = cp.getAngleFromRotateStr(this.tr), this.element.tr = this.tr, this.element.parentElement.tr = this.tr, cp.applyTransform(this.element.parentElement, this.tr));
this.element.rotateAngle = b;
this.element.parentElement.rotateAngle =
b;
this.sh && (this.element.style.textShadow = this.sh.d * Math.cos(Math.PI * this.sh.a / 180) + "px " + this.sh.d * Math.sin(Math.PI * this.sh.a / 180) + "px " + this.sh.b + "px " + cp.ConvertRGBToRGBA(this.sh.c, this.sh.o) + (this.sh.i ? " inset" : ""));
this.re && (c.style.webkitBoxReflect = "below " + this.re.d + "px -webkit-gradient(linear, left top, left bottom, from(transparent), color-stop(" + (1 - this.re.s / 100) + ", transparent), to(rgba(255, 255, 255, " + (1 - this.re.p / 100) + ")))");
this.element.parentElement.style.position = "absolute";
this.element.parentElement.style.left =
this.bounds.minX + "px";
this.element.parentElement.style.top = this.bounds.minY + "px";
this.element.parentElement.style.width = this.bounds.maxX - this.bounds.minX + "px";
this.element.parentElement.style.height = this.bounds.maxY - this.bounds.minY + "px";
c.style.position = "absolute";
c.style.left = this.vbounds.minX + "px";
c.style.top = this.vbounds.minY + "px";
c.style.width = this.vbounds.maxX - this.vbounds.minX + "px";
c.style.height = this.vbounds.maxY - this.vbounds.minY + "px";
this.element.style.marginLeft = -(this.vbounds.minX - a.minX) +
"px";
this.element.style.marginTop = -(this.vbounds.minY - a.minY) + "px";
this.element.style.display = "block";
this.element.style.position = "absolute";
this.element.style.color = this.color;
this.element.style.fontFamily = this.font;
this.element.style.fontSize = this.size + "px";
this.element.style.fontWeight = this.bold ? "bold" : "normal";
this.element.style.fontStyle = this.italic ? "italic" : "normal";
this.element.style.textDecoration = this.underline ? "underline" : "none";
"" == this.element.innerHTML && (this.element.innerHTML += "<table style='width=100%;height:100%;'><tr style='width=100%;height:100%;'><td style='width=100%;height:100%;vertical-align:middle;'>" +
this.text + "</td></tr></table>");
this.element.parentNode.removeChild(this.element);
cp.addRewrapObjectAsPerRestOfProjectItem(c);
c.setAttribute("class", "cp-rewrap");
c.appendChild(this.element);
c.style.zIndex = this.zIndex;
this.isDrawn = !0;
this.visible || cp.hide(this.parentDivName)
}
};
cp.Answer = function(a) {
cp.Answer.baseConstructor.call(this, a);
this.id = this.getAttribute("id");
this.type = this.getAttribute("type");
this.visible = this.getAttribute("visible");
this.answerID = this.getAttribute("aid");
this.relatedQuestionSlide = this.getAttribute("rqs");
this.m_questionObj = cp.getQuestionObject(this.relatedQuestionSlide);
if (cp.responsive && (a = cp.D[this.element.id])) this.answerAreaItemName = a.aan;
this.isDrawn = !1
};
cp.inherits(cp.Answer, cp.DisplayObject);
cp.Answer.prototype.start = function(a) {
this.addIfNeeded();
if (!this.effectIsStarted || a) this.updateEffects(this.hasEffect), this.effectIsStarted = !0
};
cp.Answer.prototype.reset = function() {
delete cp.ropMap[this.element.id];
this.isDrawn = !1;
this.element.width = "0";
this.element.height = "0";
this.element.style.width = "0px";
this.element.style.height = "0px";
this.element.left = "0";
this.element.top = "0";
this.element.style.left = "0px";
this.element.style.top = "0px"
};
cp.adjustPositionWithAnswerArea = function(a, c, b, d) {
if (cp.responsive && a && c && b) {
var e = cp(b),
f = cp.D[b],
b = 0;
f && !d && (b = cp.D[f.mdi].sw);
d = e.getBoundingClientRect();
e = cp.movie.stage.mainSlideDiv.getBoundingClientRect();
cp.applyResponsiveStyles(c, a);
var f = a.l,
h = a.t,
g = a.r,
a = a.b;
"auto" != f && (f = -1 != f.indexOf("%") ? cp.getRoundedValue(parseFloat(f) * e.width / 100) : parseFloat(f), d && (f += d.left + b - e.left), c.style.left = f + "px");
"auto" != h && (h = -1 != h.indexOf("%") ? cp.getRoundedValue(parseFloat(h) * e.height / 100) : parseFloat(h),
d && (h += d.top - e.top), c.style.top = h + "px");
"auto" != g && (g = -1 != g.indexOf("%") ? cp.getRoundedValue(parseFloat(g) * e.width / 100) : parseFloat(g), d && (g += e.right - d.right - b), c.style.right = g + "px");
"auto" != a && (a = -1 != a.indexOf("%") ? cp.getRoundedValue(parseFloat(a) * e.height / 100) : parseFloat(a), d && (a += e.bottom - d.bottom), c.style.bottom = a + "px")
}
};
cp.Answer.prototype.adjustPositionWithAnswerArea = function(a, c, b) {
cp.adjustPositionWithAnswerArea(a, c, this.answerAreaItemName, b)
};
cp.Answer.prototype.addIfNeeded = function() {};
cp.Answer.prototype.linkedItemDrawingCompleteHandler = function(a) {
if (cp.responsive && this.drawForResponsive)
if (this.answerAreaItemName) {
var c = cp.D[this.answerAreaItemName];
c && (c = cp.D[c.mdi], a.cpData && a.cpData.uid && a.cpData.uid == c.uid && (cp.verbose && cp.log("drawing " + this.element.id + ", for " + a.cpData.uid), this.drawForResponsive(!0, cp.ReasonForDrawing.kLinkedToItemAppeared)))
} else cp.Answer.superClass.linkedItemDrawingCompleteHandler.call(this, a)
};
cp.Answer.prototype.subscribeToItemDrawingCompleteHandler = function(a) {
if (cp.responsive)
if (this.answerAreaItemName) {
if (a = cp.D[this.answerAreaItemName])
if (a = cp.D[a.mdi]) {
var c = this;
(a = cp.getResponsiveCSS(a.css)) && (-1 != a.lhID || -1 != a.lvID) && cp.em.addEventListener(function(a) {
c.linkedItemDrawingCompleteHandler(a)
}, cp.ITEMDRAWINGCOMPLETEEVENT)
}
} else cp.Answer.superClass.subscribeToItemDrawingCompleteHandler.call(this, a)
};
cp.Question = function(a, c) {
if (cp.movie.playbackController && (this.m_quizController = cp.movie.playbackController.GetQuizController())) this.m_questionScore = void 0, this.wasJudged = !1, this.m_isSurvey = this.m_isTracked = !0, this.associatedObjName = c, this.m_slideIndex = -1, cp.movie.stage && (this.m_slideIndex = cp.movie.stage.getSlideIndexForName(c)), this.questionObjName = a, this.progressString = "", this.questionData = cp.D[this.questionObjName], this.latencyTimer = void 0, this.latency = 0, this.timer = void 0, this.score = this.timeBeforePause =
this.pausedMsecs = this.endTime = this.startTime = 0, this.m_selectedAnswersArr = [], this.isPartialScore = this.questionData.ips, this.timeLimit = this.questionData.tl, this.questionTextCanvasName = this.questionData.qtc, this.feedbackCaptionToBeShown = "", this.currentAttempt = 0, this.numberOfAttempts = this.questionData.noa, this.incorrectFeedbackCaptions = this.questionData.ifc, this.reviewModeBackButtonDivElement = this.reviewModeNextButtonDivElement = this.backButtonDivElement = this.skipButtonDivElement = this.clearButtonDivElement =
this.submitAllButtonDivElement = this.submitButtonDivElement = void 0, this.shouldReportAnswers = this.questionData.sra, this.lastFeedbackShown = void 0, this.QuestionStatusEnum || (this.QuestionStatusEnum = {}, this.QuestionStatusEnum.INCOMPLETE = cp.QuestionStatusEnum.INCOMPLETE, this.QuestionStatusEnum.INCORRECT = cp.QuestionStatusEnum.INCORRECT, this.QuestionStatusEnum.CORRECT = cp.QuestionStatusEnum.CORRECT, this.QuestionStatusEnum.PARTIAL_CORRECT = cp.QuestionStatusEnum.PARTIAL_CORRECT), this.m_QuestionStatus = this.QuestionStatusEnum.INCOMPLETE,
this.StateEnum || (this.StateEnum = {}, this.StateEnum.INIT = 0, this.StateEnum.PLAYING = 1, this.StateEnum.PAUSED = 2, this.StateEnum.ENDED = 3), this.state = this.StateEnum.INIT, this.QuestionScoringTypeEnum || (this.QuestionScoringTypeEnum = {}, this.QuestionScoringTypeEnum.SURVEY = 0, this.QuestionScoringTypeEnum.PRETEST = 1, this.QuestionScoringTypeEnum.GRADED = 2), this.m_scoringType = this.QuestionScoringTypeEnum.SURVEY, !0 == this.getIsPretest() ? this.m_scoringType = this.QuestionScoringTypeEnum.PRETEST : !0 == this.getIsSurvey() ? this.m_scoringType =
this.QuestionScoringTypeEnum.SURVEY : this.m_scoringType = this.QuestionScoringTypeEnum.GRADED, this.verbose = !1, this.shouldAddToTotal = !0, this.m_answersDisabled = this.m_isShuffled = !1, this.m_answerOrderArray = [], this.m_eachAnswerIsSeparateInteraction = this.m_isStarted = this.m_areButtonsDisabled = !1
};
cp.Question.prototype = {
shouldDisableOptions: function() {
var a = !1,
c = this.m_quizController.GetIsInReviewMode() && !this.getIsKnowledgeCheck(),
a = this.m_quizController.GetIsSubmitAll() && !this.getIsPretest(),
a = !this.m_quizController.GetIsAttemptFinished() && this.getWasJudged() && !a;
this.getIsPretest() && this.m_quizController.GetIsPretestQuestionsDisabled() && (a = !0);
return this.m_answersDisabled = a || c
},
showCustomReviewArea: function() {
return !1
},
getIsLastPretestQuestion: function() {
if (!this.getIsPretest()) return !1;
var a = this.m_slideIndex + 1;
return a >= cp.movie.stage.slides.length ? !0 : this.m_quizController ? (a = this.m_quizController.GetQuestionsOnSlide(a)) && 0 < a.length ? !a[0].getIsPretest() : !0 : !1
},
getAnswerOptions: function() {
var a = [],
c = this.questionData.ao;
if (!c || 0 >= c.length) return "";
for (var b = 0; b < c.length; ++b) {
var d = c[b].split(":");
a.push(d[0])
}
return a
},
setShouldAddToTotal: function(a) {
this.shouldAddToTotal = a
},
setQuestionStatus: function(a) {
this.m_QuestionStatus = a
},
getQuestionStatus: function() {
return this.m_QuestionStatus
},
getQuestionScoringType: function() {
return this.m_scoringType
},
getIsCorrect: function() {
return this.getQuestionStatus() == this.QuestionStatusEnum.CORRECT
},
getIsPartiallyCorrect: function() {
return this.getQuestionStatus() == this.QuestionStatusEnum.PARTIAL_CORRECT
},
getIsIncomplete: function() {
return this.getQuestionStatus() == this.QuestionStatusEnum.INCOMPLETE
},
getIsIncorrect: function() {
return this.getQuestionStatus() == this.QuestionStatusEnum.INCORRECT
},
registerSubmitButton: function(a, c) {
void 0 === c && (c = !1);
c || (this.submitButtonDivElement = a);
this.m_areButtonsDisabled ? this.disableButton(a) : this.enableButton(a)
},
registerSubmitAllButton: function(a, c) {
void 0 === c && (c = !1);
c || (this.submitAllButtonDivElement = a);
this.m_areButtonsDisabled ? this.disableButton(a) : this.enableButton(a)
},
registerSkipButton: function(a, c) {
void 0 === c && (c = !1);
c || (this.skipButtonDivElement = a);
if (this.shouldDisableSkipButton()) cp.disable(a.id), b = cp.D[a.id], b.shouldShowDisabledState = !0, a.disabled = "disabled", a.tabIndex = -1, a.onclick = "", cp.removeGestureEvent(a,
cp.GESTURE_EVENT_TYPES.TAP), a.style.cursor = "default";
else {
cp.enable(a.id);
var b = cp.D[a.id];
b.shouldShowDisabledState = !1;
a.disabled = !1;
a.style.cursor = "pointer";
cp.registerGestureEvent(a, cp.GESTURE_EVENT_TYPES.TAP, cp.QuizButtonCH)
}
},
registerClearButton: function(a, c) {
void 0 === c && (c = !1);
c || (this.clearButtonDivElement = a);
this.m_areButtonsDisabled ? this.disableButton(a) : this.enableButton(a)
},
registerBackButton: function(a, c) {
void 0 === c && (c = !1);
c || (this.backButtonDivElement = a);
this.enableButton(a)
},
registerReviewModeNextButton: function(a,
c) {
void 0 === c && (c = !1);
c || (this.reviewModeNextButtonDivElement = a);
if (this.shouldDisableReviewModeNextButton()) cp.disable(a.id), b = cp.D[a.id], b.shouldShowDisabledState = !0, a.disabled = "disabled", a.tabIndex = -1, a.onclick = "", cp.removeGestureEvent(a, cp.GESTURE_EVENT_TYPES.TAP), a.style.cursor = "default";
else {
cp.enable(a.id);
var b = cp.D[a.id];
b.shouldShowDisabledState = !1;
a.disabled = !1;
a.style.cursor = "pointer";
cp.registerGestureEvent(a, cp.GESTURE_EVENT_TYPES.TAP, cp.QuizButtonCH)
}
},
registerReviewModeBackButton: function(a,
c) {
void 0 === c && (c = !1);
c || (this.reviewModeBackButtonDivElement = a);
this.enableButton(a)
},
shouldShowSuccessCaption: function() {
return this.questionData.osct
},
shouldShowPartialCorrectCaption: function() {
return this.questionData.spcc
},
shouldShowFailureCaption: function() {
return this.questionData.ofct
},
shouldShowIncompleteCaption: function() {
return this.questionData.sic
},
shouldShowRetryCaption: function() {
return this.questionData.sfrc
},
shouldShowTimeOutCaption: function() {
return this.questionData.stfc
},
getSuccessCaptionName: function() {
return this.questionData.osc
},
getSuccessFeedback: function() {
var a = {};
a.name = this.getSuccessCaptionName();
a.action = this.getSuccessAction();
a.captionToBeShown = this.shouldShowSuccessCaption();
return a
},
getPartialCorrectCaptionName: function() {
return this.questionData.opcc
},
getPartialCorrectFeedback: function() {
var a = {};
a.name = this.getPartialCorrectCaptionName();
a.action = this.getSuccessAction();
a.captionToBeShown = this.shouldShowPartialCorrectCaption();
return a
},
getRetryCaptionName: function() {
return this.questionData.frc
},
getRetryFeedback: function() {
var a = {};
a.name = this.getRetryCaptionName();
a.action = "";
a.captionToBeShown = this.shouldShowRetryCaption();
return a
},
getFailureCaptionName: function(a) {
return this.incorrectFeedbackCaptions && 0 == this.incorrectFeedbackCaptions.length || a >= this.incorrectFeedbackCaptions.length || 0 > a ? void 0 : this.incorrectFeedbackCaptions[a]
},
getFailureFeedback: function(a) {
var c = {};
c.name = this.getFailureCaptionName(a);
this.currentAttempt >= this.numberOfAttempts ? (cp.verbose && cp.log("Last Attempt. Setting action now."), c.action = this.getFailureAction()) :
(cp.verbose && cp.log("Current Attempt :" + this.currentAttempt), c.action = "");
c.captionToBeShown = this.shouldShowFailureCaption();
return c
},
getIncompleteCaptionName: function() {
return this.questionData.oic
},
getIncompleteFeedback: function() {
var a = {};
a.name = this.getIncompleteCaptionName();
a.action = "";
a.captionToBeShown = this.shouldShowIncompleteCaption();
return a
},
getTimeOutCaptionName: function() {
return this.questionData.tfcn
},
getTimeOutFeedback: function() {
var a = {};
a.name = this.getTimeOutCaptionName();
a.action =
"cpCmndResume = 1;";
a.captionToBeShown = this.shouldShowTimeOutCaption();
return a
},
getSuccessAction: function() {
return this.questionData.oca
},
getFailureAction: function() {
return this.questionData.ofa
},
getSlideIndex: function() {
return this.m_slideIndex
},
resetQuestionData: function() {
this.score = this.latency = 0;
this.wasJudged = !1;
this.m_QuestionStatus = this.QuestionStatusEnum.INCOMPLETE;
this.setCurrentAttempt(0);
this.enableQuizButtons();
this.m_answersDisabled = !1;
this.m_questionScore && this.m_questionScore.resetScore()
},
setActionToBeExecuted: function(a) {
this.actionToBeExecuted = a
},
getActionToBeExecuted: function() {
return this.actionToBeExecuted
},
getName: function() {
return this.questionObjName
},
startLatency: function() {
if (!this.getWasJudged() && !this.m_quizController.GetIsInReviewMode()) {
this.latency = 0;
var a = this;
this.latencyTimer = setInterval(function() {
a.latencyTimer += 100
}, 100);
this.timeLimit && 0 < this.timeLimit && (this.timer = setTimeout(function() {
a.verbose && cp.log("Calling Timeout");
a.disableAllOptions();
a.stopLatencyTimer();
a.autoJudge()
}, this.timeLimit))
}
},
stopLatencyTimer: function() {
this.timer && (this.verbose && cp.log("Clearing Timeout"), clearTimeout(this.timer));
this.latencyTimer && clearInterval(this.latencyTimer)
},
getLatency: function() {
return this.latency = void 0 != this.startTime && 0 != this.startTime && void 0 != this.endTime && 0 != this.endTime ? this.endTime.getTime() - this.startTime.getTime() - this.pausedMsecs : 0
},
getAssociatedObjName: function() {
return this.associatedObjName
},
getQuestionType: function() {
return this.questionType =
this.questionData.qtp
},
getAnswerGroupName: function() {
return this.answerGroupName = this.questionData.gn
},
getQuestionText: function() {
this.questionText = this.questionData.qt;
if (cp.responsive) {
var a = cp.D[this.questionTextCanvasName];
if (a && (a = cp.D[a.dn])) this.questionText = a.rpvt[cp.responsiveWidths[cp.responsiveWidths.length - 1]].text
}
return this.questionText
},
getSelectedAnswerTextList: function() {
return ""
},
getExpectedCorrectAnswerTextList: function() {
return ""
},
getAnswerTexts: function() {
var a = {};
a.learner_response =
this.getSelectedAnswerTextList("-");
a.correct_response = this.getExpectedCorrectAnswerTextList("-");
return a
},
getDescriptionText: function() {
var a = {};
a.questionText = this.getQuestionText();
a.answerTexts = this.getAnswerTexts();
return a
},
getProgressString: function(a) {
this.progressString = "";
if (!this.m_quizController) return this.progressString;
var c = this.getQuestionNumberInQuiz() + 1,
b = this.m_quizController.GetNumberOfQuestionsInQuiz(),
d = 0,
e = 0,
f = cp.movie.questionObjs,
h = 0;
f && (h = f.length);
for (var g = 0; g < h; ++g) f[g] &&
f[g].getIsKnowledgeCheck() && (d++, g < c && e++);
c -= e;
b -= d;
if (d = this.m_quizController.GetGraphManager()) c = d.getQuestionSlideProgressNumber(this.m_slideIndex), b = d.getNumQuestions();
if ("NaN" == c) return this.progressString;
d = this.m_quizController.GetProgressType();
(e = this.m_quizController.GetForceAbsoluteProgressType()) && (d = 1);
0 == d ? "NaN" == b && (a = a.substr(0, a.indexOf("%d") + 2)) : e && (a = a.substr(0, a.indexOf("%d") + 2));
return this.progressString = a.replace("%d", c).replace("%d", b)
},
getAnsweredCorrectly: function() {
var a =
this.getQuestionStatus();
return a == this.QuestionStatusEnum.CORRECT || a == this.QuestionStatusEnum.PARTIAL_CORRECT ? !0 : !1
},
getIsTracked: function() {
return this.isTracked = this.questionData.it
},
getIsSurvey: function() {
return this.isSurvey = this.questionData.is
},
getIsPretest: function() {
return this.questionData.ipq
},
getIsKnowledgeCheck: function() {
return this.questionData.ikc
},
getNumberOfAttempts: function() {
return this.numberOfAttempts
},
getCurrentAttempt: function() {
return this.currentAttempt
},
setCurrentAttempt: function(a) {
var c =
this.m_quizController && this.m_quizController.GetIsSubmitAll() && !this.m_quizController.GetIsInReviewMode();
this.m_questionScore && (this.m_questionScore.m_numTries = a);
this.currentAttempt = a;
if (this.currentAttempt >= this.numberOfAttempts && !c && (this.disableAllOptions(), this.submitButtonDivElement && (this.submitButtonDivElement.enable = !1), this.clearButtonDivElement)) this.clearButtonDivElement.enable = !1
},
getQuestionNumberInQuiz: function() {
return this.questionNumberInQuiz = this.questionData.qnq
},
getObjectiveId: function() {
return this.objectiveID =
this.questionData.oid
},
getInteractionId: function() {
this.interactionID = this.questionData.iid;
var a = this.m_quizController.GetPlaybackController(),
c = a.GetLMSType();
c && (c = c.toUpperCase());
if (!a.IsRunningInConnect() && ("SCORM12" == c || "AICC" == c)) a = this.getQuestionText(), this.interactionID = this.interactionID + "_" + a;
return this.interactionID
},
getWeighting: function() {
return this.weighting = this.questionData.w
},
getNegativeWeight: function() {
return this.questionData.nw
},
getInteractionType: function() {
return this.interactionType =
this.questionData.itp
},
getScore: function() {
return this.score
},
setScore: function(a) {
this.score = this.shouldAddToTotal ? a : 0
},
getSelectedAnswerChoices: function() {
return this.getSelectedAnswersAsString()
},
getSelectedAnswersAsString: function() {
var a = "";
if (!this.m_selectedAnswersArr || 0 >= this.m_selectedAnswersArr.length) return a;
for (var a = a + this.m_selectedAnswersArr[0], c = 1; c < this.m_selectedAnswersArr.length; ++c) a += ";", a += this.m_selectedAnswersArr[c];
return a
},
setSelectedAnswers: function(a) {
this.m_selectedAnswersArr =
[];
this.m_selectedAnswersArr.push(a)
},
getAnswerOrder: function() {
if (!this.answerOptions || 0 >= this.answerOptions.length) return "";
for (var a = "", a = this.answerOptions[0], c = 1; c < this.answerOptions.length; ++c) a += ";", a += this.answerOptions[c];
return a
},
setAnswerOrder: function(a) {
a && !(0 >= a.length) && (this.answerOptions = a.split(";"), this.m_answerOrderArray = this.answerOptions.slice(0))
},
getAnswerID: function(a) {
a = cp(cp.D[a.parentNode.parentNode.id].answerTextCanvasHolder).firstChild;
return cp.D[a.id].aid
},
getExpectedCorrectAnswerIDList: function() {
return this.questionData.cal
},
getQuestionLevelScoredPoints: function() {
var a = 0;
return a = this.getAnsweredCorrectly() ? this.getWeighting() : this.getNegativeWeight()
},
getQuestionScoredPoints: function() {
return this.getIsSurvey() || !this.wasJudged ? 0 : this.getQuestionLevelScoredPoints()
},
getChosenAnswerFeedback: function() {},
getFeedbackToShow: function(a, c) {
var b = {},
b = this.getChosenAnswerFeedback();
if (c && this.shouldShowTimeOutCaption()) return b = this.getTimeOutFeedback();
if (this.getIsIncomplete() && !a && this.shouldShowIncompleteCaption()) return b =
this.getIncompleteFeedback();
if (b) return b;
this.getAnsweredCorrectly() ? b = this.getIsPartiallyCorrect() ? this.getPartialCorrectFeedback() : this.getSuccessFeedback() : this.shouldShowRetryCaption() && this.currentAttempt < this.numberOfAttempts ? b = this.getRetryFeedback() : this.getIsIncomplete() && a || this.currentAttempt >= this.numberOfAttempts ? (b = 0, this.incorrectFeedbackCaptions && (b = this.incorrectFeedbackCaptions.length - 1), b = this.getFailureFeedback(b)) : b = this.currentAttempt <= this.incorrectFeedbackCaptions.length ?
this.getFailureFeedback(this.currentAttempt - 1) : void 0;
return b
},
hideLastFeedback: function() {
this.lastFeedbackShown && cp.hide(this.lastFeedbackShown.name);
this.lastFeedbackShown = void 0
},
saveAnswerOrder: function() {},
pauseQuestion: function() {
if (this.state == this.StateEnum.PLAYING) {
this.state = this.StateEnum.PAUSED;
this.stopLatencyTimer();
var a = new Date;
this.timeBeforePause = this.startTime.getMilliseconds() - a.getMilliseconds();
this.pausedMsecs += this.timeBeforePause;
this.timeLimit -= this.timeBeforePause;
this.timeBeforePause =
0
}
},
resumeQuestion: function() {
this.state == this.StateEnum.PAUSED && (this.state = this.StateEnum.PLAYING, !this.m_quizController.GetIsInReviewMode() && 0 < this.timeLimit && this.startLatency())
},
endQuestion: function(a) {
this.verbose && cp.log("End Question Called");
if (this.state == this.StateEnum.PLAYING || this.state == this.StateEnum.PAUSED) {
this.state = this.StateEnum.ENDED;
this.stopLatencyTimer();
var c = this.m_quizController && this.m_quizController.GetIsSubmitAll() && !this.getIsPretest(),
b = this.m_quizController && this.m_quizController.GetIsInReviewMode();
c && !b && this.checkAndSetQuestionStatus();
b || this.saveAnswerOrder();
var d = this.getAnsweredCorrectly();
this.endTime = new Date;
this.m_questionScore.m_endTime = this.endTime;
this.m_questionScore.m_answerScores = this.getAnswerScores();
var e = this.getIsIncomplete();
this.m_questionScore.m_answersIncomplete = a || b || this.m_answersDisabled || c ? e : !0;
this.m_questionScore.m_answeredCorrectly = this.getAnsweredCorrectly();
this.m_questionScore.m_isShuffled = this.m_isShuffled;
this.m_questionScore.m_partiallyCorrect = this.getIsPartiallyCorrect();
a ? (this.wasJudged = this.m_questionScore.m_wasJudged = a, this.disableAllOptions(), this.disableQuizButtons(), this.setHandledClick(!0), this.stopLatencyTimer(), b = this.getQuestionScoredPoints(), this.setScore(b), this.m_questionScore.m_scoredPoints = this.getScore(), this.getIsPretest() || (d ? this.m_quizController && cp._cpQuizScopeSlide(this.m_quizController.GetNextQuestionSlideNumber()) : cp._cpQuizScopeSlide(cpInfoCurrentSlideIndex))) : (!this.getIsPretest() && !this.getIsKnowledgeCheck() && cp._cpQuizScopeSlide(cpInfoCurrentSlideIndex),
c ? (this.m_questionScore.m_wasJudged = !e, this.setCurrentAttempt(1), this.wasJudged = !this.getIsIncomplete(), b = this.getQuestionScoredPoints(), this.setScore(b), this.m_questionScore.m_scoredPoints = this.getScore()) : this.getWasJudged() || (this.wasJudged = this.m_questionScore.m_wasJudged = !1, this.setScore(0), this.m_questionScore.m_scoredPoints = 0));
d && (c || this.disableAllOptions(), this.getIsPretest() && (cpQuizInfoPreTestTotalCorrectAnswers += 1), cpQuizInfoTotalCorrectAnswers += 1);
cpQuizInfoAnswerChoice = this.getSelectedAnswerChoices();
this.getIsSurvey() ? cpQuizInfoLastSlidePointScored = 0 : (cpQuizInfoNoQuestionsPerQuiz += 1, cpQuizInfoLastSlidePointScored = this.getQuestionScoredPoints());
d = this.getDescriptionText();
a && (this.getIsTracked() && !this.m_quizController.GetIsInReviewMode()) && (this.m_eachAnswerIsSeparateInteraction ? this.shouldReportAnswers && this.sendInteractionDataForEachAnswer && this.sendInteractionDataForEachAnswer(d) : this.shouldReportAnswers && this.m_quizController.SendInteractionData(this.getQuestionScore(), d), a = this.m_quizController.GetScore(),
d = this.m_quizController.GetMaxScore(), b = this.m_quizController.GetMinScore(), cp.em.fireEvent("SCORE", {
score: a,
maxScore: d,
minScore: b,
quizId: cp.D.quizzingData.quizID
}));
a = this.m_quizController.GetPlaybackController();
cp.m_isLMSPreview && void 0 != cp.LMSDriverHolder && cp.toggleLMSPreviewDebugLogsColor(cp.LMSDriverHolder);
d = a.GetSendCourseDataWithInteractionData();
this.wasJudged && (d && !c) && ((c = a.GetLMSType()) && c.toUpperCase(), a.GetIsTracked(), a.SendCourseData(!1))
}
},
autoJudge: function() {
this.verbose && cp.log("inside autojudge");
this.setCurrentAttempt(this.numberOfAttempts - 1);
this.judge(!0, !0)
},
checkAndSetQuestionStatus: function() {},
judge: function(a, c) {
this.verbose && cp.log("inside judge");
this.saveAnswerOrder();
this.hideLastFeedback(!1);
var b = this.shouldShowIncompleteCaption(),
d = this.getIsSurvey(),
e;
this.checkAndSetQuestionStatus();
d ? (this.verbose && cp.log("inside judge : isSurvey"), this.getIsIncomplete() ? (this.verbose && cp.log("inside judge : incomplete"), e = this.getFeedbackToShow(a, c)) : (this.setCurrentAttempt(this.currentAttempt +
1), this.endQuestion(!0), e = this.getFeedbackToShow(a, !1))) : this.currentAttempt < this.numberOfAttempts && (this.getIsIncomplete() && !a && b ? e = this.getFeedbackToShow(a, c) : (this.setCurrentAttempt(this.currentAttempt + 1), e = this.getFeedbackToShow(a, c), this.currentAttempt >= this.numberOfAttempts || this.getAnsweredCorrectly() ? this.endQuestion(!0) : (this.getIsIncorrect() && this.setQuestionStatus(this.QuestionStatusEnum.INCOMPLETE), b = this.m_quizController.GetPlaybackController(), b.GetSendCourseDataWithInteractionData() &&
((d = b.GetLMSType()) && (d = d.toUpperCase()), b.GetIsTracked() && "EMAIL" != d && "ACROBAT" != d && "INTERNALSERVER" != d && "AICC" != d ? b.SendCourseData(!0) : b.SendCourseData(!1)))));
if (e && (cp.D[e.name] && e.captionToBeShown ? this.showFeedbackCaptionAndDoAction(e) : cp.movie.executeAction(e.action), this.m_quizController && this.getIsLastPretestQuestion() && (this.currentAttempt >= this.numberOfAttempts || this.getAnsweredCorrectly()))) this.m_quizController.m_PretestQuestionsDisabled = !0;
e = this.getQuestionEventData();
cp.em.fireEvent("CPQuestionSubmit",
e)
},
getQuestionEventData: function() {
var a = {};
switch (this.getQuestionScoringType()) {
case this.QuestionScoringTypeEnum.GRADED:
a.Name = "GradedQuestion";
break;
case this.QuestionScoringTypeEnum.SURVEY:
a.Name = "SurveyQuestion";
break;
case this.QuestionScoringTypeEnum.PRETEST:
a.Name = "PretestQuestion";
break;
default:
a.Name = "GradedQuestion"
}
var c = this.getInteractionType(),
b = this.getDescriptionText(),
d = this.getCorrectAnswerAsString(),
e = this.getChosenAnswerAsString();
switch (c) {
case "sequencing":
d = b.answerTexts.correct_response.split("-").join(",");
e = b.answerTexts.learner_response.split("-").join(",");
break;
case "likert":
d = e = b.answerTexts.learner_response
}
a = {
questionType: "hotspot" == c ? "hot-spot" : c,
objectiveID: this.getObjectiveId(),
questionScoringType: a,
questionMaxScore: this.getWeighting(),
correctAnswer: String(d),
questionMaxAttempts: this.numberOfAttempts,
selectedAnswer: String(e),
slideNumber: this.m_slideIndex,
quizName: "QuizName",
interactionID: this.getInteractionId(),
questionAttempts: this.currentAttempt,
questionNumber: this.getQuestionNumberInQuiz(),
questionAnswered: !1 == this.getIsIncomplete(),
questionScore: this.getScore(),
reportAnswers: this.shouldReportAnswers,
questionAnsweredCorrectly: this.getAnsweredCorrectly(),
infiniteAttempts: 9999 == this.numberOfAttempts,
interactionType: this.getInteractionType(),
weighting: this.getWeighting()
};
cp.IsRunningInACAP && (a.descriptionData = b);
return a
},
showFeedbackCaptionAndDoAction: function(a) {
function c() {
b.parentNode.removeChild(b);
cp.hide(d);
h.setHandledClick(f);
cp.movie.executeAction(a.action)
}
var b, d = a.name,
e = cp.D[d].mdi;
this.hideLastFeedback(!0);
var f;
this.slide && (f = cp.D[this.slide].handled);
this.setHandledClick(!1);
this.lastFeedbackShown = a;
var h = this,
g = document.getElementById(d);
cp.moveDivElemToTop(g);
e = document.getElementById(e);
void 0 != e && cp.moveRewrapElemToTop(e.parentNode);
e = cp.D[d];
g = e.sc;
g = new cp.Shortcut(g.k, g.c ? !0 : !1, g.s ? !0 : !1, g.a ? !0 : !1);
(e = new cp.KeyHandler(function(a) {
a && c()
}, g, e.from, e.to, "")) && cp.movie.stage.addKeyHandler(e);
cp.show(d, {
forceHideTextScalingIcon: !0
});
e = cp.movie.stage.getSlideDiv();
b = cp.newElem("div");
cp.fixWebkitScaling(b);
b.id = "feedbackClickDiv";
b.style.left = "0px";
b.style.top = "0px";
b.style.width = "100%";
b.style.height = "100%";
b.style.cursor = "pointer";
cp.MSIE != cp.browser ? (b.style.backgroundColor = "#FFFFFF", b.style.opacity = 0) : b.style.backgroundColor = "rgba(255,255,255,0)";
b.style.display = "block";
b.style.position = "absolute";
b.style.WebkitTapHighlightColor = "rgba(0,0,0,0)";
e.parentNode.appendChild(b);
cp.clearGestureCache(b);
cp.registerGestureEvent(b, cp.GESTURE_EVENT_TYPES.TAP, c);
cp.registerGestureEvent(b,
cp.GESTURE_EVENT_TYPES.DRAG_START, cp.m_gestureHandler.ondragstarthandler);
cp.registerGestureEvent(b, cp.GESTURE_EVENT_TYPES.DRAG, cp.m_gestureHandler.ondraghandler);
cp.registerGestureEvent(b, cp.GESTURE_EVENT_TYPES.DRAG_END, cp.m_gestureHandler.ondragendhandler);
b.style.zIndex = 1E4
},
clearButtonClickHandler: function() {
this.clearAnswers()
},
reviewmodemoveForward: function() {
if (this.reviewModeNextButtonDivElement && !this.reviewModeNextButtonDivElement.disabled && this.m_quizController) {
if (!1 == this.m_quizController.GetIsInReviewMode() &&
(this.getIsPretest() || !this.m_quizController || !this.m_quizController.GetIsSubmitAll())) {
var a = this.getQuestionEventData();
cp.em.fireEvent("CPQuestionSkip", a)
}
a = this.m_quizController && this.m_quizController.GetIsSubmitAll();
!this.getWasJudged() && !a && this.clearAnswers();
if (cpInfoCurrentSlideIndex == cpInfoSlideCount) cpCmndResume = !0;
else if (this.getIsLastPretestQuestion()) this.m_quizController && this.m_quizController.ExecutePretestAction(this.getSlideIndex());
else {
a = -1;
if (this.m_quizController) {
var c = this.m_quizController.GetGraphManager();
if (c && (a = this.m_quizController.GetNextQuestionSlideNumber(), -1 == a))
for (var c = c.GetPrevBranch(), b = cpInfoCurrentSlideIndex, d = 0; d < c.length; ++d) {
var e = c[d],
f = "",
h = this.m_quizController.GetQuestionsOnSlide(e);
if (h && 0 < h.length) {
var g = !1;
(h = h[0]) && h.getIsKnowledgeCheck() && (g = !0);
g || (f = "Question")
} else this.m_quizController.GetAnyScoreSlideIndex() == e && (f = "AnyScoreSlide");
if (("AnyScoreSlide" == f || "Question" == f) && e > b) {
a = e;
break
}
}
} - 1 == a ? cpCmndNextOnReview = !0 : cpCmndGotoSlideAndResume = a
}
}
},
moveForward: function() {
if (this.skipButtonDivElement &&
!this.skipButtonDivElement.disabled && this.m_quizController) {
var a = this.m_quizController.GetIsInReviewMode();
if (!1 == a && (this.getIsPretest() || !this.m_quizController || !this.m_quizController.GetIsSubmitAll())) {
var c = this.getQuestionEventData();
cp.em.fireEvent("CPQuestionSkip", c)
}
c = this.m_quizController && this.m_quizController.GetIsSubmitAll();
!this.getWasJudged() && !c && this.clearAnswers();
if (cpInfoCurrentSlideIndex == cpInfoSlideCount) cpCmndResume = !0;
else if (this.getIsLastPretestQuestion()) this.m_quizController &&
this.m_quizController.ExecutePretestAction(this.getSlideIndex());
else {
if ((a = !1 == a && !(this.getIsPretest() || c)) && this.m_quizController)
if (a = this.m_quizController.GetGraphManager(), void 0 != a) {
c = a.getNextSlideList(this.getSlideIndex());
if (1 == c.length) cpCmndGotoSlideAndResume = c[0];
else