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