root/trunk/max-javahotpot-tutorial/tutorial/jcloze1.htm

Revision 35, 33.4 KB (checked in by max, 18 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 Ismail Ali Gago."></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="Ismail Ali Gago" />
8<meta name="DC:Creator" content="UNREGISTERED" />
9<meta name="DC:Title" content="Ejercicio de completar huecos realizado con JCloze" />
10
11
12<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> 
13
14<title>
15Ejercicio de completar huecos realizado con JCloze
16</title>
17
18<!-- Made with executable version 6.0 Release 2 Build 0 -->
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: #ffffff;
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: #003300;
89}
90
91button{
92        display: inline;
93}
94
95.ExerciseTitle{
96        font-size: large;
97        color: #003300;
98}
99
100.ExerciseSubtitle{
101        color: #003300;
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        color: #003300;
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: #ffffff;
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: #003300;
157        position: absolute;
158        display: none;
159        font-size: small;
160}
161
162
163
164
165div.ExerciseDiv{
166        color: #000000;
167}
168
169/* JMatch flashcard styles */
170table.FlashcardTable{
171        background-color: transparent;
172        color: #000000;
173        border-color: #000000;
174        margin-left: 5%;
175        margin-right: 5%;
176        margin-top: 2em;
177        margin-bottom: 2em;
178        width: 90%;
179        position: relative;
180        align: center;
181        padding: 0px;
182}
183
184table.FlashcardTable tr{
185        border-style: none;
186        margin: 0px;
187        padding: 0px;
188        background-color: #aaddaa;
189}
190
191table.FlashcardTable td.Showing{
192        font-size: large;
193        text-align: center;
194        width: 50%;
195        display: table-cell;
196        padding: 2em;
197        margin: 0px;
198        border-style: solid;
199        border-width: 1px;
200        color: #000000;
201        background-color: #aaddaa;
202}
203
204table.FlashcardTable td.Hidden{
205        display: none;
206}
207
208/* JMix styles */
209div#SegmentDiv{
210        margin-top: 2em;
211        margin-bottom: 2em;
212        text-align: center;
213}
214
215a.ExSegment{
216        font-size: medium;
217        font-weight: bold;
218        text-decoration: none;
219        color: #000000;
220}
221
222span.RemainingWordList{
223        font-style: italic;
224}
225
226div.DropLine {
227        position: absolute;
228        text-align: center;
229        border-bottom-style: solid;
230        border-bottom-width: 1px;
231        border-bottom-color: #003300;
232        width: 80%;
233}
234
235/* JCloze styles */
236
237input{
238        font-family: Geneva,Arial;
239        font-size: larger;
240}
241
242.ClozeWordList{
243        text-align: center;
244        font-weight: bold;
245}
246
247div.ClozeBody{
248        text-align: left;
249        margin-top: 2em;
250        margin-bottom: 2em;
251        line-height: 2.0
252}
253
254span.GapSpan{
255        font-weight: bold;
256}
257
258/* JCross styles */
259
260table.CrosswordGrid{
261        margin: auto auto 1em auto;
262        border-collapse: collapse;
263        padding: 0px;
264}
265
266table.CrosswordGrid td{
267        width: 1.5em;
268        height: 1.5em;
269        text-align: center;
270        vertical-align: middle;
271        font-size: large;
272        padding: 0px;
273        margin: 0px;
274        border-style: solid;
275        border-width: 1px;
276        border-color: #000000;
277}
278
279table.CrosswordGrid td.BlankCell{
280        background-color: #000000;
281        color: #000000;
282}
283
284table.CrosswordGrid td.LetterOnlyCell{
285        text-align: center;
286        vertical-align: middle;
287        background-color: #ffffff;
288        color: #000000;
289        font-weight: bold;
290}
291
292table.CrosswordGrid td.NumLetterCell{
293        text-align: left;
294        vertical-align: top;
295        background-color: #ffffff;
296        color: #000000;
297        padding: 1px;
298        font-weight: bold;
299}
300
301.NumLetterCellText{
302        cursor: pointer;
303}
304
305.GridNum{
306        vertical-align: super;
307        font-size: x-small;
308        font-weight: bold;
309        text-decoration: none;
310        color: #000000;
311}
312
313table#Clues{
314        margin: auto;
315        vertical-align: top;
316}
317
318table#Clues td{
319        vertical-align: top;
320}
321
322table.ClueList{
323  margin: auto;
324}
325
326td.ClueNum{
327        text-align: right;
328        font-weight: bold;
329        vertical-align: top;
330}
331
332td.Clue{
333        text-align: left;
334}
335
336div#ClueEntry{
337        text-align: left;
338        margin-bottom: 1em;
339}
340
341/* Keypad styles */
342
343div.Keypad{
344        text-align: center;
345}
346
347div.Keypad button{
348        font-family: Geneva,Arial;
349        font-size: 120%;
350        background-color: #ffffff;
351        color: #000000;
352        width: 2em;
353}
354
355/* JQuiz styles */
356
357div.QuestionNavigation{
358        text-align: center;
359}
360
361.QNum{
362        margin: 0em 1em 0.5em 1em;
363        font-weight: bold;
364        vertical-align: middle;
365}
366
367textarea{
368        font-family: Geneva,Arial;
369        font-size: larger;
370}
371
372.QuestionText{
373
374}
375
376.Answer{
377        font-size: 120%;
378        letter-spacing: 0.1em;
379}
380
381.Highlight{
382        color: #000000;
383        background-color: #ffff00;
384        font-weight: bold;
385        font-size: 120%;
386}
387
388ol.QuizQuestions{
389        text-align: left;
390        list-style-type: none;
391}
392
393li.QuizQuestion{
394        padding: 1em;
395        border-style: solid;
396        border-width: 0px 0px 1px 0px;
397}
398
399ol.MCAnswers{
400        text-align: left;
401        list-style-type: upper-alpha;
402        padding: 1em;
403}
404
405ol.MCAnswers li{
406        margin-bottom: 1em;
407}
408
409ol.MSelAnswers{
410        text-align: left;
411        list-style-type: lower-alpha;
412        padding: 1em;
413}
414
415div.ShortAnswer{
416        padding: 1em;
417}
418
419div.StdDiv{
420        background-color: #aaddaa;
421        text-align: center;
422        font-size: small;
423        color: #000000;
424        padding: 8px;
425        border-style: solid;
426        border-width: 1px 1px 1px 1px;
427        border-color: #000000;
428        margin: 1px;
429}
430
431.FuncButton {
432        text-align: center;
433        border-style: solid;
434
435        border-left-color: #d4eed4;
436        border-top-color: #d4eed4;
437        border-right-color: #556e55;
438        border-bottom-color: #556e55;
439        color: #000000;
440        background-color: #aaddaa;
441
442        border-width: 2px;
443        padding: 3px 6px 3px 6px;
444        cursor: pointer;
445}
446
447.FuncButtonUp {
448        color: #aaddaa;
449        text-align: center;
450        border-style: solid;
451
452        border-left-color: #d4eed4;
453        border-top-color: #d4eed4;
454        border-right-color: #556e55;
455        border-bottom-color: #556e55;
456
457        background-color: #000000;
458        color: #aaddaa;
459        border-width: 2px;
460        padding: 3px 6px 3px 6px;
461        cursor: pointer;
462}
463
464.FuncButtonDown {
465        color: #aaddaa;
466        text-align: center;
467        border-style: solid;
468
469        border-left-color: #556e55;
470        border-top-color: #556e55;
471        border-right-color: #d4eed4;
472        border-bottom-color: #d4eed4;
473        background-color: #000000;
474        color: #aaddaa;
475
476        border-width: 2px;
477        padding: 3px 6px 3px 6px;
478        cursor: pointer;
479}
480
481/*BeginNavBarStyle*/
482
483div.NavButtonBar{
484        background-color: #006600;
485        text-align: center;
486        margin: 2px 0px 2px 0px;
487        clear: both;
488        font-size: small;
489}
490
491.NavButton {
492        border-style: solid;
493       
494        border-left-color: #7fb27f;
495        border-top-color: #7fb27f;
496        border-right-color: #003300;
497        border-bottom-color: #003300;
498        background-color: #006600;
499        color: #ffffff;
500
501        border-width: 2px;
502        cursor: pointer;       
503}
504
505.NavButtonUp {
506        border-style: solid;
507
508        border-left-color: #7fb27f;
509        border-top-color: #7fb27f;
510        border-right-color: #003300;
511        border-bottom-color: #003300;
512        color: #006600;
513        background-color: #ffffff;
514
515        border-width: 2px;
516        cursor: pointer;       
517}
518
519.NavButtonDown {
520        border-style: solid;
521
522        border-left-color: #003300;
523        border-top-color: #003300;
524        border-right-color: #7fb27f;
525        border-bottom-color: #7fb27f;
526        color: #006600;
527        background-color: #ffffff;
528
529        border-width: 2px;
530        cursor: pointer;       
531}
532
533/*EndNavBarStyle*/
534
535a{
536        color: #0000ff;
537}
538
539a: visited{
540        color: #0000cc;
541}
542
543a:hover{
544        color: #0000ff;
545}
546
547div.CardStyle {
548        position: absolute;
549        font-family: Geneva,Arial;
550        font-size: small;
551        padding: 5px;
552        border-style: solid;
553        border-width: 1px;
554        color: #000000;
555        background-color: #aaddaa;
556        left: -50px;
557        top: -50px;
558        overflow: visible;
559}
560
561.rtl{
562        text-align: right;
563        font-size: large;
564}
565
566
567       </style>
568
569<script type="text/javascript">
570
571//<![CDATA[
572
573<!--
574
575
576function Client(){
577//if not a DOM browser, hopeless
578        this.min = false; if (document.getElementById){this.min = true;};
579
580        this.ua = navigator.userAgent;
581        this.name = navigator.appName;
582        this.ver = navigator.appVersion; 
583
584//Get data about the browser
585        this.mac = (this.ver.indexOf('Mac') != -1);
586        this.win = (this.ver.indexOf('Windows') != -1);
587
588//Look for Gecko
589        this.gecko = (this.ua.indexOf('Gecko') > 1);
590        if (this.gecko){
591                this.geckoVer = parseInt(this.ua.substring(this.ua.indexOf('Gecko')+6, this.ua.length));
592                if (this.geckoVer < 20020000){this.min = false;}
593        }
594       
595//Look for Firebird
596        this.firebird = (this.ua.indexOf('Firebird') > 1);
597       
598//Look for Safari
599        this.safari = (this.ua.indexOf('Safari') > 1);
600        if (this.safari){
601                this.gecko = false;
602        }
603       
604//Look for IE
605        this.ie = (this.ua.indexOf('MSIE') > 0);
606        if (this.ie){
607                this.ieVer = parseFloat(this.ua.substring(this.ua.indexOf('MSIE')+5, this.ua.length));
608                if (this.ieVer < 5.5){this.min = false;}
609        }
610       
611//Look for Opera
612        this.opera = (this.ua.indexOf('Opera') > 0);
613        if (this.opera){
614                this.operaVer = parseFloat(this.ua.substring(this.ua.indexOf('Opera')+6, this.ua.length));
615                if (this.operaVer < 7.04){this.min = false;}
616        }
617        if (this.min == false){
618                alert('Your browser may not be able to handle this page.');
619        }
620       
621//Special case for the horrible ie5mac
622        this.ie5mac = (this.ie&&this.mac&&(this.ieVer<6));
623}
624
625var C = new Client();
626
627//for (prop in C){
628//      alert(prop + ': ' + C[prop]);
629//}
630
631
632
633//CODE FOR HANDLING NAV BUTTONS AND FUNCTION BUTTONS
634
635//[strNavBarJS]
636function NavBtnOver(Btn){
637        if (Btn.className != 'NavButtonDown'){Btn.className = 'NavButtonUp';}
638}
639
640function NavBtnOut(Btn){
641        Btn.className = 'NavButton';
642}
643
644function NavBtnDown(Btn){
645        Btn.className = 'NavButtonDown';
646}
647//[/strNavBarJS]
648
649function FuncBtnOver(Btn){
650        if (Btn.className != 'FuncButtonDown'){Btn.className = 'FuncButtonUp';}
651}
652
653function FuncBtnOut(Btn){
654        Btn.className = 'FuncButton';
655}
656
657function FuncBtnDown(Btn){
658        Btn.className = 'FuncButtonDown';
659}
660
661function FocusAButton(){
662        if (document.getElementById('CheckButton1') != null){
663                document.getElementById('CheckButton1').focus();
664        }
665        else{
666                if (document.getElementById('CheckButton2') != null){
667                        document.getElementById('CheckButton2').focus();
668                }
669                else{
670                        document.getElementsByTagName('button')[0].focus();
671                }
672        }
673}
674
675
676
677
678//CODE FOR HANDLING DISPLAY OF POPUP FEEDBACK BOX
679
680var topZ = 1000;
681
682function ShowMessage(Feedback){
683        var Output = Feedback + '<br /><br />';
684        document.getElementById('FeedbackContent').innerHTML = Output;
685        var FDiv = document.getElementById('FeedbackDiv');
686        topZ++;
687        FDiv.style.zIndex = topZ;
688        FDiv.style.top = TopSettingWithScrollOffset(30) + 'px';
689//IE can't focus a hidden div; Moz needs to focus before display to avoid jumping
690        if (C.gecko){
691                document.getElementById('FeedbackOKButton').focus();
692        }
693        FDiv.style.display = 'block';
694
695        ShowElements(false, 'input');
696        ShowElements(false, 'select');
697        ShowElements(false, 'object');
698        if (C.ie){
699                document.getElementById('FeedbackOKButton').focus();
700        }
701       
702//
703}
704
705function ShowElements(Show, TagName){
706//Special for IE bug -- hide all the form elements that will show through the popup
707        if (C.ie){
708                var Els = document.getElementsByTagName(TagName);
709                for (var i=0; i<Els.length; i++){
710                        if (Show == true){
711                                Els[i].style.display = 'inline';
712                        }
713                        else{
714                                Els[i].style.display = 'none';
715                        }
716                }
717        }
718}
719
720function HideFeedback(){
721        document.getElementById('FeedbackDiv').style.display = 'none';
722        ShowElements(true, 'input');
723        ShowElements(true, 'select');
724        ShowElements(true, 'object');
725        if (Finished == true){
726                Finish();
727        }
728}
729
730
731//GENERAL UTILITY FUNCTIONS AND VARIABLES
732
733//PAGE DIMENSION FUNCTIONS
734function PageDim(){
735//Get the page width and height
736        this.W = 600;
737        this.H = 400;
738        this.W = document.getElementsByTagName('body')[0].clientWidth;
739        this.H = document.getElementsByTagName('body')[0].clientHeight;
740}
741
742var pg = null;
743
744function GetPageXY(El) {
745        var XY = {x: 0, y: 0};
746        while(El){
747                XY.x += El.offsetLeft;
748                XY.y += El.offsetTop;
749                El = El.offsetParent;
750        }
751        return XY;
752}
753
754function GetScrollTop(){
755        if (document.documentElement && document.documentElement.scrollTop){
756                return document.documentElement.scrollTop;
757        }
758        else{
759                if (document.body){
760                        return document.body.scrollTop;
761                }
762                else{
763                        return window.pageYOffset;
764                }
765        }
766}
767
768function GetViewportHeight(){
769        if (window.innerWidth){
770                return window.innerWidth;
771        }
772        else{
773                return document.getElementsByTagName('body')[0].clientHeight;
774        }
775}
776
777function TopSettingWithScrollOffset(TopPercent){
778        var T = Math.floor(GetViewportHeight() * (TopPercent/100));
779        return GetScrollTop() + T;
780}
781
782//CODE FOR AVOIDING LOSS OF DATA WHEN BACKSPACE KEY INVOKES history.back()
783var InTextBox = false;
784
785function SuppressBackspace(e){
786        if (InTextBox == true){return;}
787        if (C.ie) {
788                thisKey = window.event.keyCode;
789        }
790        else {
791                thisKey = e.keyCode;
792        }
793
794        var Suppress = false;
795
796        if (thisKey == 8) {
797                Suppress = true;
798        }
799
800        if (Suppress == true){
801                if (C.ie){
802                        window.event.returnValue = false;       
803                        window.event.cancelBubble = true;
804                }
805                else{
806                        e.preventDefault();
807                }
808        }
809}
810
811if (C.ie){
812        document.attachEvent('onkeydown',SuppressBackspace);
813        window.attachEvent('onkeydown',SuppressBackspace);
814}
815else{
816        window.addEventListener('keypress',SuppressBackspace,false);
817}
818
819function ReduceItems(InArray, ReduceToSize){
820        var ItemToDump=0;
821        var j=0;
822        while (InArray.length > ReduceToSize){
823                ItemToDump = Math.floor(InArray.length*Math.random());
824                InArray.splice(ItemToDump, 1);
825        }
826}
827
828function Shuffle(InArray){
829        Temp = new Array();
830        var Len = InArray.length;
831
832        var j = Len;
833
834        for (var i=0; i<Len; i++){
835                Temp[i] = InArray[i];
836        }
837
838        for (i=0; i<Len; i++){
839                Num = Math.floor(j  *  Math.random());
840                InArray[i] = Temp[Num];
841
842                for (var k=Num; k < j; k++) {
843                        Temp[k] = Temp[k+1];
844                }
845                j--;
846        }
847        return InArray;
848}
849
850function WriteToInstructions(Feedback) {
851//      Feedback = '<span class="FeedbackText">' + Feedback + '</span>';
852        document.getElementById('InstructionsDiv').innerHTML = Feedback;
853
854}
855
856
857
858
859function EscapeDoubleQuotes(InString){
860        return InString.replace(/"/g, '&quot;')
861}
862
863function FocusAButton(){
864        if (document.getElementById('CheckButton1') != null){
865                document.getElementById('CheckButton1').focus();
866        }
867        else{
868                document.getElementsByTagName('button')[0].focus();
869        }
870}
871
872function TrimString(InString){
873        var x = 0;
874
875        if (InString.length != 0) {
876                while ((InString.charAt(InString.length - 1) == '\u0020') || (InString.charAt(InString.length - 1) == '\u000A') || (InString.charAt(InString.length - 1) == '\u000D')){
877                        InString = InString.substring(0, InString.length - 1)
878                }
879
880                while ((InString.charAt(0) == '\u0020') || (InString.charAt(0) == '\u000A') || (InString.charAt(0) == '\u000D')){
881                        InString = InString.substring(1, InString.length)
882                }
883
884                while (InString.indexOf('  ') != -1) {
885                        x = InString.indexOf('  ')
886                        InString = InString.substring(0, x) + InString.substring(x+1, InString.length)
887                 }
888
889                return InString;
890        }
891
892        else {
893                return '';
894        }
895}
896
897function FindLongest(InArray){
898        if (InArray.length < 1){return -1;}
899
900        var Longest = 0;
901        for (var i=1; i<InArray.length; i++){
902                if (InArray[i].length > InArray[Longest].length){
903                        Longest = i;
904                }
905        }
906        return Longest;
907}
908
909//UNICODE CHARACTER FUNCTIONS
910function IsCombiningDiacritic(CharNum){
911        var Result = (((CharNum >= 0x0300)&&(CharNum <= 0x370))||((CharNum >= 0x20d0)&&(CharNum <= 0x20ff)));
912        Result = Result || (((CharNum >= 0x3099)&&(CharNum <= 0x309a))||((CharNum >= 0xfe20)&&(CharNum <= 0xfe23)));
913        return Result;
914}
915
916function IsCJK(CharNum){
917        return ((CharNum >= 0x3000)&&(CharNum < 0xd800));
918}
919
920//SETUP FUNCTIONS
921//BROWSER WILL REFILL TEXT BOXES FROM CACHE IF NOT PREVENTED
922function ClearTextBoxes(){
923        var NList = document.getElementsByTagName('input');
924        for (var i=0; i<NList.length; i++){
925                if (NList[i].id.indexOf('Guess') > -1){
926                        NList[i].value = '';
927                }
928                if (NList[i].id.indexOf('Chk') > -1){
929                        NList[i].checked = '';
930                }
931        }
932}
933
934//EXTENSION TO ARRAY OBJECT
935function Array_IndexOf(Input){
936        var Result = -1;
937        for (var i=0; i<this.length; i++){
938                if (this[i] == Input){
939                        Result = i;
940                }
941        }
942        return Result;
943}
944Array.prototype.indexOf = Array_IndexOf;
945
946//IE HAS RENDERING BUG WITH BOTTOM NAVBAR
947function RemoveBottomNavBarForIE(){
948        if (C.ie){
949                if (document.getElementById('BottomNavBar') != null){
950                        document.getElementById('TheBody').removeChild(document.getElementById('BottomNavBar'));
951                }
952        }
953}
954
955
956
957
958//HOTPOTNET-RELATED CODE
959
960var HPNStartTime = (new Date()).getTime();
961var SubmissionTimeout = 30000;
962var Detail = ''; //Global that is used to submit tracking data
963
964function Finish(){
965//If there's a form, fill it out and submit it
966        if (document.store != null){
967                Frm = document.store;
968                Frm.starttime.value = HPNStartTime;
969                Frm.endtime.value = (new Date()).getTime();
970                Frm.mark.value = Score;
971                Frm.detail.value = Detail;
972                Frm.submit();
973        }
974}
975
976
977
978//JCLOZE CORE JAVASCRIPT CODE
979
980function ItemState(){
981        this.ClueGiven = false;
982        this.HintsAndChecks = 0;
983        this.MatchedAnswerLength = 0;
984        this.ItemScore = 0;
985        this.AnsweredCorrectly = false;
986        this.Guesses = new Array();
987        return this;
988}
989
990var Feedback = '';
991var Correct = 'Correcto';
992var Incorrect = 'Algunas de sus respuestas no son correctas. Las respuestas incorrectas se han dejado en su sitio para que las corrija.';
993var GiveHint = 'La siguiente letra correcta ha sido a&#x00F1;adida a la respuesta.';
994var CaseSensitive = false;
995var YourScoreIs = 'Su puntuaci&#x00F3;n es';
996var Finished = false;
997var Locked = false;
998var Score = 0;
999var CurrentWord = 0;
1000var Guesses = '';
1001
1002I = new Array();
1003
1004I[0] = new Array();
1005I[0][1] = new Array();
1006I[0][1][0] = new Array();
1007I[0][1][0][0] = '\u004A\u0043\u006C\u006F\u007A\u0065';
1008I[0][2]='\u0045\u006C\u0020\u006E\u006F\u006D\u0062\u0072\u0065\u0020\u0064\u0065\u006C\u0020\u0070\u0072\u006F\u0067\u0072\u0061\u006D\u0061\u0020\u0075\u0074\u0069\u006C\u0069\u007A\u0061\u0064\u006F\u0020\u0070\u0061\u0072\u0061\u0020\u0068\u0061\u0063\u0065\u0072\u0020\u0065\u0073\u0074\u0065\u0020\u0065\u006A\u0065\u0072\u0063\u0069\u0063\u0069\u006F';
1009
1010I[1] = new Array();
1011I[1][1] = new Array();
1012I[1][1][0] = new Array();
1013I[1][1][0][0] = '\u0062\u006F\u0074\u00F3\u006E';
1014I[1][2]='\u0041\u006C\u0067\u006F\u0020\u0073\u006F\u0062\u0072\u0065\u0020\u006C\u006F\u0020\u0071\u0075\u0065\u0020\u0073\u0065\u0020\u0070\u0075\u006C\u0073\u0061\u0020\u0070\u0061\u0072\u0061\u0020\u0071\u0075\u0065\u0020\u006F\u0063\u0075\u0072\u0072\u0061\u0020\u0061\u006C\u0067\u006F\u0020\u0065\u006E\u0020\u0075\u006E\u0020\u0070\u0072\u006F\u0067\u0072\u0061\u006D\u0061\u0020\u0064\u0065\u0020\u006F\u0072\u0064\u0065\u006E\u0061\u0064\u006F\u0072';
1015
1016I[2] = new Array();
1017I[2][1] = new Array();
1018I[2][1][0] = new Array();
1019I[2][1][0][0] = '\u0063\u006F\u0072\u0072\u0065\u0063\u0074\u0061\u0073';
1020I[2][2]='';
1021
1022I[3] = new Array();
1023I[3][1] = new Array();
1024I[3][1][0] = new Array();
1025I[3][1][0][0] = '\u0068\u0075\u0065\u0063\u006F';
1026I[3][2]='';
1027
1028I[4] = new Array();
1029I[4][1] = new Array();
1030I[4][1][0] = new Array();
1031I[4][1][0][0] = '\u0076\u0065\u0072\u00E1';
1032I[4][2]='';
1033
1034I[5] = new Array();
1035I[5][1] = new Array();
1036I[5][1][0] = new Array();
1037I[5][1][0][0] = '\u0070\u0075\u006C\u0073\u0061\u0072';
1038I[5][2]='';
1039
1040I[6] = new Array();
1041I[6][1] = new Array();
1042I[6][1][0] = new Array();
1043I[6][1][0][0] = '\u0061\u006C\u0075\u006D\u006E\u006F\u0073';
1044I[6][2]='\u004C\u0061\u0073\u0020\u0070\u0065\u0072\u0073\u006F\u006E\u0061\u0073\u0020\u0061\u0020\u006C\u0061\u0073\u0020\u0071\u0075\u0065\u0020\u0065\u006E\u0073\u0065\u00F1\u0061\u002E';
1045
1046I[7] = new Array();
1047I[7][1] = new Array();
1048I[7][1][0] = new Array();
1049I[7][1][0][0] = '\u0064\u0065\u0073\u0063\u0072\u0069\u0070\u0063\u0069\u006F\u006E\u0065\u0073';
1050I[7][2]='\u0049\u006E\u0066\u006F\u0072\u006D\u0061\u0063\u0069\u00F3\u006E\u0020\u0071\u0075\u0065\u0020\u006C\u0065\u0020\u0061\u0079\u0075\u0064\u0061\u0072\u00E1\u0020\u0061\u0020\u0064\u0065\u0073\u0063\u0075\u0062\u0072\u0069\u0072\u0020\u006C\u0061\u0020\u0070\u0061\u006C\u0061\u0062\u0072\u0061';
1051
1052I[8] = new Array();
1053I[8][1] = new Array();
1054I[8][1][0] = new Array();
1055I[8][1][0][0] = '\u006D\u0069\u006E\u00FA\u0073\u0063\u0075\u006C\u0061\u0073';
1056I[8][2]='';
1057
1058
1059State = new Array();
1060
1061function StartUp(){
1062        RemoveBottomNavBarForIE();
1063
1064
1065
1066
1067
1068        var i = 0;
1069
1070        State.length = 0;
1071        for (i=0; i<I.length; i++){
1072                State[i] = new ItemState();
1073        }
1074
1075
1076}
1077
1078function ShowClue(ItemNum){
1079        if (Locked == true){return;}
1080        State[ItemNum].ClueGiven = true;
1081        ShowMessage(I[ItemNum][2]);
1082}
1083
1084function SaveCurrentAnswers(){
1085        var Ans = ''
1086        for (var i=0; i<I.length; i++){
1087                Ans = GetGapValue(i);
1088                if ((Ans.length > 0)&&(Ans != State[i].Guesses[State[i].Guesses.length-1])){
1089                        State[i].Guesses[State[i].Guesses.length] = Ans;
1090                }
1091        }
1092}
1093
1094function CompileGuesses(){
1095        var F = document.getElementById('store');
1096        if (F != null){
1097                var Temp = '<?xml version="1.0"?><hpnetresult><fields>';
1098                var GapLabel = '';
1099                for (var i=0; i<State.length; i++){
1100                        GapLabel = 'Gap ' + (i+1).toString();
1101                        Temp += '<field><fieldname>' + GapLabel + '</fieldname>';
1102                        Temp += '<fieldtype>student-responses</fieldtype><fieldlabel>' + GapLabel + '</fieldlabel>';
1103                        Temp += '<fieldlabelid>JClozeStudentResponses</fieldlabelid><fielddata>';
1104                        for (var j=0; j<State[i].Guesses.length; j++){
1105                                if (j>0){Temp += '| ';}
1106                                Temp += State[i].Guesses[j] + ' ';     
1107                        }       
1108                Temp += '</fielddata></field>';
1109                }
1110                Temp += '</fields></hpnetresult>';
1111                F.detail.value = Temp;
1112        }
1113}
1114
1115function CheckAnswers(){
1116        if (Locked == true){return;}
1117        SaveCurrentAnswers();
1118        var AllCorrect = true;
1119
1120//Check each answer
1121        for (var i = 0; i<I.length; i++){
1122
1123                if (State[i].AnsweredCorrectly == false){
1124//If it's right, calculate its score
1125                        if (CheckAnswer(i, true) > -1){
1126                                var TotalChars = GetGapValue(i).length;
1127                                State[i].ItemScore = (TotalChars-State[i].HintsAndChecks)/TotalChars;
1128                                if (State[i].ClueGiven == true){State[i].ItemScore /= 2;}
1129                                if (State[i].ItemScore <0 ){State[i].ItemScore = 0;}
1130                                State[i].AnsweredCorrectly = true;
1131//Drop the correct answer into the page, replacing the text box
1132                                SetCorrectAnswer(i, GetGapValue(i));
1133                        }
1134                        else{
1135//Otherwise, increment the hints for this item, as a penalty
1136                                State[i].HintsAndChecks++;
1137
1138//then set the flag
1139                                AllCorrect = false;
1140                        }
1141                }
1142        }
1143
1144//Calculate the total score
1145        var TotalScore = 0;
1146        for (i=0; i<State.length; i++){
1147                TotalScore += State[i].ItemScore;
1148        }
1149        TotalScore = Math.floor((TotalScore * 100)/I.length);
1150
1151//Compile the output
1152        Output = '';
1153
1154        if (AllCorrect == true){
1155                Output = Correct + '<br />';
1156        }
1157
1158        Output += YourScoreIs + ' ' + TotalScore + '%.<br />';
1159        if (AllCorrect == false){
1160                Output += '<br />' + Incorrect;
1161        }
1162        ShowMessage(Output);
1163        setTimeout('WriteToInstructions(Output)', 50);
1164       
1165        Score = TotalScore;
1166        CompileGuesses();
1167       
1168        if (AllCorrect==true){
1169
1170
1171
1172                Finished = true;
1173                setTimeout('Finish()', SubmissionTimeout);
1174        }
1175}
1176
1177function TrackFocus(BoxNumber){
1178        CurrentWord = BoxNumber;
1179        InTextBox = true;
1180}
1181
1182function LeaveGap(){
1183        InTextBox = false;
1184}
1185
1186function CheckBeginning(Guess, Answer){
1187        var OutString = '';
1188        var i = 0;
1189        var UpperGuess = '';
1190        var UpperAnswer = '';
1191
1192        if (CaseSensitive == false) {
1193                UpperGuess = Guess.toUpperCase();
1194                UpperAnswer = Answer.toUpperCase();
1195        }
1196        else {
1197                UpperGuess = Guess;
1198                UpperAnswer = Answer;
1199        }
1200
1201        while (UpperGuess.charAt(i) == UpperAnswer.charAt(i)) {
1202                OutString += Guess.charAt(i);
1203                i++;
1204        }
1205        OutString += Answer.charAt(i);
1206        return OutString;
1207}
1208
1209function GetGapValue(GNum){
1210        var RetVal = '';
1211        if ((GNum<0)||(GNum>=I.length)){return RetVal;}
1212        if (document.getElementById('Gap' + GNum) != null){
1213                RetVal = document.getElementById('Gap' + GNum).value;
1214                RetVal = TrimString(RetVal);
1215        }
1216        else{
1217                RetVal = State[GNum].Guesses[State[GNum].Guesses.length-1];
1218        }
1219        return RetVal;
1220}
1221
1222function SetGapValue(GNum, Val){
1223        if ((GNum<0)||(GNum>=I.length)){return;}
1224        if (document.getElementById('Gap' + GNum) != null){
1225                document.getElementById('Gap' + GNum).value = Val;
1226                document.getElementById('Gap' + GNum).focus();
1227        }
1228}
1229
1230function SetCorrectAnswer(GNum, Val){
1231        if ((GNum<0)||(GNum>=I.length)){return;}
1232        if (document.getElementById('GapSpan' + GNum) != null){
1233                document.getElementById('GapSpan' + GNum).innerHTML = Val;
1234        }
1235}
1236
1237function FindCurrent() {
1238        var x = 0;
1239        FoundCurrent = -1;
1240
1241//Test the current word:
1242//If its state is not set to already correct, check the word.
1243        if (State[CurrentWord].AnsweredCorrectly == false){
1244                if (CheckAnswer(CurrentWord, false) < 0){
1245                        return CurrentWord;
1246                }
1247        }
1248       
1249        x=CurrentWord + 1;
1250        while (x<I.length){
1251                if (State[x].AnsweredCorrectly == false){
1252                        if (CheckAnswer(x, false) < 0){
1253                                return x;
1254                        }
1255                }
1256        x++;   
1257        }
1258
1259        x = 0;
1260        while (x<CurrentWord){
1261                if (State[x].AnsweredCorrectly == false){
1262                        if (CheckAnswer(x, false) < 0){
1263                                return x;
1264                        }
1265                }
1266        x++;   
1267        }
1268        return FoundCurrent;
1269}
1270
1271function CheckAnswer(GapNum, MarkAnswer){
1272        var Guess = GetGapValue(GapNum);
1273        var UpperGuess = '';
1274        var UpperAnswer = '';
1275        if (CaseSensitive == false){
1276                UpperGuess = Guess.toUpperCase();
1277        }
1278        else{
1279                UpperGuess = Guess;
1280        }
1281        var Match = -1;
1282        for (var i = 0; i<I[GapNum][1].length; i++){
1283                if (CaseSensitive == false){
1284                        UpperAnswer = I[GapNum][1][i][0].toUpperCase();
1285                }
1286                else{
1287                        UpperAnswer = I[GapNum][1][i][0];
1288                }
1289                if (TrimString(UpperGuess) == UpperAnswer){
1290                        Match = i;
1291                        if (MarkAnswer == true){
1292                                State[GapNum].AnsweredCorrectly = true;
1293                        }
1294                }
1295        }
1296        return Match;
1297}
1298
1299function GetHint(GapNum){
1300        Guess = GetGapValue(GapNum);
1301
1302        if (CheckAnswer(GapNum, false) > -1){return ''}
1303        RightBits = new Array();
1304        for (var i=0; i<I[GapNum][1].length; i++){
1305                RightBits[i] = CheckBeginning(Guess, I[GapNum][1][i][0]);
1306        }
1307        var RightOne = FindLongest(RightBits);
1308        var Result = I[GapNum][1][RightOne][0].substring(0,RightBits[RightOne].length);
1309//Add another char if the last one is a space
1310        if (Result.charAt(Result.length-1) == ' '){
1311                Result = I[GapNum][1][RightOne][0].substring(0,RightBits[RightOne].length+1);
1312        }
1313        return Result;
1314}
1315
1316function ShowHint(){
1317        if (Locked == true){return;}
1318        var CurrGap = FindCurrent();
1319        if (CurrGap < 0){return;}
1320
1321        var HintString = GetHint(CurrGap);
1322
1323        if (HintString.length > 0){
1324                SetGapValue(CurrGap, HintString);
1325                State[CurrGap][1] = State[CurrGap][1] + 1;
1326        }
1327        ShowMessage(GiveHint);
1328}
1329
1330function TypeChars(Chars){
1331        var CurrGap = FindCurrent();
1332        if (CurrGap < 0){return;}
1333        SetGapValue(CurrGap, GetGapValue(CurrGap) + Chars);
1334}
1335
1336
1337
1338
1339
1340
1341
1342
1343//-->
1344
1345//]]>
1346
1347       </script>
1348
1349
1350</head>
1351
1352<body onload="StartUp()" id="TheBody">
1353
1354<!-- BeginTopNavButtons -->
1355
1356
1357<div class="NavButtonBar" id="TopNavBar">
1358
1359
1360
1361
1362
1363
1364<button class="NavButton" onfocus="NavBtnOver(this)" onblur="NavBtnOut(this)" onmouseover="NavBtnOver(this)" onmouseout="NavBtnOut(this)" onmousedown="NavBtnDown(this)" onmouseup="NavBtnOut(this)" onclick="location='jcloze2.htm'; return false;">Siguiente ejemplo</button>
1365
1366
1367</div>
1368
1369
1370
1371<!-- EndTopNavButtons -->
1372
1373<div class="Titles">
1374        <h2 class="ExerciseTitle">Ejercicio de completar huecos realizado con JCloze</h2>
1375        <h3 class="ExerciseSubtitle">Ejercicios de completar huecos</h3>
1376
1377
1378</div>
1379
1380<div id="InstructionsDiv" class="StdDiv">
1381        <p id="Instructions">Complete los huecos, despu&#x00E9;s pulse "Comprobar" para revisar sus respuestas. Utilice el bot&#x00F3;n "Pista" para averiguar una letra de la palabra si es que la palabra le resulta complicada. Tambi&#x00E9;n puede pulsar en el bot&#x00F3;n "[?]" para ver una descripci&#x00F3;n de la palabra. &#x00A1;Tenga en cuenta que perder&#x00E1; puntos si solicita pistas o descripciones!</p>
1382</div>
1383
1384
1385
1386
1387
1388<div id="MainDiv" class="StdDiv">
1389
1390<!-- These top buttons hidden; reveal if required -->
1391<!--
1392<button id="CheckButton1" class="FuncButton" onmouseover="FuncBtnOver(this)" onfocus="FuncBtnOver(this)" onmouseout="FuncBtnOut(this)" onblur="FuncBtnOut(this)" onmousedown="FuncBtnDown(this)" onmouseup="FuncBtnOut(this)" onclick="CheckAnswers()">&nbsp;Comprobar&nbsp;</button>
1393
1394
1395<button class="FuncButton" onmouseover="FuncBtnOver(this)" onfocus="FuncBtnOver(this)" onmouseout="FuncBtnOut(this)" onblur="FuncBtnOut(this)" onmousedown="FuncBtnDown(this)" onmouseup="FuncBtnOut(this)" onclick="ShowHint()">&nbsp;Pista&nbsp;</button>
1396
1397
1398 -->
1399 
1400<div id="ClozeDiv">
1401<form id="Cloze" method="post" action="" onsubmit="return false;">
1402<div class="ClozeBody">
1403Este es un ejercicio sencillo para completar huecos realizado con el programa <span class="GapSpan" id="GapSpan0"><input type="text" id="Gap0" onfocus="TrackFocus(0)" onblur="LeaveGap()" class="GapBox" size="6"></input><button style="line-height: 1.0" class="FuncButton"onfocus="FuncBtnOver(this)" onmouseover="FuncBtnOver(this)"onblur="FuncBtnOut(this)" onmouseout="FuncBtnOut(this)"onmousedown="FuncBtnDown(this)" onmouseup="FuncBtnOut(this)"onclick="ShowClue(0)">[?]</button></span>. El usuario introduce sus respuestas en los huecos, despu&#x00E9;s pulsa el <span class="GapSpan" id="GapSpan1"><input type="text" id="Gap1" onfocus="TrackFocus(1)" onblur="LeaveGap()" class="GapBox" size="6"></input><button style="line-height: 1.0" class="FuncButton"onfocus="FuncBtnOver(this)" onmouseover="FuncBtnOver(this)"onblur="FuncBtnOut(this)" onmouseout="FuncBtnOut(this)"onmousedown="FuncBtnDown(this)" onmouseup="FuncBtnOut(this)"onclick="ShowClue(1)">[?]</button></span> "Comprobar" para observar las respuestas correctas, y para obtener la puntuaci&#x00F3;n. Para cada hueco, se puede establecer cualquier n&#x00FA;mero de respuestas <span class="GapSpan" id="GapSpan2"><input type="text" id="Gap2" onfocus="TrackFocus(2)" onblur="LeaveGap()" class="GapBox" size="9"></input></span>. Por ejemplo, este <span class="GapSpan" id="GapSpan3"><input type="text" id="Gap3" onfocus="TrackFocus(3)" onblur="LeaveGap()" class="GapBox" size="6"></input></span> permite las respuestas "hueco", "espacio", "blanco" y "ranura". Pruebe con alguna de ellas y <span class="GapSpan" id="GapSpan4"><input type="text" id="Gap4" onfocus="TrackFocus(4)" onblur="LeaveGap()" class="GapBox" size="6"></input></span>. Si el usuario necesita ayuda, podr&#x00E1; <span class="GapSpan" id="GapSpan5"><input type="text" id="Gap5" onfocus="TrackFocus(5)" onblur="LeaveGap()" class="GapBox" size="6"></input></span> en el bot&#x00F3;n "Pista" para obtener una letra de la palabra. Para ver una de las letras de la palabra en alguno de los huecos, sit&#x00FA;e el cursor en el hueco deseado antes de presionar en el bot&#x00F3;n "Pista". El bot&#x00F3;n "Pista" es opcional -- si desea que los ejercicios resulten m&#x00E1;s dif&#x00ED;ciles para sus <span class="GapSpan" id="GapSpan6"><input type="text" id="Gap6" onfocus="TrackFocus(6)" onblur="LeaveGap()" class="GapBox" size="7"></input><button style="line-height: 1.0" class="FuncButton"onfocus="FuncBtnOver(this)" onmouseover="FuncBtnOver(this)"onblur="FuncBtnOut(this)" onmouseout="FuncBtnOut(this)"onmousedown="FuncBtnDown(this)" onmouseup="FuncBtnOut(this)"onclick="ShowClue(6)">[?]</button></span>, no incluya este bot&#x00F3;n. Tambi&#x00E9;n puede incluir, si lo desea <span class="GapSpan" id="GapSpan7"><input type="text" id="Gap7" onfocus="TrackFocus(7)" onblur="LeaveGap()" class="GapBox" size="13"></input><button style="line-height: 1.0" class="FuncButton"onfocus="FuncBtnOver(this)" onmouseover="FuncBtnOver(this)"onblur="FuncBtnOut(this)" onmouseout="FuncBtnOut(this)"onmousedown="FuncBtnDown(this)" onmouseup="FuncBtnOut(this)"onclick="ShowClue(7)">[?]</button></span> concretas para cada hueco. Por &#x00FA;ltimo, puede hacer que la respuesta se de como correcta o err&#x00F3;nea dependiendo de que se escriba en may&#x00FA;sculas o en min&#x00FA;sculas. En este ejercicio da lo mismo que se escriban las respuestas en may&#x00FA;sculas o en <span class="GapSpan" id="GapSpan8"><input type="text" id="Gap8" onfocus="TrackFocus(8)" onblur="LeaveGap()" class="GapBox" size="10"></input></span>.
1404</div>
1405</form>
1406</div>
1407
1408
1409<div class="Keypad">
1410&nbsp;</div>
1411
1412
1413<button id="CheckButton2" class="FuncButton" onmouseover="FuncBtnOver(this)" onfocus="FuncBtnOver(this)" onmouseout="FuncBtnOut(this)" onblur="FuncBtnOut(this)" onmousedown="FuncBtnDown(this)" onmouseup="FuncBtnOut(this)" onclick="CheckAnswers()">&nbsp;Comprobar&nbsp;</button>
1414
1415
1416<button class="FuncButton" onmouseover="FuncBtnOver(this)" onfocus="FuncBtnOver(this)" onmouseout="FuncBtnOut(this)" onblur="FuncBtnOut(this)" onmousedown="FuncBtnDown(this)" onmouseup="FuncBtnOut(this)" onclick="ShowHint()">&nbsp;Pista&nbsp;</button>
1417
1418
1419</div>
1420
1421
1422
1423<div class="Feedback" id="FeedbackDiv">
1424<div class="FeedbackText" id="FeedbackContent"></div>
1425<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>
1426</div>
1427
1428<!-- BeginBottomNavButtons -->
1429
1430
1431<div class="NavButtonBar" id="BottomNavBar">
1432
1433
1434
1435
1436
1437
1438<button class="NavButton" onfocus="NavBtnOver(this)" onblur="NavBtnOut(this)" onmouseover="NavBtnOver(this)" onmouseout="NavBtnOut(this)" onmousedown="NavBtnDown(this)" onmouseup="NavBtnOut(this)" onclick="location='jcloze2.htm'; return false;">Siguiente ejemplo</button>
1439
1440
1441</div>
1442
1443
1444
1445<!-- EndBottomNavButtons -->
1446
1447<!-- BeginSubmissionForm -->
1448
1449<!-- EndSubmissionForm -->
1450
1451</body>
1452
1453</html>
Note: See TracBrowser for help on using the browser.