root/trunk/max-javahotpot-tutorial/tutorial/test.htm @ 35

Revision 35, 46.3 KB (checked in by max, 23 months ago)

mario.izquierdo
max-javahotpot-tutorial (3.1.max1)

  • New release
Line 
1<?xml version="1.0"?>
2       <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "xhtml11.dtd">
3       <html xmlns="http://www.w3.org/1999/xhtml"
4             xml:lang="en"><head><meta name="author" content="Created with Hot Potatoes by Half-Baked Software, registered to Martin Holmes."></meta><meta name="keywords" content="Hot Potatoes, Hot Potatoes, Half-Baked Software, Windows, University of Victoria"></meta>
5
6<link rel="schema.DC" href="http://purl.org/dc/elements/1.1/" />
7<meta name="DC:Creator" content="UNREGISTERED" />
8<meta name="DC:Creator" content="Martin Holmes" />
9<meta name="DC:Title" content="A Text-Entry Quiz made with JQuiz" />
10
11
12<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> 
13
14<title>
15A Text-Entry Quiz made with JQuiz
16</title>
17
18<!-- Made with executable version 6.0 Release 1 Build 10 -->
19
20<!-- The following insertion allows you to add your own code directly to this head tag from the configuration screen -->
21
22
23
24<style type="text/css">
25
26
27/* This is the CSS stylesheet used in the exercise. */
28/* Elements in square brackets are replaced by data based on configuration settings when the exercise is built. */
29
30
31body{
32        font-family: Geneva,Arial;
33        background-color: #C0C0C0;
34        color: #000000;
35 
36        margin-right: 5%;
37        margin-left: 5%;
38        font-size: small;
39}
40
41p{
42        text-align: left;
43        margin: 0px;
44        font-size: small;
45}
46
47div,span,td{
48        font-size: small;
49        color: #000000;
50}
51
52.RTLText{
53        text-align: right;
54        font-size: 150%;
55        direction: rtl;
56        font-family: "Simplified Arabic", "Traditional Arabic", "Times New Roman", Geneva,Arial;
57}
58
59.CentredRTLText{
60        text-align: center;
61        font-size: 150%;
62        direction: rtl;
63        font-family: "Simplified Arabic", "Traditional Arabic", "Times New Roman", Geneva,Arial;
64}
65
66button p.RTLText{
67        text-align: center;
68}
69
70.RTLGapBox{
71        text-align: right;
72        font-size: 150%;
73        direction: rtl;
74        font-family: "Times New Roman", Geneva,Arial;
75}
76
77.Guess{
78        font-weight: bold;
79}
80
81.CorrectAnswer{
82        font-weight: bold;
83}
84
85div.Titles{
86        padding: 10px;
87        text-align: center;
88        color: #000000;
89}
90
91button{
92        display: inline;
93}
94
95.ExerciseTitle{
96        font-size: large;
97        color: #000000;
98}
99
100.ExerciseSubtitle{
101        color: #000000;
102}
103
104div#Timer{
105        padding: 6px;
106        margin-left: auto;
107        margin-right: auto;
108        text-align: center;
109}
110
111span#TimerText{
112        padding: 6px;
113        border-width: 1px;
114        border-style: solid;
115        font-weight: bold;
116        display: none;
117}
118
119span.Instructions{
120
121}
122
123div.ExerciseText{
124
125}
126
127.FeedbackText{
128
129}
130
131span.LeftItem{
132        font-size: small;
133        color: #000000;
134}
135
136span.RightItem{
137        font-weight: bold;
138        font-size: small;
139        color: #000000;
140}
141
142span.CorrectMark{
143
144}
145
146div.Feedback {
147        background-color: #C0C0C0;
148        left: 33%;
149        width: 34%;
150        top: 33%;
151        z-index: 1;
152        border-style: solid;
153        border-width: 1px;
154        padding: 5px;
155        text-align: center;
156        color: #000000;
157        position: absolute;
158        display: none;
159        font-size: small;
160}
161
162
163
164div.LeftContainer{
165        border-style: none;
166        padding: 2px 0px 2px 0px;
167        float: left;
168        width: 49.8%;
169        margin-bottom: 0px;
170}
171
172div.RightContainer{
173        border-style: none;
174        padding: 2px 0px 2px 0px;
175        float: right;
176        width: 49.8%;
177        margin-bottom: 0px;
178}
179
180.ReadingText{
181
182}
183
184
185div.ExerciseDiv{
186        color: #000000;
187}
188
189/* JMatch flashcard styles */
190table.FlashcardTable{
191        background-color: transparent;
192        color: #000000;
193        border-color: #000000;
194        margin-left: 5%;
195        margin-right: 5%;
196        margin-top: 2em;
197        margin-bottom: 2em;
198        width: 90%;
199        position: relative;
200        align: center;
201        padding: 0px;
202}
203
204table.FlashcardTable tr{
205        border-style: none;
206        margin: 0px;
207        padding: 0px;
208        background-color: #FFFFFF;
209}
210
211table.FlashcardTable td.Showing{
212        font-size: large;
213        text-align: center;
214        width: 50%;
215        display: table-cell;
216        padding: 2em;
217        margin: 0px;
218        border-style: solid;
219        border-width: 1px;
220        color: #000000;
221        background-color: #FFFFFF;
222}
223
224table.FlashcardTable td.Hidden{
225        display: none;
226}
227
228/* JMix styles */
229div#SegmentDiv{
230        margin-top: 2em;
231        margin-bottom: 2em;
232        text-align: center;
233}
234
235a.ExSegment{
236        font-size: medium;
237        font-weight: bold;
238        text-decoration: none;
239        color: #000000;
240}
241
242span.RemainingWordList{
243        font-style: italic;
244}
245
246div.DropLine {
247        position: absolute;
248        text-align: center;
249        border-bottom-style: solid;
250        border-bottom-width: 1px;
251        border-bottom-color: #000000;
252        width: 80%;
253}
254
255/* JCloze styles */
256
257input{
258        font-family: Geneva,Arial;
259        font-size: larger;
260}
261
262div.ClozeWordList{
263        text-align: center;
264        font-weight: bold;
265}
266
267div.ClozeBody{
268        text-align: left;
269        margin-top: 2em;
270        margin-bottom: 2em;
271        line-height: 2.0
272}
273
274span.GapSpan{
275        font-weight: bold;
276}
277
278/* JCross styles */
279
280table.CrosswordGrid{
281        margin: auto auto 1em auto;
282        border-collapse: collapse;
283        padding: 0px;
284}
285
286table.CrosswordGrid td{
287        width: 1.5em;
288        height: 1.5em;
289        text-align: center;
290        vertical-align: middle;
291        font-size: large;
292        padding: 0px;
293        margin: 0px;
294        border-style: solid;
295        border-width: 1px;
296        border-color: #000000;
297}
298
299table.CrosswordGrid td.BlankCell{
300        background-color: #000000;
301        color: #000000;
302}
303
304table.CrosswordGrid td.LetterOnlyCell{
305        text-align: center;
306        vertical-align: middle;
307        background-color: #ffffff;
308        color: #000000;
309        font-weight: bold;
310}
311
312table.CrosswordGrid td.NumLetterCell{
313        text-align: left;
314        vertical-align: top;
315        background-color: #ffffff;
316        color: #000000;
317        padding: 1px;
318        font-weight: bold;
319}
320
321.NumLetterCellText{
322        cursor: pointer;
323}
324
325.GridNum{
326        vertical-align: super;
327        font-size: x-small;
328        font-weight: bold;
329        text-decoration: none;
330        color: #000000;
331}
332
333table#Clues{
334        margin: auto;
335        vertical-align: top;
336}
337
338table#Clues td{
339        vertical-align: top;
340}
341
342table.ClueList{
343  margin: auto;
344}
345
346td.ClueNum{
347        text-align: right;
348        font-weight: bold;
349        vertical-align: top;
350}
351
352td.Clue{
353        text-align: left;
354}
355
356div#ClueEntry{
357        text-align: left;
358        margin-bottom: 1em;
359}
360
361/* Keypad styles */
362
363div.Keypad{
364        text-align: center;
365}
366
367div.Keypad button{
368        font-family: Geneva,Arial;
369        font-size: 120%;
370        background-color: #ffffff;
371        color: #000000;
372        width: 2em;
373}
374
375/* JQuiz styles */
376
377div.QuestionNavigation{
378        text-align: center;
379}
380
381.QNum{
382        margin: 0em 1em 0.5em 1em;
383        font-weight: bold;
384        vertical-align: middle;
385}
386
387textarea{
388        font-family: Geneva,Arial;
389        font-size: larger;
390}
391
392.QuestionText{
393
394}
395
396.Answer{
397        font-size: 120%;
398        letter-spacing: 0.1em;
399}
400
401.Highlight{
402        color: #000000;
403        background-color: #ffff00;
404        font-weight: bold;
405        font-size: 120%;
406}
407
408ol.QuizQuestions{
409        text-align: left;
410        list-style-type: none;
411}
412
413li.QuizQuestion{
414        padding: 1em;
415        border-style: solid;
416        border-width: 0px 0px 1px 0px;
417}
418
419ol.MCAnswers{
420        text-align: left;
421        list-style-type: upper-alpha;
422        padding: 1em;
423}
424
425ol.MCAnswers li{
426        margin-bottom: 1em;
427}
428
429ol.MSelAnswers{
430        text-align: left;
431        list-style-type: lower-alpha;
432        padding: 1em;
433}
434
435div.ShortAnswer{
436        padding: 1em;
437}
438
439div.StdDiv{
440        background-color: #FFFFFF;
441        text-align: center;
442        font-size: small;
443        color: #000000;
444        padding: 8px;
445        border-style: solid;
446        border-width: 1px 1px 1px 1px;
447        border-color: #000000;
448        margin: 1px;
449}
450
451.FuncButton {
452        text-align: center;
453        border-style: solid;
454
455        border-left-color: #ffffff;
456        border-top-color: #ffffff;
457        border-right-color: #7f7f7f;
458        border-bottom-color: #7f7f7f;
459        color: #000000;
460        background-color: #FFFFFF;
461
462        border-width: 2px;
463        padding: 3px 6px 3px 6px;
464        cursor: pointer;
465}
466
467.FuncButtonUp {
468        color: #FFFFFF;
469        text-align: center;
470        border-style: solid;
471
472        border-left-color: #ffffff;
473        border-top-color: #ffffff;
474        border-right-color: #7f7f7f;
475        border-bottom-color: #7f7f7f;
476
477        background-color: #000000;
478        color: #FFFFFF;
479        border-width: 2px;
480        padding: 3px 6px 3px 6px;
481        cursor: pointer;
482}
483
484.FuncButtonDown {
485        color: #FFFFFF;
486        text-align: center;
487        border-style: solid;
488
489        border-left-color: #7f7f7f;
490        border-top-color: #7f7f7f;
491        border-right-color: #ffffff;
492        border-bottom-color: #ffffff;
493        background-color: #000000;
494        color: #FFFFFF;
495
496        border-width: 2px;
497        padding: 3px 6px 3px 6px;
498        cursor: pointer;
499}
500
501/*BeginNavBarStyle*/
502
503div.NavButtonBar{
504        background-color: #000000;
505        text-align: center;
506        margin: 2px 0px 2px 0px;
507        clear: both;
508        font-size: small;
509}
510
511.NavButton {
512        border-style: solid;
513       
514        border-left-color: #7f7f7f;
515        border-top-color: #7f7f7f;
516        border-right-color: #000000;
517        border-bottom-color: #000000;
518        background-color: #000000;
519        color: #ffffff;
520
521        border-width: 2px;
522        cursor: pointer;       
523}
524
525.NavButtonUp {
526        border-style: solid;
527
528        border-left-color: #7f7f7f;
529        border-top-color: #7f7f7f;
530        border-right-color: #000000;
531        border-bottom-color: #000000;
532        color: #000000;
533        background-color: #ffffff;
534
535        border-width: 2px;
536        cursor: pointer;       
537}
538
539.NavButtonDown {
540        border-style: solid;
541
542        border-left-color: #000000;
543        border-top-color: #000000;
544        border-right-color: #7f7f7f;
545        border-bottom-color: #7f7f7f;
546        color: #000000;
547        background-color: #ffffff;
548
549        border-width: 2px;
550        cursor: pointer;       
551}
552
553/*EndNavBarStyle*/
554
555a{
556        color: #0000FF;
557}
558
559a: visited{
560        color: #0000CC;
561}
562
563a:hover{
564        color: #0000FF;
565}
566
567div.CardStyle {
568        position: absolute;
569        font-family: Geneva,Arial;
570        font-size: small;
571        padding: 5px;
572        border-style: solid;
573        border-width: 1px;
574        color: #000000;
575        background-color: #FFFFFF;
576        left: -50px;
577        top: -50px;
578        overflow: visible;
579}
580
581.rtl{
582        text-align: right;
583        font-size: large;
584}
585
586
587</style>
588
589<script type="text/javascript">
590
591//<![CDATA[
592
593<!--
594
595
596function Client(){
597//if not a DOM browser, hopeless
598        this.min = false; if (document.getElementById){this.min = true;};
599
600        this.ua = navigator.userAgent;
601        this.name = navigator.appName;
602        this.ver = navigator.appVersion; 
603
604//Get data about the browser
605        this.mac = (this.ver.indexOf('Mac') != -1);
606        this.win = (this.ver.indexOf('Windows') != -1);
607
608//Look for Gecko
609        this.gecko = (this.ua.indexOf('Gecko') > 1);
610        if (this.gecko){
611                this.geckoVer = parseInt(this.ua.substring(this.ua.indexOf('Gecko')+6, this.ua.length));
612                if (this.geckoVer < 20020000){this.min = false;}
613        }
614       
615//Look for Safari
616        this.safari = (this.ua.indexOf('Safari') > 1);
617        if (this.safari){
618                this.gecko = false;
619        }
620       
621//Look for IE
622        this.ie = (this.ua.indexOf('MSIE') > 0);
623        if (this.ie){
624                this.ieVer = parseFloat(this.ua.substring(this.ua.indexOf('MSIE')+5, this.ua.length));
625                if (this.ieVer < 5.5){this.min = false;}
626        }
627       
628//Look for Opera
629        this.opera = (this.ua.indexOf('Opera') > 0);
630        if (this.opera){
631                this.operaVer = parseFloat(this.ua.substring(this.ua.indexOf('Opera')+6, this.ua.length));
632                if (this.operaVer < 7.04){this.min = false;}
633        }
634        if (this.min == false){
635                alert('Your browser may not be able to handle this page.');
636        }
637       
638//Special case for the horrible ie5mac
639        this.ie5mac = (this.ie&&this.mac&&(this.ieVer<6));
640}
641
642var C = new Client();
643
644//for (prop in C){
645//      alert(prop + ': ' + C[prop]);
646//}
647
648
649
650//CODE FOR HANDLING NAV BUTTONS AND FUNCTION BUTTONS
651
652//[strNavBarJS]
653function NavBtnOver(Btn){
654        if (Btn.className != 'NavButtonDown'){Btn.className = 'NavButtonUp';}
655}
656
657function NavBtnOut(Btn){
658        Btn.className = 'NavButton';
659}
660
661function NavBtnDown(Btn){
662        Btn.className = 'NavButtonDown';
663}
664//[/strNavBarJS]
665
666function FuncBtnOver(Btn){
667        if (Btn.className != 'FuncButtonDown'){Btn.className = 'FuncButtonUp';}
668}
669
670function FuncBtnOut(Btn){
671        Btn.className = 'FuncButton';
672}
673
674function FuncBtnDown(Btn){
675        Btn.className = 'FuncButtonDown';
676}
677
678function FocusAButton(){
679        if (document.getElementById('CheckButton1') != null){
680                document.getElementById('CheckButton1').focus();
681        }
682        else{
683                if (document.getElementById('CheckButton2') != null){
684                        document.getElementById('CheckButton2').focus();
685                }
686                else{
687                        document.getElementsByTagName('button')[0].focus();
688                }
689        }
690}
691
692
693
694
695//CODE FOR HANDLING DISPLAY OF POPUP FEEDBACK BOX
696
697var topZ = 1000;
698
699function ShowMessage(Feedback){
700        var Output = Feedback + '<br /><br />';
701        document.getElementById('FeedbackContent').innerHTML = Output;
702        var FDiv = document.getElementById('FeedbackDiv');
703        topZ++;
704        FDiv.style.zIndex = topZ;
705        FDiv.style.top = TopSettingWithScrollOffset(30) + 'px';
706//IE can't focus a hidden div; Moz needs to focus before display to avoid jumping
707        if (C.gecko){
708                document.getElementById('FeedbackOKButton').focus();
709        }
710        FDiv.style.display = 'block';
711
712        ShowElements(false, 'input');
713        ShowElements(false, 'select');
714
715        if (C.ie){
716                document.getElementById('FeedbackOKButton').focus();
717        }
718       
719//
720}
721
722function ShowElements(Show, TagName){
723//Special for IE bug -- hide all the form elements that will show through the popup
724        if (C.ie){
725                var Els = document.getElementsByTagName(TagName);
726                for (var i=0; i<Els.length; i++){
727                        if (Show == true){
728                                Els[i].style.display = 'inline';
729                        }
730                        else{
731                                Els[i].style.display = 'none';
732                        }
733                }
734        }
735}
736
737function HideFeedback(){
738        document.getElementById('FeedbackDiv').style.display = 'none';
739        ShowElements(true, 'input');
740        ShowElements(true, 'select');
741        if (Finished == true){
742                Finish();
743        }
744}
745
746
747//GENERAL UTILITY FUNCTIONS AND VARIABLES
748
749//PAGE DIMENSION FUNCTIONS
750function PageDim(){
751//Get the page width and height
752        this.W = 600;
753        this.H = 400;
754        this.W = document.getElementsByTagName('body')[0].clientWidth;
755        this.H = document.getElementsByTagName('body')[0].clientHeight;
756}
757
758var pg = null;
759
760function GetPageXY(El) {
761        var XY = {x: 0, y: 0};
762        while(El){
763                XY.x += El.offsetLeft;
764                XY.y += El.offsetTop;
765                El = El.offsetParent;
766        }
767        return XY;
768}
769
770function GetScrollTop(){
771        if (document.documentElement && document.documentElement.scrollTop){
772                return document.documentElement.scrollTop;
773        }
774        else{
775                if (document.body){
776                        return document.body.scrollTop;
777                }
778                else{
779                        return window.pageYOffset;
780                }
781        }
782}
783
784function TopSettingWithScrollOffset(TopPercent){
785        var T = Math.floor(document.getElementsByTagName('body')[0].clientHeight * (TopPercent/100));
786        return GetScrollTop() + T;
787}
788
789//CODE FOR AVOIDING LOSS OF DATA WHEN BACKSPACE KEY INVOKES history.back()
790var InTextBox = false;
791
792function SuppressBackspace(e){
793        if (InTextBox == true){return;}
794        if (C.ie) {
795                thisKey = window.event.keyCode;
796        }
797        else {
798                thisKey = e.keyCode;
799        }
800
801        var Suppress = false;
802
803        if (thisKey == 8) {
804                Suppress = true;
805        }
806
807        if (Suppress == true){
808                if (C.ie){
809                        window.event.returnValue = false;       
810                        window.event.cancelBubble = true;
811                }
812                else{
813                        e.preventDefault();
814                }
815        }
816}
817
818if (C.ie){
819        document.attachEvent('onkeydown',SuppressBackspace);
820        window.attachEvent('onkeydown',SuppressBackspace);
821}
822else{
823        window.addEventListener('keypress',SuppressBackspace,false);
824}
825
826function ReduceItems(InArray, ReduceToSize){
827        var ItemToDump=0;
828        var j=0;
829        while (InArray.length > ReduceToSize){
830                ItemToDump = Math.floor(InArray.length*Math.random());
831                InArray.splice(ItemToDump, 1);
832        }
833}
834
835function Shuffle(InArray){
836        Temp = new Array();
837        var Len = InArray.length;
838
839        var j = Len;
840
841        for (var i=0; i<Len; i++){
842                Temp[i] = InArray[i];
843        }
844
845        for (i=0; i<Len; i++){
846                Num = Math.floor(j  *  Math.random());
847                InArray[i] = Temp[Num];
848
849                for (var k=Num; k < j; k++) {
850                        Temp[k] = Temp[k+1];
851                }
852                j--;
853        }
854        return InArray;
855}
856
857function WriteToInstructions(Feedback) {
858        Feedback = '<span class="FeedbackText">' + Feedback + '</span>';
859        document.getElementById('InstructionsDiv').innerHTML = Feedback;
860
861}
862
863
864
865
866function EscapeDoubleQuotes(InString){
867        return InString.replace(/"/g, '&quot;')
868}
869
870function FocusAButton(){
871        if (document.getElementById('CheckButton1') != null){
872                document.getElementById('CheckButton1').focus();
873        }
874        else{
875                document.getElementsByTagName('button')[0].focus();
876        }
877}
878
879function TrimString(InString){
880        var x = 0;
881
882        if (InString.length != 0) {
883                while ((InString.charAt(InString.length - 1) == '\u0020') || (InString.charAt(InString.length - 1) == '\u000A') || (InString.charAt(InString.length - 1) == '\u000D')){
884                        InString = InString.substring(0, InString.length - 1)
885                }
886
887                while ((InString.charAt(0) == '\u0020') || (InString.charAt(0) == '\u000A') || (InString.charAt(0) == '\u000D')){
888                        InString = InString.substring(1, InString.length)
889                }
890
891                while (InString.indexOf('  ') != -1) {
892                        x = InString.indexOf('  ')
893                        InString = InString.substring(0, x) + InString.substring(x+1, InString.length)
894                 }
895
896                return InString;
897        }
898
899        else {
900                return '';
901        }
902}
903
904function FindLongest(InArray){
905        if (InArray.length < 1){return -1;}
906
907        var Longest = 0;
908        for (var i=1; i<InArray.length; i++){
909                if (InArray[i].length > InArray[Longest].length){
910                        Longest = i;
911                }
912        }
913        return Longest;
914}
915
916//UNICODE CHARACTER FUNCTIONS
917function IsCombiningDiacritic(CharNum){
918        var Result = (((CharNum >= 0x0300)&&(CharNum <= 0x370))||((CharNum >= 0x20d0)&&(CharNum <= 0x20ff)));
919        Result = Result || (((CharNum >= 0x3099)&&(CharNum <= 0x309a))||((CharNum >= 0xfe20)&&(CharNum <= 0xfe23)));
920        return Result;
921}
922
923function IsCJK(CharNum){
924        return ((CharNum >= 0x3000)&&(CharNum < 0xd800));
925}
926
927//SETUP FUNCTIONS
928//BROWSER WILL REFILL TEXT BOXES FROM CACHE IF NOT PREVENTED
929function ClearTextBoxes(){
930        var NList = document.getElementsByTagName('input');
931        for (var i=0; i<NList.length; i++){
932                if (NList[i].id.indexOf('Guess') > -1){
933                        NList[i].value = '';
934                }
935                if (NList[i].id.indexOf('Chk') > -1){
936                        NList[i].checked = '';
937                }
938        }
939}
940
941//EXTENSION TO ARRAY OBJECT
942function Array_IndexOf(Input){
943        var Result = -1;
944        for (var i=0; i<this.length; i++){
945                if (this[i] == Input){
946                        Result = i;
947                }
948        }
949        return Result;
950}
951Array.prototype.indexOf = Array_IndexOf;
952
953//IE HAS RENDERING BUG WITH BOTTOM NAVBAR
954function RemoveBottomNavBarForIE(){
955        if (C.ie){
956                if (document.getElementById('BottomNavBar') != null){
957                        document.getElementById('TheBody').removeChild(document.getElementById('BottomNavBar'));
958                }
959        }
960}
961
962
963
964
965//HOTPOTNET-RELATED CODE
966
967var HPNStartTime = (new Date()).getTime();
968var SubmissionTimeout = 30000;
969var Detail = ''; //Global that is used to submit tracking data
970
971function Finish(){
972//If there's a form, fill it out and submit it
973        if (document.store != null){
974                Frm = document.store;
975                Frm.starttime.value = HPNStartTime;
976                Frm.endtime.value = (new Date()).getTime();
977                Frm.mark.value = Score;
978                Frm.detail.value = Detail;
979                Frm.submit();
980        }
981}
982
983
984
985//JQUIZ CORE JAVASCRIPT CODE
986
987var CurrQNum = 0;
988var CorrectIndicator = ':-)';
989var IncorrectIndicator = 'X';
990var YourScoreIs = 'Your score is ';
991var ContinuousScoring = true;
992var CorrectFirstTime = 'Questions answered correctly first time: ';
993var ShowCorrectFirstTime = true;
994var ShuffleQs = true;
995var ShuffleAs = false;
996var DefaultRight = 'Correct!';
997var DefaultWrong = 'Sorry! Try again.';
998var QsToShow = 5;
999var Score = 0;
1000var Finished = false;
1001var Qs = null;
1002var QArray = new Array();
1003var ShowingAllQuestions = false;
1004var ShowAllQuestionsCaption = 'Show all questions';
1005var ShowOneByOneCaption = 'Show questions one by one';
1006var State = new Array();
1007var Feedback = '';
1008
1009function CompleteEmptyFeedback(){
1010        var QNum, ANum;
1011        for (QNum=0; QNum<I.length; QNum++){
1012                for (ANum = 0; ANum<I[QNum][3].length; ANum++){
1013                        if (I[QNum][3][ANum][1].length < 1){
1014                                if (I[QNum][3][ANum][2] > 0){
1015                                        I[QNum][3][ANum][1] = DefaultRight;
1016                                }
1017                                else{
1018                                        I[QNum][3][ANum][1] = DefaultWrong;
1019                                }
1020                        }
1021                }
1022        }
1023}
1024
1025function SetUpQuestions(){
1026        var AList = new Array();
1027        var QList = new Array();
1028        var i, j;
1029        Qs = document.getElementById('Questions');
1030        while (Qs.getElementsByTagName('li').length > 0){
1031                QList.push(Qs.removeChild(Qs.getElementsByTagName('li')[0]));
1032        }
1033        var DumpItem = 0;
1034        while (QsToShow < QList.length){
1035                DumpItem = Math.floor(QList.length*Math.random());
1036                for (j=DumpItem; j<(QList.length-1); j++){
1037                        QList[j] = QList[j+1];
1038                }
1039                QList.length = QList.length-1;
1040        }
1041        if (ShuffleQs == true){
1042                QList = Shuffle(QList);
1043        }
1044        if (ShuffleAs == true){
1045                var As;
1046                for (var i=0; i<QList.length; i++){
1047                        As = QList[i].getElementsByTagName('ol')[0];
1048                        if (As != null){
1049                        AList.length = 0;
1050                                while (As.getElementsByTagName('li').length > 0){
1051                                        AList.push(As.removeChild(As.getElementsByTagName('li')[0]));
1052                                }
1053                                AList = Shuffle(AList);
1054                                for (j=0; j<AList.length; j++){
1055                                        As.appendChild(AList[j]);
1056                                }
1057                        }
1058                }
1059        }
1060       
1061        for (i=0; i<QList.length; i++){
1062                Qs.appendChild(QList[i]);
1063                QArray[QArray.length] = QList[i];
1064        }
1065       
1066//Now hide all except the first item
1067        for (i=1; i<QArray.length; i++){
1068                QArray[i].style.display = 'none';
1069        }               
1070        SetQNumReadout();
1071}
1072
1073function ChangeQ(ChangeBy){
1074        if (((CurrQNum + ChangeBy) < 0)||((CurrQNum + ChangeBy) >= QArray.length)){return;}
1075        QArray[CurrQNum].style.display = 'none';
1076        CurrQNum += ChangeBy;
1077        QArray[CurrQNum].style.display = '';
1078        SetQNumReadout();
1079//if there's a textbox, set the focus in it
1080        if (QArray[CurrQNum].getElementsByTagName('input')[0] != null){
1081                QArray[CurrQNum].getElementsByTagName('input')[0].focus();
1082        }
1083}
1084
1085function SetQNumReadout(){
1086        document.getElementById('QNumReadout').innerHTML = (CurrQNum+1) + ' / ' + QArray.length;
1087}
1088
1089I=new Array();
1090I[0]=new Array();I[0][0]=10;
1091I[0][1]='';
1092I[0][2]='1';
1093I[0][3]=new Array();
1094I[0][3][0]=new Array('Hint','',1,100,1);
1095I[0][3][1]=new Array('Hint button','',1,100,1);
1096I[0][3][2]=new Array('The Hint button','',1,100,1);
1097I[0][3][3]=new Array('"Hint"','',1,100,1);
1098I[1]=new Array();I[1][0]=20;
1099I[1][1]='';
1100I[1][2]='1';
1101I[1][3]=new Array();
1102I[1][3][0]=new Array('produce','',1,100,1);
1103I[1][3][1]=new Array('create','',1,100,1);
1104I[1][3][2]=new Array('type','',1,100,1);
1105I[1][3][3]=new Array('give','',1,100,1);
1106I[1][3][4]=new Array('make','',1,100,1);
1107I[1][3][5]=new Array('enter','',1,100,1);
1108I[1][3][6]=new Array('insert','',1,100,1);
1109I[2]=new Array();I[2][0]=100;
1110I[2][1]='';
1111I[2][2]='1';
1112I[2][3]=new Array();
1113I[2][3][0]=new Array('any number','',1,100,1);
1114I[2][3][1]=new Array('an infinite number','',1,100,1);
1115I[2][3][2]=new Array('as many as you like','',1,100,1);
1116I[2][3][3]=new Array('millions','',1,100,1);
1117I[2][3][4]=new Array('there is no limit','',1,100,1);
1118I[2][3][5]=new Array('no limit','',1,100,1);
1119I[2][3][6]=new Array('unlimited numbers','',1,100,1);
1120I[2][3][7]=new Array('an unlimited number','',1,100,1);
1121I[2][3][8]=new Array('unlimited','',1,100,1);
1122I[3]=new Array();I[3][0]=100;
1123I[3][1]='';
1124I[3][2]='1';
1125I[3][3]=new Array();
1126I[3][3][0]=new Array('making','',1,100,1);
1127I[3][3][1]=new Array('creating','',1,100,1);
1128I[3][3][2]=new Array('producing','',1,100,1);
1129I[3][3][3]=new Array('writing','',1,100,1);
1130I[3][3][4]=new Array('authoring','',1,100,1);
1131I[3][3][5]=new Array('constructing','',1,100,1);
1132I[4]=new Array();I[4][0]=100;
1133I[4][1]='';
1134I[4][2]='1';
1135I[4][3]=new Array();
1136I[4][3][0]=new Array('JavaScript','',1,100,1);
1137I[4][3][1]=new Array('Java script','',1,100,1);
1138
1139
1140function StartUp(){
1141        RemoveBottomNavBarForIE();
1142       
1143
1144       
1145
1146       
1147        CompleteEmptyFeedback();
1148
1149        SetUpQuestions();
1150        ClearTextBoxes();
1151        CreateStatusArray();
1152       
1153
1154       
1155}
1156
1157function ShowHideQuestions(){
1158        FuncBtnOut(document.getElementById('ShowMethodButton'));
1159        document.getElementById('ShowMethodButton').style.display = 'none';
1160        if (ShowingAllQuestions == false){
1161                for (var i=0; i<QArray.length; i++){
1162                                QArray[i].style.display = '';
1163                        }
1164                document.getElementById('Questions').style.listStyleType = 'decimal';
1165                document.getElementById('OneByOneReadout').style.display = 'none';
1166                document.getElementById('ShowMethodButton').innerHTML = ShowOneByOneCaption;
1167                ShowingAllQuestions = true;
1168        }
1169        else{
1170                for (var i=0; i<QArray.length; i++){
1171                                if (i != CurrQNum){
1172                                        QArray[i].style.display = 'none';
1173                                }
1174                        }
1175                document.getElementById('Questions').style.listStyleType = 'none';
1176                document.getElementById('OneByOneReadout').style.display = '';
1177                document.getElementById('ShowMethodButton').innerHTML = ShowAllQuestionsCaption;
1178                ShowingAllQuestions = false;   
1179        }
1180        document.getElementById('ShowMethodButton').style.display = 'inline';
1181}
1182
1183function CreateStatusArray(){
1184        var QNum, ANum;
1185//For each item in the item array
1186        for (QNum=0; QNum<I.length; QNum++){
1187//Check if the question still exists (hasn't been nuked by showing a random selection)
1188                if (document.getElementById('Q_' + QNum) != null){
1189                        State[QNum] = new Array();
1190                        State[QNum][0] = -1; //Score for this q; -1 shows question not done yet
1191                        State[QNum][1] = new Array(); //answers
1192                        for (ANum = 0; ANum<I[QNum][3].length; ANum++){
1193                                State[QNum][1][ANum] = 0; //answer not chosen yet; when chosen, will store its position in the series of choices
1194                        }
1195                        State[QNum][2] = 0; //tries at this q so far
1196                        State[QNum][3] = 0; //incrementing percent-correct values of selected answers
1197                        State[QNum][4] = 0; //penalties incurred for hints
1198                        State[QNum][5] = ''; //Sequence of answers chosen by number
1199                }
1200        }
1201}
1202
1203
1204
1205
1206
1207function CalculateOverallScore(){
1208        var TotalWeighting = 0;
1209        var TotalScore = 0;
1210       
1211        for (var QNum=0; QNum<State.length; QNum++){
1212                if (State[QNum] != null){
1213                        if (State[QNum][0] > -1){
1214                                TotalWeighting += I[QNum][0];
1215                                TotalScore += (I[QNum][0] * State[QNum][0]);
1216                        }
1217                }
1218        }
1219        Score = Math.floor((TotalScore/TotalWeighting)*100);
1220}
1221
1222function CheckFinished(){
1223        var FB = '';
1224
1225        var AllDone = true;
1226        for (var QNum=0; QNum<State.length; QNum++){
1227                if (State[QNum][0] < 0){
1228                        AllDone = false;
1229                }
1230        }
1231        if (AllDone == true){
1232       
1233//Report final score and submit if necessary
1234                CalculateOverallScore();
1235                FB = YourScoreIs + ' ' + Score + '%.';
1236                if (ShowCorrectFirstTime == true){
1237                        var CFT = 0;
1238                        for (QNum=0; QNum<State.length; QNum++){
1239                                if (State[QNum][0] >= 1){
1240                                        CFT++;
1241                                }
1242                        }
1243                        FB += '<br />' + CorrectFirstTime + ' ' + CFT + '/' + State.length;
1244                }
1245                WriteToInstructions(FB);
1246               
1247                Finished == true;
1248
1249                TimeOver = true;
1250                Locked = true;
1251               
1252
1253
1254                Finished = true;
1255                Detail = '<?xml version="1.0"?><hpnetresult><fields>';
1256                for (QNum=0; QNum<State.length; QNum++){
1257                        if (State[QNum][5].length > 0){
1258                                Detail += '<field><fieldname>Question #' + (QNum+1) + '</fieldname><fieldtype>question-tracking</fieldtype><fieldlabel>Q ' + (QNum+1) + '</fieldlabel><fieldlabelid>QuestionTrackingField</fieldlabelid><fielddata>' + State[QNum][5] + '</fielddata></field>';
1259                        }
1260                }
1261                Detail += '</fields></hpnetresult>';
1262                setTimeout('Finish()', SubmissionTimeout);
1263        }
1264}
1265
1266
1267
1268
1269
1270//CORE CODE FOR CHECKING SHORT ANSWER GUESSES AGAINST ANSWER ARRAYS
1271
1272var CaseSensitive = false;
1273var ShowAlsoCorrect = true;
1274var PleaseEnter = 'Please enter a guess.';
1275var HybridTries = 2;
1276var PartlyIncorrect = 'Your answer is partly wrong: ';
1277var CorrectList = 'Correct answers: ';
1278var NextCorrect = 'Next correct letter in the answer: ';
1279var CurrBox = null;
1280
1281function TrackFocus(BoxID){
1282        InTextBox = true;
1283        CurrBox = document.getElementById(BoxID);
1284}
1285
1286function LeaveGap(){
1287        InTextBox = false;
1288}
1289
1290function TypeChars(Chars){
1291        if (CurrBox != null){
1292//              if (CurrBox.style.display != 'none'){
1293                        CurrBox.value += Chars;
1294//              }
1295        }
1296}
1297
1298function CheckGuess(Guess, Answer, CaseSensitive, PercentCorrect, Feedback){
1299        this.Guess = Guess;
1300        this.Answer = Answer;
1301        this.PercentCorrect = PercentCorrect;
1302        this.Feedback = Feedback;
1303        if (CaseSensitive == false){
1304                this.WorkingGuess = Guess.toLowerCase();
1305                this.WorkingAnswer = Answer.toLowerCase();
1306        }
1307        else{
1308                this.WorkingGuess = Guess;
1309                this.WorkingAnswer = Answer;                           
1310        }
1311        this.Hint = '';
1312        this.HintPenalty = 1/Answer.length;
1313        this.CorrectStart = '';
1314        this.WrongMiddle = '';
1315        this.CorrectEnd = '';
1316        this.PercentMatch = 0;
1317        this.DoCheck();
1318}
1319
1320function CheckGuess_DoCheck(){
1321//Check if it's an exact match
1322        if (this.WorkingAnswer == this.WorkingGuess){
1323                this.PercentMatch = 100;
1324                this.CorrectStart = this.Guess;
1325        return;
1326        }
1327//Figure out how much of the beginning is correct
1328        var i = 0;
1329        var CorrectChars = 0;
1330        while (this.WorkingAnswer.charAt(i) == this.WorkingGuess.charAt(i)){
1331                i++;
1332                CorrectChars++;
1333        }
1334//Stash the hint
1335        this.Hint = this.Answer.charAt(i);
1336       
1337        this.CorrectStart = this.Guess.substring(0, i);
1338//Figure out how much of the end is correct
1339        var j = this.WorkingGuess.length-1;
1340        var k = this.WorkingAnswer.length-1;
1341        while ((this.WorkingAnswer.charAt(k) == this.WorkingGuess.charAt(j))&&(CorrectChars < this.Answer.length)){
1342                CorrectChars++;
1343                j--;
1344                k--;
1345        }
1346        this.CorrectEnd = this.Guess.substring(j+1, this.Guess.length);
1347        this.WrongMiddle = this.Guess.substring(i, j+1);
1348        if (TrimString(this.WrongMiddle).length < 1){this.WrongMiddle = '_____';}
1349//Calculate match score based on how much of the guess is correct
1350        if (CorrectChars < this.Answer.length){
1351                this.PercentMatch = Math.floor(100*CorrectChars)/this.Answer.length;
1352        }
1353        else{
1354                this.PercentMatch = Math.floor((100 * CorrectChars)/this.Guess.length);
1355        }       
1356}
1357
1358CheckGuess.prototype.DoCheck = CheckGuess_DoCheck;
1359
1360function CheckAnswerArray(CaseSensitive){
1361        this.CaseSensitive = CaseSensitive;
1362        this.Answers = new Array();
1363        this.Score = 0;
1364        this.Feedback = '';
1365        this.Hint = '';
1366        this.HintPenalty = 0;
1367        this.MatchedAnswerLength = 1;
1368        this.CompleteMatch = false;
1369        this.MatchNum = -1;
1370}
1371
1372function CheckAnswerArray_AddAnswer(Guess, Answer, PercentCorrect, Feedback){
1373        this.Answers.push(new CheckGuess(Guess, Answer, this.CaseSensitive, PercentCorrect, Feedback));
1374}
1375
1376CheckAnswerArray.prototype.AddAnswer = CheckAnswerArray_AddAnswer;
1377
1378function CheckAnswerArray_ClearAll(){
1379        this.Answers.length = 0;
1380}
1381
1382CheckAnswerArray.prototype.ClearAll = CheckAnswerArray_ClearAll;
1383
1384function CheckAnswerArray_GetBestMatch(){
1385//First check for a 100% match
1386        for (var i=0; i<this.Answers.length; i++){
1387                if (this.Answers[i].PercentMatch == 100){
1388                        this.Feedback = this.Answers[i].Feedback;
1389                        this.Score = this.Answers[i].PercentCorrect;
1390                        this.CompleteMatch = true;
1391                        this.MatchNum = i;
1392                        return;
1393                }
1394        }
1395//Now check for the best alternative match
1396        var PercentMatch = 0;
1397        var BestMatch = -1;
1398        for (i=0; i<this.Answers.length; i++){
1399                if ((this.Answers[i].PercentMatch > PercentMatch)&&(this.Answers[i].PercentCorrect == 100)){
1400                        BestMatch = i;
1401                        PercentMatch = this.Answers[i].PercentMatch;
1402                }
1403        }
1404        if (BestMatch > -1){
1405                this.Score = this.Answers[BestMatch].PercentMatch;
1406                this.Feedback = PartlyIncorrect + ' ';
1407                this.Feedback += '<span class="Answer">' + this.Answers[BestMatch].CorrectStart;
1408                this.Feedback += '<span class="Highlight">' + this.Answers[BestMatch].WrongMiddle + '</span>';
1409                this.Feedback += this.Answers[BestMatch].CorrectEnd + '</span>';
1410                this.Hint = '<span class="Answer">' + this.Answers[BestMatch].CorrectStart;
1411                this.Hint += '<span class="Highlight">' + this.Answers[BestMatch].Hint + '</span></span>';
1412                this.HintPenalty = this.Answers[BestMatch].HintPenalty;
1413        }
1414        else{
1415                this.Score = 0;
1416                this.Feedback = '';
1417        }
1418}
1419
1420CheckAnswerArray.prototype.GetBestMatch = CheckAnswerArray_GetBestMatch;
1421
1422function CheckShortAnswer(QNum){
1423//bail if question doesn't exist or exercise finished
1424        if ((State[QNum].length < 1)||(Finished == true)){return;}
1425       
1426//bail if question already complete
1427        if (State[QNum][0] > -1){return;}
1428
1429//Get the guess
1430        var G = document.getElementById('Q_' + QNum + '_Guess').value;
1431       
1432//If no guess, bail with message; no penalty
1433        if (G.length < 1){
1434                ShowMessage(PleaseEnter);
1435                return;
1436        }
1437
1438//Increment tries
1439        State[QNum][2]++;
1440       
1441//Create a check object
1442        var CA = new CheckAnswerArray(CaseSensitive);
1443
1444        CA.ClearAll();
1445        for (var ANum=0; ANum<I[QNum][3].length; ANum++){
1446                CA.AddAnswer(G, I[QNum][3][ANum][0], I[QNum][3][ANum][3], I[QNum][3][ANum][1]);
1447        }
1448        CA.GetBestMatch();
1449       
1450//Store any match in the state tracking field
1451        if (CA.MatchNum > -1){
1452                State[QNum][5] += String.fromCharCode(65+CA.MatchNum) + ',';
1453        }
1454
1455//Add the percent correct value for this answer to the Q State (works for all
1456//situations, wrong or right
1457        State[QNum][3] += CA.Score;
1458       
1459//Now branch, based on the nature of the match
1460//Is it a complete match?
1461        if (CA.CompleteMatch == true){
1462               
1463//Is it with a wrong answer, or a right answer?
1464                if (CA.Score == 100){
1465//It's right
1466                        CalculateShortAnsQuestionScore(QNum);
1467//Get correct answer list if required, assuming there are any other correct alternatives
1468                        if (ShowAlsoCorrect == true){
1469                                var AlsoCorrectList = GetCorrectList(QNum, G, false);
1470                                if (AlsoCorrectList.length > 0){
1471                                        CA.Feedback += '<br />' + CorrectList + '<br />' +  '<span class="Answer">' + AlsoCorrectList + '</span>';
1472                                }
1473                        }       
1474               
1475//Get the overall score and add it to the feedback
1476                        if (ContinuousScoring == true){
1477                                CalculateOverallScore();
1478                                CA.Feedback += '<br />' + YourScoreIs + ' ' + Score + '%.';
1479                                WriteToInstructions(YourScoreIs + ' ' + Score + '%.');
1480                        }
1481                        ShowMessage(CA.Feedback);
1482//Put the answer in
1483                        ReplaceGuessBox(QNum, G);
1484                        CheckFinished();
1485                        return;
1486                }
1487        }
1488       
1489//Otherwise, it's a match to a predicted wrong/partially correct, or a partial
1490//match to a right answer
1491        if (CA.Feedback.length < 1){CA.Feedback = DefaultWrong;}
1492        ShowMessage(CA.Feedback);
1493
1494//If necessary, switch a hybrid question to m/c
1495        if (State[QNum][2] >= HybridTries){
1496                SwitchHybridDisplay(QNum);
1497        }
1498}
1499
1500function CalculateShortAnsQuestionScore(QNum){
1501        var Tries = State[QNum][2] + State[QNum][4]; //include tries and hint penalties;
1502        var PercentCorrect = State[QNum][3];
1503        var HintPenalties = State[QNum][4];
1504
1505//Make sure it's not already complete
1506        if (State[QNum][0] < 0){
1507                if (HintPenalties >= 1){
1508                        State[QNum][0] = 0;
1509                }
1510                else{
1511                        State[QNum][0] = (PercentCorrect/(100*Tries));
1512                }
1513                if (State[QNum][0] < 0){
1514                        State[QNum][0] = 0;
1515                }
1516        }
1517}
1518
1519function SwitchHybridDisplay(QNum){
1520        if (document.getElementById('Q_' + QNum + '_Hybrid_MC') != null){
1521                document.getElementById('Q_' + QNum + '_Hybrid_MC').style.display = '';
1522                if (document.getElementById('Q_' + QNum + '_SA') != null){
1523                        document.getElementById('Q_' + QNum + '_SA').style.display = 'none';
1524                }
1525        }
1526}
1527
1528function GetCorrectArray(QNum){
1529        var Result = new Array();
1530        for (var ANum=0; ANum<I[QNum][3].length; ANum++){
1531                if (I[QNum][3][ANum][2] == 1){ //This is an acceptable correct answer
1532                        Result.push(I[QNum][3][ANum][0]);
1533                }
1534        }       
1535        return Result;
1536}
1537
1538function GetCorrectList(QNum, Answer, IncludeAnswer){
1539        var As = GetCorrectArray(QNum);
1540        var Result = '';
1541        for (var ANum=0; ANum<As.length; ANum++){
1542                if ((IncludeAnswer == true)||(As[ANum] != Answer)){
1543                        Result += As[ANum] + '<br />';
1544                }
1545        }
1546        return Result;
1547}
1548
1549function GetFirstCorrectAnswer(QNum){
1550        var As = GetCorrectArray(QNum);
1551        if (As.length > 0){
1552                return As[0];
1553        }
1554        else{
1555                return '';
1556        }
1557}
1558
1559function ReplaceGuessBox(QNum, Ans){
1560        if (document.getElementById('Q_' + QNum + '_SA') != null){
1561                var El = document.getElementById('Q_' + QNum + '_SA');
1562                while (El.childNodes.length > 0){
1563                        El.removeChild(El.childNodes[0]);
1564                }
1565                var A = document.createElement('span');
1566                A.setAttribute('class', 'Answer');
1567                var T = document.createTextNode(Ans);
1568                A.appendChild(T);
1569                El.appendChild(A);
1570        }
1571}
1572
1573
1574
1575function ShowAnswers(QNum){
1576//bail if question doesn't exist or exercise finished
1577        if ((State[QNum].length < 1)||(Finished == true)){return;}
1578       
1579//Get the answer list to display
1580        var Ans = GetCorrectList(QNum, '', false);
1581        Ans = CorrectList + '<br /><span class="Answer">' + Ans + '</span>';
1582       
1583//Display feedback
1584        ShowMessage(Ans);
1585       
1586//Set the score for this question to 0 if no
1587        if (State[QNum][0] < 1){
1588                State[QNum][0] = 0;
1589        }
1590
1591//Get the first correct answer
1592        var FirstAns = GetFirstCorrectAnswer(QNum);
1593       
1594//Replace the textbox
1595        ReplaceGuessBox(QNum, FirstAns);
1596       
1597//This may be the last, so check finished status
1598        CheckFinished();
1599}
1600
1601
1602
1603
1604
1605function ShowHint(QNum){
1606//bail if question doesn't exist or exercise finished
1607        if ((State[QNum].length < 1)||(Finished == true)){return;}
1608       
1609//bail if question already complete
1610        if (State[QNum][0] > -1){return;}
1611
1612//Get the guess
1613        var G = document.getElementById('Q_' + QNum + '_Guess').value;
1614       
1615//If no guess, give the first correct bit
1616        if (G.length < 1){
1617                var Ans = GetFirstCorrectAnswer(QNum);
1618                var Hint = Ans.charAt(0);
1619                ShowMessage(NextCorrect + '<br />' + Hint);
1620//Penalty for hint
1621                State[QNum][4] += (1/Ans.length);
1622                return;
1623        }
1624
1625//Increment tries
1626        State[QNum][2]++;
1627       
1628//Create a check object
1629        var CA = new CheckAnswerArray(CaseSensitive);
1630
1631        CA.ClearAll();
1632        for (var ANum=0; ANum<I[QNum][3].length; ANum++){
1633//Use only correct answers
1634                if (I[QNum][3][ANum][2] == 1){
1635                        CA.AddAnswer(G, I[QNum][3][ANum][0], I[QNum][3][ANum][3], I[QNum][3][ANum][1]);
1636                }
1637        }
1638        CA.GetBestMatch();
1639        if (CA.CompleteMatch == true){
1640//It's right!
1641                CheckShortAnswer(QNum);
1642                return;
1643        }
1644        else{
1645                if (CA.Hint.length > 0){
1646                        ShowMessage(NextCorrect + '<br />' + CA.Hint);
1647                        State[QNum][4] += CA.HintPenalty;
1648                }
1649                else{
1650                        ShowMessage(DefaultWrong + '<br />' + NextCorrect + '<br />' + GetFirstCorrectAnswer(QNum)[0]);
1651                }
1652        }
1653}
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663//-->
1664
1665//]]>
1666
1667</script>
1668
1669
1670</head>
1671
1672<body onload="StartUp()" id="TheBody">
1673
1674<!-- BeginTopNavButtons -->
1675
1676
1677<div class="NavButtonBar">
1678
1679
1680<button class="NavButton" onfocus="NavBtnOver(this)" onblur="NavBtnOut(this)" onmouseover="NavBtnOver(this)" onmouseout="NavBtnOut(this)" onmousedown="NavBtnDown(this)" onmouseup="NavBtnOut(this)" onclick="history.back(); return false;">&lt;=</button>
1681
1682
1683
1684<button class="NavButton" onfocus="NavBtnOver(this)" onblur="NavBtnOut(this)"  onmouseover="NavBtnOver(this)" onmouseout="NavBtnOut(this)" onmousedown="NavBtnDown(this)" onmouseup="NavBtnOut(this)" onclick="location='contents.htm'; return false;"> Index </button>
1685
1686
1687
1688<button class="NavButton" onfocus="NavBtnOver(this)" onblur="NavBtnOut(this)" onmouseover="NavBtnOver(this)" onmouseout="NavBtnOut(this)" onmousedown="NavBtnDown(this)" onmouseup="NavBtnOut(this)" onclick="location='jcross1.htm'; return false;">=&gt;</button>
1689
1690
1691</div>
1692
1693
1694<!-- EndTopNavButtons -->
1695
1696<div class="Titles">
1697        <h2 class="ExerciseTitle">A Text-Entry Quiz made with JQuiz</h2>
1698        <h3 class="ExerciseSubtitle">Short-answer quiz</h3>
1699
1700
1701</div>
1702
1703<div id="InstructionsDiv" class="StdDiv">
1704        <p id="Instructions">Type your answer for each question, then press "Check". If you need help, you can click on the "Hint" button to get a free letter.</p>
1705</div>
1706
1707
1708<div class="LeftContainer">
1709
1710        <div id="Reading" class="StdDiv">
1711
1712                <div id="ReadingDiv">
1713<h3 class="ExerciseSubtitle">Reading</h3><p>Text blah tosh garbage crap nonsense utter rubbish. Text blah tosh garbage crap nonsense utter rubbish. Text blah tosh garbage crap nonsense utter rubbish. Text blah tosh garbage crap nonsense utter rubbish. Text blah tosh garbage crap nonsense utter rubbish. Text blah tosh garbage crap nonsense utter rubbish. Text blah tosh garbage crap nonsense utter rubbish. Text blah tosh garbage crap nonsense utter rubbish. Text blah tosh garbage crap nonsense utter rubbish. Text blah tosh garbage crap nonsense utter rubbish. Text blah tosh garbage crap nonsense utter rubbish. <br /><br />Text blah tosh garbage crap nonsense utter rubbish. Text blah tosh garbage crap nonsense utter rubbish. Text blah tosh garbage crap nonsense utter rubbish. Text blah tosh garbage crap nonsense utter rubbish. Text blah tosh garbage crap nonsense utter rubbish. Text blah tosh garbage crap nonsense utter rubbish. Text blah tosh garbage crap nonsense utter rubbish. Text blah tosh garbage crap nonsense utter rubbish. <br /><br />Text blah tosh garbage crap nonsense utter rubbish. Text blah tosh garbage crap nonsense utter rubbish. Text blah tosh garbage crap nonsense utter rubbish. Text blah tosh garbage crap nonsense utter rubbish. Text blah tosh garbage crap nonsense utter rubbish. Text blah tosh garbage crap nonsense utter rubbish. Text blah tosh garbage crap nonsense utter rubbish. Text blah tosh garbage crap nonsense utter rubbish. </p>
1714                </div>
1715        </div>
1716
1717</div>
1718
1719
1720<div class="RightContainer">
1721
1722
1723
1724<div id="MainDiv" class="StdDiv">
1725 
1726<div class="QuestionNavigation">
1727
1728<p style="text-align: right;">
1729<button id="ShowMethodButton" class="FuncButton" onfocus="FuncBtnOver(this)" onblur="FuncBtnOut(this)" onmouseover="FuncBtnOver(this)" onmouseout="FuncBtnOut(this)" onmousedown="FuncBtnDown(this)" onmouseup="FuncBtnOver(this)" onclick="ShowHideQuestions(); return false;">Show all questions</button>
1730</p>
1731
1732<div id="OneByOneReadout">
1733<button id="PrevQButton" class="FuncButton" onfocus="FuncBtnOver(this)" onblur="FuncBtnOut(this)" onmouseover="FuncBtnOver(this)" onmouseout="FuncBtnOut(this)" onmousedown="FuncBtnDown(this)" onmouseup="FuncBtnOver(this)" onclick="ChangeQ(-1); return false;">&lt;=</button>
1734
1735<span id="QNumReadout" class="QNum">&nbsp;</span>
1736
1737<button id="NextQButton" class="FuncButton" onfocus="FuncBtnOver(this)" onblur="FuncBtnOut(this)" onmouseover="FuncBtnOver(this)" onmouseout="FuncBtnOut(this)" onmousedown="FuncBtnDown(this)" onmouseup="FuncBtnOver(this)" onclick="ChangeQ(1); return false;">=&gt;</button>
1738<br />
1739</div>
1740
1741</div>
1742 
1743<ol class="QuizQuestions" id="Questions">
1744<li class="QuizQuestion" id="Q_0"><p class="QuestionText">Which button should you click on if you want the exercise to help you by giving you one letter in the answer?</p><div class="ShortAnswer" id="Q_0_SA"><form method="post" action="" onsubmit="return false;"><div><input type="text" id="Q_0_Guess" onfocus="TrackFocus('Q_0_Guess')" onblur="LeaveGap()" class="GapBox" size="15"></input><br /><br /><button class="FuncButton" onfocus="FuncBtnOver(this)" onblur="FuncBtnOut(this)" onmouseover="FuncBtnOver(this)" onmouseout="FuncBtnOut(this)"  onmousedown="FuncBtnDown(this)" onmouseup="FuncBtnOut(this)" onclick="CheckShortAnswer(0)">Check</button><button class="FuncButton" onfocus="FuncBtnOver(this)" onblur="FuncBtnOut(this)" onmouseover="FuncBtnOver(this)" onmouseout="FuncBtnOut(this)"  onmousedown="FuncBtnDown(this)" onmouseup="FuncBtnOut(this)" onclick="ShowHint(0)">Hint</button><button class="FuncButton" onfocus="FuncBtnOver(this)" onblur="FuncBtnOut(this)" onmouseover="FuncBtnOver(this)" onmouseout="FuncBtnOut(this)"  onmousedown="FuncBtnDown(this)" onmouseup="FuncBtnOut(this)" onclick="ShowAnswers(0)">Show answer</button></div></form></div></li>
1745<li class="QuizQuestion" id="Q_1"><p class="QuestionText">What word would be appropriate in this sentence:<br /><br />"JQuiz is the tool to use when you want your students to be able to ________ the answer themselves, rather than selecting it from a list."</p><div class="ShortAnswer" id="Q_1_SA"><form method="post" action="" onsubmit="return false;"><div><input type="text" id="Q_1_Guess" onfocus="TrackFocus('Q_1_Guess')" onblur="LeaveGap()" class="GapBox" size="9"></input><br /><br /><button class="FuncButton" onfocus="FuncBtnOver(this)" onblur="FuncBtnOut(this)" onmouseover="FuncBtnOver(this)" onmouseout="FuncBtnOut(this)"  onmousedown="FuncBtnDown(this)" onmouseup="FuncBtnOut(this)" onclick="CheckShortAnswer(1)">Check</button><button class="FuncButton" onfocus="FuncBtnOver(this)" onblur="FuncBtnOut(this)" onmouseover="FuncBtnOver(this)" onmouseout="FuncBtnOut(this)"  onmousedown="FuncBtnDown(this)" onmouseup="FuncBtnOut(this)" onclick="ShowHint(1)">Hint</button><button class="FuncButton" onfocus="FuncBtnOver(this)" onblur="FuncBtnOut(this)" onmouseover="FuncBtnOver(this)" onmouseout="FuncBtnOut(this)"  onmousedown="FuncBtnDown(this)" onmouseup="FuncBtnOut(this)" onclick="ShowAnswers(1)">Show answer</button></div></form></div></li>
1746<li class="QuizQuestion" id="Q_2"><p class="QuestionText">A quiz made with JQuiz will accept more than one correct answer for each question. How many correct answers can you include?</p><div class="ShortAnswer" id="Q_2_SA"><form method="post" action="" onsubmit="return false;"><div><input type="text" id="Q_2_Guess" onfocus="TrackFocus('Q_2_Guess')" onblur="LeaveGap()" class="GapBox" size="19"></input><br /><br /><button class="FuncButton" onfocus="FuncBtnOver(this)" onblur="FuncBtnOut(this)" onmouseover="FuncBtnOver(this)" onmouseout="FuncBtnOut(this)"  onmousedown="FuncBtnDown(this)" onmouseup="FuncBtnOut(this)" onclick="CheckShortAnswer(2)">Check</button><button class="FuncButton" onfocus="FuncBtnOver(this)" onblur="FuncBtnOut(this)" onmouseover="FuncBtnOver(this)" onmouseout="FuncBtnOut(this)"  onmousedown="FuncBtnDown(this)" onmouseup="FuncBtnOut(this)" onclick="ShowHint(2)">Hint</button><button class="FuncButton" onfocus="FuncBtnOver(this)" onblur="FuncBtnOut(this)" onmouseover="FuncBtnOver(this)" onmouseout="FuncBtnOut(this)"  onmousedown="FuncBtnDown(this)" onmouseup="FuncBtnOut(this)" onclick="ShowAnswers(2)">Show answer</button></div></form></div></li>
1747<li class="QuizQuestion" id="Q_3"><p class="QuestionText">With JBC, it takes a long time to make a quiz, but the student can do it in a very short time. With JQuiz, the situation is reversed: ________ a quiz doesn't take long, but doing the quiz takes longer.</p><div class="ShortAnswer" id="Q_3_SA"><form method="post" action="" onsubmit="return false;"><div><input type="text" id="Q_3_Guess" onfocus="TrackFocus('Q_3_Guess')" onblur="LeaveGap()" class="GapBox" size="12"></input><br /><br /><button class="FuncButton" onfocus="FuncBtnOver(this)" onblur="FuncBtnOut(this)" onmouseover="FuncBtnOver(this)" onmouseout="FuncBtnOut(this)"  onmousedown="FuncBtnDown(this)" onmouseup="FuncBtnOut(this)" onclick="CheckShortAnswer(3)">Check</button><button class="FuncButton" onfocus="FuncBtnOver(this)" onblur="FuncBtnOut(this)" onmouseover="FuncBtnOver(this)" onmouseout="FuncBtnOut(this)"  onmousedown="FuncBtnDown(this)" onmouseup="FuncBtnOut(this)" onclick="ShowHint(3)">Hint</button><button class="FuncButton" onfocus="FuncBtnOver(this)" onblur="FuncBtnOut(this)" onmouseover="FuncBtnOver(this)" onmouseout="FuncBtnOut(this)"  onmousedown="FuncBtnDown(this)" onmouseup="FuncBtnOut(this)" onclick="ShowAnswers(3)">Show answer</button></div></form></div></li>
1748<li class="QuizQuestion" id="Q_4"><p class="QuestionText">What scripting language do the Hot Potatoes use to make the quizzes interactive?</p><div class="ShortAnswer" id="Q_4_SA"><form method="post" action="" onsubmit="return false;"><div><input type="text" id="Q_4_Guess" onfocus="TrackFocus('Q_4_Guess')" onblur="LeaveGap()" class="GapBox" size="11"></input><br /><br /><button class="FuncButton" onfocus="FuncBtnOver(this)" onblur="FuncBtnOut(this)" onmouseover="FuncBtnOver(this)" onmouseout="FuncBtnOut(this)"  onmousedown="FuncBtnDown(this)" onmouseup="FuncBtnOut(this)" onclick="CheckShortAnswer(4)">Check</button><button class="FuncButton" onfocus="FuncBtnOver(this)" onblur="FuncBtnOut(this)" onmouseover="FuncBtnOver(this)" onmouseout="FuncBtnOut(this)"  onmousedown="FuncBtnDown(this)" onmouseup="FuncBtnOut(this)" onclick="ShowHint(4)">Hint</button><button class="FuncButton" onfocus="FuncBtnOver(this)" onblur="FuncBtnOut(this)" onmouseover="FuncBtnOver(this)" onmouseout="FuncBtnOut(this)"  onmousedown="FuncBtnDown(this)" onmouseup="FuncBtnOut(this)" onclick="ShowAnswers(4)">Show answer</button></div></form></div></li></ol>
1749
1750
1751
1752</div>
1753
1754
1755</div>
1756
1757
1758<div class="Feedback" id="FeedbackDiv">
1759<div class="FeedbackText" id="FeedbackContent"></div>
1760<button id="FeedbackOKButton" class="FuncButton" onfocus="FuncBtnOver(this)" onblur="FuncBtnOut(this)" onmouseover="FuncBtnOver(this)" onmouseout="FuncBtnOut(this)" onmousedown="FuncBtnDown(this)" onmouseup="FuncBtnOut(this)" onclick="HideFeedback(); return false;">&nbsp;OK&nbsp;</button>
1761</div>
1762
1763<!-- BeginBottomNavButtons -->
1764
1765
1766<div class="NavButtonBar" id="BottomNavBar">
1767
1768
1769<button class="NavButton" onfocus="NavBtnOver(this)" onblur="NavBtnOut(this)" onmouseover="NavBtnOver(this)" onmouseout="NavBtnOut(this)" onmousedown="NavBtnDown(this)" onmouseup="NavBtnOut(this)" onclick="history.back(); return false;">&lt;=</button>
1770
1771
1772
1773<button class="NavButton" onfocus="NavBtnOver(this)" onblur="NavBtnOut(this)"  onmouseover="NavBtnOver(this)" onmouseout="NavBtnOut(this)" onmousedown="NavBtnDown(this)" onmouseup="NavBtnOut(this)" onclick="location='contents.htm'; return false;"> Index </button>
1774
1775
1776
1777<button class="NavButton" onfocus="NavBtnOver(this)" onblur="NavBtnOut(this)" onmouseover="NavBtnOver(this)" onmouseout="NavBtnOut(this)" onmousedown="NavBtnDown(this)" onmouseup="NavBtnut(this)" onclick="location='jcross1.htm'; return false;">=&gt;</button>
1778
1779
1780</div>
1781
1782
1783<!-- EndBottomNavButtons -->
1784
1785<!-- BeginSubmissionForm -->
1786
1787<!-- EndSubmissionForm -->
1788
1789</body>
1790
1791</html>
Note: See TracBrowser for help on using the browser.