Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

the v6 folder has been moved into the "templates" folder for HotPot v2.1

  • Loading branch information...
commit ab45e35e906a6196422184e99730b6ddd2ac5775 1 parent 57f35d2
gbateson authored
Showing with 0 additions and 6,036 deletions.
  1. +0 −124 mod/hotpot/v6/source/djmatch6.ht_
  2. +0 −323 mod/hotpot/v6/source/djmatch6.js_
  3. +0 −132 mod/hotpot/v6/source/djmix6.ht_
  4. +0 −521 mod/hotpot/v6/source/djmix6.js_
  5. +0 −102 mod/hotpot/v6/source/fjmatch6.ht_
  6. +0 −107 mod/hotpot/v6/source/fjmatch6.js_
  7. +0 −8 mod/hotpot/v6/source/hotpot6r.ht_
  8. +0 −596 mod/hotpot/v6/source/hp6.cs_
  9. +0 −55 mod/hotpot/v6/source/hp6browsercheck.js_
  10. +0 −42 mod/hotpot/v6/source/hp6buttons.js_
  11. +0 −152 mod/hotpot/v6/source/hp6card.js_
  12. +0 −400 mod/hotpot/v6/source/hp6checkshortanswer.js_
  13. +0 −18 mod/hotpot/v6/source/hp6hotpotnet.js_
  14. +0 −15 mod/hotpot/v6/source/hp6navbar.ht_
  15. +0 −35 mod/hotpot/v6/source/hp6objecttags.ht_
  16. +0 −42 mod/hotpot/v6/source/hp6plainpage.ht_
  17. +0 −53 mod/hotpot/v6/source/hp6sendresults.js_
  18. +0 −52 mod/hotpot/v6/source/hp6showmessage.js_
  19. +0 −33 mod/hotpot/v6/source/hp6timer.js_
  20. +0 −237 mod/hotpot/v6/source/hp6utilities.js_
  21. +0 −165 mod/hotpot/v6/source/jcloze6.ht_
  22. +0 −334 mod/hotpot/v6/source/jcloze6.js_
  23. +0 −187 mod/hotpot/v6/source/jcross6.ht_
  24. +0 −297 mod/hotpot/v6/source/jcross6.js_
  25. +0 −182 mod/hotpot/v6/source/jcross6print.ht_
  26. +0 −144 mod/hotpot/v6/source/jmatch6.ht_
  27. +0 −252 mod/hotpot/v6/source/jmatch6.js_
  28. +0 −151 mod/hotpot/v6/source/jmix6.ht_
  29. +0 −357 mod/hotpot/v6/source/jmix6.js_
  30. +0 −159 mod/hotpot/v6/source/jquiz6.ht_
  31. +0 −607 mod/hotpot/v6/source/jquiz6.js_
  32. +0 −90 mod/hotpot/v6/source/masher.ht_
  33. +0 −29 mod/hotpot/v6/source/mashernav.ht_
  34. +0 −35 mod/hotpot/v6/source/testbrowsercheck.htm
View
124 mod/hotpot/v6/source/djmatch6.ht_
@@ -1,124 +0,0 @@
-<?xml version="1.0"?>
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "xhtml11.dtd">
- <html xmlns="http://www.w3.org/1999/xhtml"
- xml:lang="en"><head>
-
-[strDublinCoreMetadata]
-
-<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
-
-<title>
-[strPlainTitle]
-</title>
-
-<!-- Made with executable version [strFullVersionInfo] -->
-
-<!-- The following insertion allows you to add your own code directly to this head tag from the configuration screen -->
-
-[strHeaderCode]
-
-<style type="text/css">
-
-[strStyleSheet]
-
-</style>
-
-<script type="text/javascript">
-
-//<![CDATA[
-
-<!--
-
-[strJSBrowserCheck]
-
-[strJSButtons]
-
-[strJSShowMessage]
-
-[strJSUtilities]
-
-[strJSHotPotNet]
-
-[strJSCard]
-
-[strJSDJMatch6]
-
-[inclTimer]
-[strJSTimer]
-[/inclTimer]
-
-[inclSendResults]
-[strJSSendResults]
-[/inclSendResults]
-
-//-->
-
-//]]>
-
-</script>
-
-</head>
-
-<body onload="TimerStartUp()" id="TheBody">
-<!-- BeginTopNavButtons -->
-
-[inclNavButtons]
-[strTopNavBar]
-[/inclNavButtons]
-
-<!-- EndTopNavButtons -->
-
-<div class="Titles">
- <h2 class="ExerciseTitle">[strExerciseTitle]</h2>
-[inclExerciseSubtitle]
- <h3 class="ExerciseSubtitle">[strExerciseSubtitle]</h3>
-[/inclExerciseSubtitle]
-[inclTimer]
-<div id="Timer">&nbsp;<span id="TimerText">&nbsp;&nbsp;</span>&nbsp;</div>
-[/inclTimer]
-
-</div>
-
-<div id="InstructionsDiv" class="StdDiv">
- <p id="Instructions">[strInstructions]</p>
-</div>
-
-<div class="StdDiv" id="CheckButtonDiv">
-<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;[strCheckCaption]&nbsp;</button>
-</div>
-
-<script type="text/javascript">
-
-//<![CDATA[
-
-<!--
-
-
-for (var i=0; i<F.length; i++){
- document.write('<div id="F' + i + '" class="CardStyle"></div>');
-}
-
-for (var i=0; i<D.length; i++){
- document.write('<div id="D' + i + '" class="CardStyle" onmousedown="beginDrag(event, ' + i + ')"></div>');
-}
-
-//-->
-
-//]]>
-</script>
-
-<div class="Feedback" id="FeedbackDiv">
-<div class="FeedbackText" id="FeedbackContent"></div>
-<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;[strOKCaption]&nbsp;</button>
-</div>
-
-<!-- BeginBottomNavButtons -->
-
-<!-- EndBottomNavButtons -->
-
-<!-- BeginSubmissionForm -->
-
-<!-- EndSubmissionForm -->
-
-</body>
-</html>
View
323 mod/hotpot/v6/source/djmatch6.js_
@@ -1,323 +0,0 @@
-
-var CorrectResponse = '[strGuessCorrect]';
-var IncorrectResponse = '[strGuessIncorrect]';
-var YourScoreIs = '[strYourScoreIs]';
-var DivWidth = 600; //default value
-var FeedbackWidth = 200; //default
-var ExBGColor = '[strExBGColor]';
-var PageBGColor = '[strPageBGColor]';
-var TextColor = '[strTextColor]';
-var TitleColor = '[strTitleColor]';
-var Penalties = 0;
-var Score = 0;
-var TimeOver = false;
-var Locked = false;
-var ShuffleQs = [boolShuffleQs];
-var QsToShow = [QsToShow];
-
-var DragWidth = 200;
-var LeftColPos = 100;
-var RightColPos = 500;
-var DragTop = 120;
-var Finished = false;
-
-//Fixed and draggable card arrays
-FC = new Array();
-DC = new Array();
-
-function onEndDrag(){
-//Is it dropped on any of the fixed cards?
- var Docked = false;
- var DropTarget = DroppedOnFixed(CurrDrag);
- if (DropTarget > -1){
-//If so, send home any card that is currently docked there
- for (var i=0; i<DC.length; i++){
- if (DC[i].tag == DropTarget+1){
- DC[i].GoHome();
- DC[i].tag = 0;
- D[i][2] = 0;
- }
- }
-//Dock the dropped card
- DC[CurrDrag].DockToR(FC[DropTarget]);
- D[CurrDrag][2] = F[DropTarget][1];
- DC[CurrDrag].tag = DropTarget+1;
- Docked = true;
- }
-
- if (Docked == false){
- DC[CurrDrag].GoHome();
- DC[CurrDrag].tag = 0;
- D[CurrDrag][2] = 0;
- }
-}
-
-function DroppedOnFixed(DNum){
- var Result = -1;
- var OverlapArea = 0;
- var Temp = 0;
- for (var i=0; i<FC.length; i++){
- Temp = DC[DNum].Overlap(FC[i]);
- if (Temp > OverlapArea){
- OverlapArea = Temp;
- Result = i;
- }
- }
- return Result;
-}
-
-
-function StartUp(){
-
-[inclSendResults]
- GetUserName();
-[/inclSendResults]
-
-[inclPreloadImages]
- PreloadImages([PreloadImageList]);
-[/inclPreloadImages]
-
-//Calculate page dimensions and positions
- pg = new PageDim();
- DivWidth = Math.floor((pg.W*4)/5);
- DragWidth = Math.floor((DivWidth*3)/10);
- LeftColPos = Math.floor(pg.W/15);
- RightColPos = pg.W - (DragWidth + LeftColPos);
- DragTop = parseInt(document.getElementById('CheckButtonDiv').offsetHeight) + parseInt(document.getElementById('CheckButtonDiv').offsetTop) + 10;
-
- if (C.ie){
- DragTop += 15;
- }
-
-//Reduce array if required
- if (QsToShow < F.length){
- ReduceItems2();
- }
-
-//Shuffle the left items if required
- if (ShuffleQs == true){
- F = Shuffle(F);
- }
-
-//Shuffle the items on the right
- D = Shuffle(D);
-
- var CurrTop = DragTop;
- var TempInt = 0;
- var DropHome = 0;
- var Widest = 0;
- var CardContent = '';
- for (var i=0; i<F.length; i++){
- CardContent = F[i][0];
- FC[i] = new Card('F' + i, 10);
- FC[i].elm.innerHTML = CardContent;
- if (FC[i].GetW() > Widest){
- Widest = FC[i].GetW();
- }
- }
-
- if (Widest > DragWidth){Widest = DragWidth;}
-
- CurrTop = DragTop;
-
- DragWidth = Math.floor((DivWidth-Widest)/2) - 24;
- RightColPos = DivWidth + LeftColPos - (DragWidth + 14);
- var Highest = 0;
- var WidestRight = 0;
-
- for (i=0; i<D.length; i++){
- DC[i] = new Card('D' + i, 10);
- CardContent = D[i][0];
-// if (CardContent.indexOf('<img ') > -1){CardContent += '<br clear="all" />';} //used to be required for Navigator rendering bug with images
- DC[i].elm.innerHTML = CardContent;
- if (DC[i].GetW() > DragWidth){DC[i].SetW(DragWidth);}
- DC[i].css.cursor = 'move';
- DC[i].css.backgroundColor = '[strExBGColor]';
- DC[i].css.color = '[strTextColor]';
- TempInt = DC[i].GetH();
- if (TempInt > Highest){Highest = TempInt;}
- TempInt = DC[i].GetW();
- if (TempInt > WidestRight){WidestRight = TempInt;}
- }
-
- var HeightToSet = Highest;
- if (C.gecko||C.ie5mac){HeightToSet -= 12;}
- var WidthToSet = WidestRight;
- if (C.gecko||C.ie5mac){WidthToSet -= 12;}
-
- for (i=0; i<D.length; i++){
- DC[i].SetT(CurrTop);
- DC[i].SetL(RightColPos);
- if (DC[i].GetH() < Highest){
- DC[i].SetH(HeightToSet);
- }
- if (DC[i].GetW() < WidestRight){
- DC[i].SetW(WidthToSet);
- }
- DC[i].SetHome();
- DC[i].tag = -1;
- CurrTop = CurrTop + DC[i].GetH() + 5;
- }
-
- CurrTop = DragTop;
-
- for (var i=0; i<F.length; i++){
- FC[i].SetW(Widest);
- if (FC[i].GetH() < Highest){
- FC[i].SetH(HeightToSet);
- }
- FC[i].SetT(CurrTop);
- FC[i].SetL(LeftColPos);
- FC[i].SetHome();
- TempInt = FC[i].GetH();
- CurrTop = CurrTop + TempInt + 5;
- }
-
-[inclSlide]
-//Slide any elements that should be in position over
- for (i=0; i<D.length; i++){
- if (D[i][2] > 0){
- DC[i].tag = D[i][1];
- D[i][2] = D[i][1];
- var TopChange = 0;
-//Find the right target element
- var TargItem = -1;
- for (var j=0; j<F.length; j++){
- if (F[j][1] == D[i][1]){
- TargItem = j;
- }
- }
- var TargetLeft = FC[TargItem].GetR() + 5;
- var TargetTop = FC[TargItem].GetT();
-
- if (TargetTop < DC[i].GetT()){
- TopChange = -1;
- }
- else {
- if (TargetTop > DC[i].GetT()){
- TopChange = 1;
- }
- }
- Slide(i, TargetLeft, TargetTop, TopChange);
- D[i][2] = F[TargItem][1];
- DC[i].tag = TargItem+1;
- }
- }
-[/inclSlide]
-[inclTimer]
- StartTimer();
-[/inclTimer]
-}
-
-[inclSlide]
-function Slide(MoverNum, TargL, TargT, TopChange){
- var TempInt = DC[MoverNum].GetL();
- if (TempInt > TargL){
- DC[MoverNum].SetL(TempInt - 5);
- }
- TempInt = DC[MoverNum].GetT();
- if (TempInt != TargT){
- DC[MoverNum].SetT(TempInt + TopChange);
- }
- if ((DC[MoverNum].GetL() > TargL)||(DC[MoverNum].GetT() != TargT)){
- setTimeout('Slide('+MoverNum+','+TargL+','+TargT+','+TopChange+')', 1);
- }
- else{
- DC[MoverNum].SetL(TargL);
- }
-}
-[/inclSlide]
-
-F = new Array();
-[FixedArray]
-
-D = new Array();
-[DragArray]
-
-function ReduceItems2(){
- var ItemToDump=0;
- var j=0;
- while (F.length > QsToShow){
- ItemToDump = Math.floor(F.length*Math.random());
- for (j=ItemToDump; j<(F.length-1); j++){
- F[j] = F[j+1];
- }
- for (j=ItemToDump; j<(D.length-1); j++){
- D[j] = D[j+1];
- }
- F.length = F.length-1;
- D.length = D.length-1;
- }
-}
-
-function TimerStartUp(){
- setTimeout('StartUp()', 300);
-}
-
-function CheckAnswers(){
- if (Locked == true){return;}
-//Set the default score and response
- var TotalCorrect = 0;
- Score = 0;
- var Feedback = '';
-
-//for each fixed, check to see if the tag value for the draggable is the same as the fixed
- var i, j;
- for (i=0; i<D.length; i++){
- if ((D[i][2] == D[i][1])&&(D[i][2] > 0)){
- TotalCorrect++;
- }
- else{
-//Change made for version 6.0.3.41: don't send wrong items home,
-//show them in a more conspicuous way.
-// DC[i].GoHome();
- DC[i].SetL(DC[i].GetL() + 10);
- DC[i].Highlight();
- }
- }
-
- Score = Math.floor((100*(TotalCorrect-Penalties))/F.length);
-
- var AllDone = false;
-
- if (TotalCorrect == F.length) {
- AllDone = true;
- }
-
- if (AllDone == true){
- Feedback = YourScoreIs + ' ' + Score + '%.';
- ShowMessage(Feedback + '<br />' + CorrectResponse);
- }
- else {
- Feedback = IncorrectResponse + '<br />' + YourScoreIs + ' ' + Score + '%.';
- ShowMessage(Feedback);
- Penalties++; // Penalty for inaccurate check
- }
-//If the exercise is over, deal with that
- if ((AllDone == true)||(TimeOver == true)){
-[inclSendResults]
- setTimeout('SendResults(' + Score + ')', 50);
-[/inclSendResults]
-[inclTimer]
- window.clearInterval(Interval);
-[/inclTimer]
- TimeOver = true;
- Locked = true;
- Finished = true;
- setTimeout('Finish()', SubmissionTimeout);
- WriteToInstructions(Feedback);
- }
-}
-
-[inclTimer]
-function TimesUp() {
- document.getElementById('Timer').innerHTML = '[strTimesUp]';
-[inclPreloadImages]
- RefreshImages();
-[/inclPreloadImages]
- TimeOver = true;
- CheckAnswers();
- Locked = true;
-}
-[/inclTimer]
-
View
132 mod/hotpot/v6/source/djmix6.ht_
@@ -1,132 +0,0 @@
-<?xml version="1.0"?>
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "xhtml11.dtd">
- <html xmlns="http://www.w3.org/1999/xhtml"
- xml:lang="en"><head>
-
-[strDublinCoreMetadata]
-
-<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
-
-<title>
-[strPlainTitle]
-</title>
-
-<!-- Made with executable version [strFullVersionInfo] -->
-
-<!-- The following insertion allows you to add your own code directly to this head tag from the configuration screen -->
-
-[strHeaderCode]
-
-<style type="text/css">
-
-[strStyleSheet]
-
-</style>
-
-<script type="text/javascript">
-
-//<![CDATA[
-
-<!--
-
-[strJSBrowserCheck]
-
-[strJSButtons]
-
-[strJSShowMessage]
-
-[strJSUtilities]
-
-[strJSHotPotNet]
-
-[strJSCard]
-
-[strJSDJMix6]
-
-[inclTimer]
-[strJSTimer]
-[/inclTimer]
-
-[inclSendResults]
-[strJSSendResults]
-[/inclSendResults]
-
-//-->
-
-//]]>
-
-</script>
-
-</head>
-
-<body onload="TimerStartUp()" id="TheBody">
-<!-- BeginTopNavButtons -->
-
-[inclNavButtons]
-[strTopNavBar]
-[/inclNavButtons]
-
-<!-- EndTopNavButtons -->
-
-<div class="Titles">
- <h2 class="ExerciseTitle">[strExerciseTitle]</h2>
-[inclExerciseSubtitle]
- <h3 class="ExerciseSubtitle">[strExerciseSubtitle]</h3>
-[/inclExerciseSubtitle]
-[inclTimer]
-<div id="Timer">&nbsp;<span id="TimerText">&nbsp;&nbsp;</span>&nbsp;</div>
-[/inclTimer]
-
-</div>
-
-<div id="InstructionsDiv" class="StdDiv">
- <p id="Instructions">[strInstructions]</p>
-</div>
-
-<div class="StdDiv" id="CheckButtonDiv">
-<button id="CheckButton1" class="FuncButton" onmouseover="FuncBtnOver(this)" onfocus="FuncBtnOver(this)" onmouseout="FuncBtnOut(this)" onblur="FuncBtnOut(this)" onmousedown="FuncBtnDown(this)" onmouseup="FuncBtnOut(this)" onclick="CheckResults(0)">&nbsp;[strCheckCaption]&nbsp;</button>
-
-[inclRestart]
-<button class="FuncButton" onmouseover="FuncBtnOver(this)" onfocus="FuncBtnOver(this)" onmouseout="FuncBtnOut(this)" onblur="FuncBtnOut(this)" onmousedown="FuncBtnDown(this)" onmouseup="FuncBtnOut(this)" onclick="location.reload()">&nbsp;[strRestartCaption]&nbsp;</button>
-[/inclRestart]
-
-[inclHint]
-<button class="FuncButton" onmouseover="FuncBtnOver(this)" onfocus="FuncBtnOver(this)" onmouseout="FuncBtnOut(this)" onblur="FuncBtnOut(this)" onmousedown="FuncBtnDown(this)" onmouseup="FuncBtnOut(this)" onclick="CheckResults(1)">&nbsp;[strHintCaption]&nbsp;</button>
-[/inclHint]
-</div>
-
-<script type="text/javascript">
-
-//<![CDATA[
-
-<!--
-
-
-for (var i=0; i<DropTotal; i++){
- document.write('<div id="Drop' + i + '" class="DropLine" align="center">&nbsp;<br />&nbsp;</div>');
-}
-
-for (var i=0; i<Segments.length; i++){
- document.write('<div id="D' + i + '" class="CardStyle" onmousedown="beginDrag(event, ' + i + ')"></div>');
-}
-
-//-->
-
-//]]>
-</script>
-
-<div class="Feedback" id="FeedbackDiv">
-<div class="FeedbackText" id="FeedbackContent"></div>
-<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;[strOKCaption]&nbsp;</button>
-</div>
-
-<!-- BeginBottomNavButtons -->
-
-<!-- EndBottomNavButtons -->
-
-<!-- BeginSubmissionForm -->
-
-<!-- EndSubmissionForm -->
-
-</body>
-</html>
View
521 mod/hotpot/v6/source/djmix6.js_
@@ -1,521 +0,0 @@
-//JMIX DRAG-DROP OUTPUT FORMAT CODE
-
-var Punctuation = '[strPunctuation]';
-
-var Openers = '[strOpenPunctuation]';
-var CorrectResponse = '[strGuessCorrect]';
-var IncorrectResponse = '[strGuessIncorrect]';
-var ThisMuchCorrect = '[strThisMuch]';
-var TheseAnswersToo = '[strTheseAnswersToo]';
-var YourScoreIs = '[strYourScoreIs]';
-var NextCorrect = '[strNextCorrect]';
-var FeedbackWidth = 200; //default
-var ExBGColor = '[strExBGColor]';
-var PageBGColor = '[strPageBGColor]';
-var TextColor = '[strTextColor]';
-var TitleColor = '[strTitleColor]';
-var DropTotal = 3; // number of lines that will be available for dropping on
-var Gap = 4; //Gap between two segments when they're next to each other on a line
-var DropHeight = 30;
-var CapitalizeFirst = [boolCapitalizeFirst];
-var CompiledOutput = '';
-var TempSegment = '';
-var FirstSegment = -1;
-var FirstDiv = -1;
-var Penalties = 0;
-var Score = 0;
-var TimeOver = false;
-
-var CurrDrag = -1;
-var topZ = 100;
-var Cds = new Array();
-var L = new Array();
-var Finished = false;
-
-var Locked = false;
-var DivWidth = 600;
-var LeftColPos = 100;
-var DragTop = 120;
-var DragNumber = -1;
-
-Lines = new Array();
-
-function CapFirst(InString){
- var i = 0;
- if ((Openers.indexOf(InString.charAt(i))>-1)||(InString.charAt(i) == ' ')){
- i++;
- }
- if ((Openers.indexOf(InString.charAt(i))>-1)||(InString.charAt(i) == ' ')){
- i++;
- }
- var Temp = InString.charAt(i);
- Temp = Temp.toUpperCase();
- InString = InString.substring(0, i) + Temp + InString.substring(i+1, InString.length);
- return InString;
-}
-
-function CheckResults(ChkType){
-//Get sequence student has chosen
- GetGuessSequence();
-
-//Compile the answer
- CompiledOutput = CompileString(GuessSequence);
-
-//Check the answer
- CheckAnswer(ChkType);
-}
-
-function GetGuessSequence(){
-//Put pointers to draggables in arrays based on the lines they're sitting on
- var Drops = new Array();
- for (var i=0; i<L.length; i++){
- Drops[i] = new Array();
- }
-
- var CardPos = 0;
-
- for (i=0; i<Cds.length; i++){
- for (var j=0; j<L.length; j++){
-//Slight modification for 6.0.4: allow some leeway for 1px inaccuracy in card placing by browser.
- CardPos = L[j].GetB() - (Cds[i].GetH()+2);
- if (((Cds[i].GetT() - CardPos) < 4)&&((Cds[i].GetT() - CardPos) > -4)){
- Drops[j][Drops[j].length] = Cds[i];
- }
- }
- }
-
-//Sort the drop arrays based on the Left of each div
- for (i=0; i<Drops.length; i++){
- Drops[i].sort(CompDrags);
- }
-
-//Put the tags into the GuessSequence array
- GuessSequence.length = 0;
- for (i=0; i<Drops.length; i++){
- for (j=0; j<Drops[i].length; j++){
- GuessSequence[GuessSequence.length] = Drops[i][j].tag;
- }
- }
-
-//Set the variable recording which div is first
- var NewFirstDiv = -1;
- for (i=0; i<Drops.length; i++){
- if (Drops[i].length > 0){
- NewFirstDiv = Drops[i][0].index;
- break;
- }
- }
- return NewFirstDiv;
-}
-
-function CompDrags(a,b){
- return a.GetL() - b.GetL();
-}
-
-function FindSegment(SegID){
- var Seg = '';
- for (var i=0; i<Segments.length; i++){
- if (Segments[i][1] == SegID){
- Seg = Segments[i][0];
- break;
- }
- }
- return Seg;
-}
-
-function CompileString(InArray){
- var OutString = '';
- var i = 0;
- OutArray = new Array();
-
- for (i=0; i<InArray.length; i++){
- OutArray[OutArray.length] = FindSegment(InArray[i]);
- }
-
- if (OutArray.length > 0){
- OutString = OutArray[0];
- }
- else{
- OutString = '';
- }
- var Spacer = '';
-
- for (i=1; i<OutArray.length; i++){
- Spacer = ' ';
- if ((Openers.indexOf(OutString.charAt(OutString.length-1)) > -1)||(Punctuation.indexOf(OutArray[i].charAt(0)) > -1)){
- Spacer = '';
- }
- OutString = OutString + Spacer + OutArray[i];
- }
-
-//Capitalize the first letter if necessary
- if (CapitalizeFirst == true){
- OutString = CapFirst(OutString);
- }
- return OutString;
-}
-
-function CheckAnswer(CheckType){
- if (Locked == true){return;}
- if (GuessSequence.length < 1){
- if (CheckType == 1){
- Penalties++;
- ShowMessage(NextCorrect + '<br /><br />' + FindSegment(Answers[0][0]));
- }
- return;
- }
- var i = 0;
- var j = 0;
- var k = 0;
- var WellDone = '';
- var WhichCorrect = -1;
- var TryAgain = '';
- var LongestCorrectBit = '';
- TempCorrect = new Array();
- LongestCorrect = new Array();
- var TempHint = '';
- var HintToReturn = 1;
- var OtherAnswers = '';
- var AllDone = false;
-
- for (i=0; i<Answers.length; i++){
- TempCorrect.length = 0;
- for (j=0; j<Answers[i].length; j++){
- if (Answers[i][j] == GuessSequence[j]){
- TempCorrect[j] = GuessSequence[j];
- }
- else{
- TempHint = Answers[i][j];
- break;
- }
- }
- if ((TempCorrect.length == GuessSequence.length)&&(TempCorrect.length == Answers[i].length)){
- WhichCorrect = i;
- break;
- }
- else{
- if (TempCorrect.length > LongestCorrect.length){
- LongestCorrect.length = 0;
- for (k=0; k<TempCorrect.length; k++){
- LongestCorrect[k] = TempCorrect[k];
- }
- HintToReturn = TempHint;
- }
- }
- }
- if (WhichCorrect > -1){
- AllDone = true;
- for (i=0; i<Answers.length; i++){
- if (i!=WhichCorrect){
- OtherAnswers += '<br />' + CompileString(Answers[i]);
- }
- }
- WellDone = '<span class="CorrectAnswer">' + CompiledOutput + '</span><br /><br />' + CorrectResponse + '<br />';
-
-//Do score calculation here
- Score = Math.floor(((Segments.length-Penalties) * 100)/Segments.length);
- WellDone += YourScoreIs + ' ' + Score + '%.<br />';
-
-[inclAlsoCorrect]
- if (OtherAnswers.length > 0){
- WellDone += TheseAnswersToo + '<span class="CorrectAnswer">' + OtherAnswers + '</span>';
- }
-[/inclAlsoCorrect]
-
- ShowMessage(WellDone);
- WriteToInstructions(YourScoreIs + ' ' + Score + '%.');
- }
-
- else{
- TryAgain = '<span class="Guess">' + CompileString(GuessSequence) + '</span><br /><br />';
- if ((CheckType == 0)||(LongestCorrect.length==0)){
- TryAgain += IncorrectResponse + '<br />';
- }
-
- if (LongestCorrect.length > 0){
- LongestCorrectBit = CompileString(LongestCorrect);
- GuessSequence.length = LongestCorrect.length;
- TryAgain += '<br />' + ThisMuchCorrect + '<br /><span class="Guess">' + LongestCorrectBit + '</span><br />';
- }
-
- if (CheckType == 1){
- TryAgain += '<br />' + NextCorrect + '<br />' + FindSegment(HintToReturn);
- }
-
-[inclTimer]
- if (TimeOver == true){
- Score = Math.floor(((LongestCorrect.length-Penalties) * 100)/Segments.length);
- if (Score < 0){Score = 0;}
- TryAgain += YourScoreIs + ' ' + Score + '%.<br />';
- }
-[/inclTimer]
- Penalties++; //Penalty for inaccurate check
- ShowMessage(TryAgain);
- }
-
-//If the exercise is over, deal with that
- if ((AllDone == true)||(TimeOver == true)){
-[inclSendResults]
- setTimeout('SendResults(' + Score + ')', 50);
-[/inclSendResults]
-[inclTimer]
- window.clearInterval(Interval);
-[/inclTimer]
- TimeOver = true;
- Locked = true;
- Finished = true;
- setTimeout('Finish()', SubmissionTimeout);
- WriteToInstructions(YourScoreIs + ' ' + Score + '%.');
- }
-}
-
-
-var Segments = new Array();
-[SegmentArray]
-
-var GuessSequence = new Array();
-
-var Answers = new Array();
-[AnswerArray]
-
-function doDrag(e) {
- if (CurrDrag == -1) {return};
- if (C.ie){var Ev = window.event}else{var Ev = e}
- var difX = Ev.clientX-window.lastX;
- var difY = Ev.clientY-window.lastY;
- var newX = Cds[CurrDrag].GetL()+difX;
- var newY = Cds[CurrDrag].GetT()+difY;
- Cds[CurrDrag].SetL(newX);
- Cds[CurrDrag].SetT(newY);
- window.lastX = Ev.clientX;
- window.lastY = Ev.clientY;
- return false;
-}
-
-function beginDrag(e, DragNum) {
- CurrDrag = DragNum;
- if (C.ie){
- var Ev = window.event;
- document.onmousemove=doDrag;
- document.onmouseup=endDrag;
- }
- else{
- var Ev = e;
- window.onmousemove=doDrag;
- window.onmouseup=endDrag;
- }
- Cds[CurrDrag].SwapColours();
- topZ++;
- Cds[CurrDrag].css.zIndex = topZ;
- window.lastX=Ev.clientX;
- window.lastY=Ev.clientY;
- return true;
-}
-
-function endDrag(e) {
- if (CurrDrag == -1) {return};
- Cds[CurrDrag].SwapColours();
- if (C.ie){document.onmousemove=null}else{window.onmousemove=null;}
- onEndDrag();
- CurrDrag = -1;
- return true;
-}
-
-function onEndDrag(){
-//Snap to lines
- var i = 0;
- var SnapLine = Cds[CurrDrag].GetT();
- var BiggestOverlap = -1;
- var OverlapRect = 0;
- for (i=0; i<L.length; i++){
- if (Cds[CurrDrag].Overlap(L[i]) > OverlapRect){
- OverlapRect = Cds[CurrDrag].Overlap(L[i]);
- BiggestOverlap = i;
- }
- }
- if (BiggestOverlap > -1){
- SnapLine = L[BiggestOverlap].GetB() - (Cds[CurrDrag].GetH() + 2);
- Cds[CurrDrag].SetT(SnapLine);
- CheckOver(-1);
- }
- if (CapitalizeFirst==true){
- setTimeout('DoCapitalization()', 50);
- }
-}
-
-function DoCapitalization(){
-//Capitalize first segment if necessary
- var FD = GetGuessSequence();
- if ((FD == -1)&&(FirstDiv > -1)){
- Cds[FirstDiv].elm.innerHTML = Segments[FirstDiv][0];
- }
- if (((FD != FirstDiv)&&(CapitalizeFirst == true))&&(FD > -1)){
- if (FirstDiv > -1){
- Cds[FirstDiv].elm.innerHTML = Segments[FirstDiv][0];
- }
- }
- if ((FD > -1)&&(CapitalizeFirst == true)){
- var Temp = CapFirst(Segments[FD][0]);
- Cds[FD].elm.innerHTML = Temp;
- FirstDiv = FD;
- }
-}
-
-function CheckOver(NoMove){
-//This recursive function spreads out the Cards on a line if two of them are overlapping;
-//if the spread operation moves one beyond the end of a line, it wraps it to the next line.
- for (var i=0; i<Cds.length; i++){
- for (var j=0; j<Cds.length; j++){
- if (i!=j){
- if (Cds[i].Overlap(Cds[j]) > 0){
- if ((i==NoMove)||(Cds[i].GetL() < Cds[j].GetL())){
- Cds[j].DockToR(Cds[i]);
- if (Cds[j].GetR() > (LeftColPos + DivWidth)){
- Cds[j].SetL(LeftColPos);
- Cds[j].SetT(Cds[j].GetT() + DropHeight);
- }
- CheckOver(j);
- }
- else{
- Cds[i].DockToR(Cds[j]);
- if (Cds[i].GetR() > (LeftColPos + DivWidth)){
- Cds[i].SetL(LeftColPos);
- Cds[i].SetT(Cds[i].GetT() + DropHeight);
- }
- CheckOver(i);
- }
- }
- }
- }
- }
-}
-
-function StartUp(){
-
-[inclSendResults]
- GetUserName();
-[/inclSendResults]
-
-[inclPreloadImages]
- PreloadImages([PreloadImageList]);
-[/inclPreloadImages]
-
- Segments = Shuffle(Segments);
-
-//Calculate page dimensions and positions
- pg = new PageDim();
- DivWidth = Math.floor((pg.W*4)/5);
- LeftColPos = Math.floor(pg.W/10);
- DragTop = parseInt(document.getElementById('CheckButtonDiv').offsetHeight) + parseInt(document.getElementById('CheckButtonDiv').offsetTop) + 10;
-
- var CurrTop = DragTop + 10;
-
-//Position the drop divs
- for (var i=0; i<DropTotal; i++){
- L[i] = new Card('Drop' + i, 0);
- L[i].SetT(CurrTop)
- L[i].tag = CurrTop-5;
- L[i].SetL(LeftColPos);
- L[i].css.backgroundColor = '[strPageBGColor]';
- CurrTop += L[i].GetH();
- topZ++;
- L[i].css.zIndex = topZ;
- }
- DropHeight = L[0].GetH();
-
- CurrTop = DragTop;
- var TempInt = 0;
- var DropHome = 0;
-
- for (i=0; i<Segments.length; i++){
-//Create a new pointer in the C array to ref the card div
- Cds[i] = new Card('D'+i, 0);
- Cds[i].elm.innerHTML = Segments[i][0];
- Cds[i].SetT(CurrTop);
- Cds[i].SetL(LeftColPos);
- Cds[i].css.cursor = 'move';
- TempInt = Cds[i].GetH();
- CurrTop = CurrTop + TempInt + 5;
- Cds[i].css.backgroundColor = '[strExBGColor]';
- Cds[i].css.color = '[strTextColor]';
- topZ++;
- Cds[i].css.zIndex = topZ;
- Cds[i].tag = Segments[i][1];
- Cds[i].index = i;
- }
-//Place them at the bottom of the page
- SetInitialPositions();
-
-[inclTimer]
- StartTimer();
-[/inclTimer]
-}
-
-function SetInitialPositions(){
-//Places all the divs at the bottom of the page in centred rows
-//First, get the vertical position of the first row
- var RTop = L[L.length-1].GetB() + 10;
-
-//Create an array to hold the numbers of Cards for each row
- CRows = new Array();
- CRows[0] = new Array();
- Widths = new Array();
- var i=0;
- var r=0;
- var RowWidth=0;
-//Sort the Cards into rows, storing their numbers in the array
-
- while (i<Cds.length){
-//if it fits on this row, add it
- if ((RowWidth + Cds[i].GetW() + 5) < DivWidth){
- CRows[r][CRows[r].length] = i;
- RowWidth += Cds[i].GetW() + 5;
-//Store the width in the Widths array for later
- Widths[r] = RowWidth;
- }
-//if not, increment the row number, and add it to the next row
- else{
- r++;
- CRows[r] = new Array();
- CRows[r][CRows[r].length] = i;
- RowWidth = Cds[i].GetW() + 5;
-//Store the width in the Widths array for later
- Widths[r] = RowWidth;
- }
-//move to the next Card
- i++;
- }
-//Now we have the numbers in rows, set out each row
- r=0;
- var Indent=0;
- for (r=0; r<CRows.length; r++){
-//Get the required indent for this row
- Indent = Math.floor((DivWidth-Widths[r])/2);
-//Set the first card in position
- Cds[CRows[r][0]].SetL(Indent + LeftColPos);
- Cds[CRows[r][0]].SetT(RTop);
- Cds[CRows[r][0]].SetHome();
- for (i=1; i<CRows[r].length; i++){
- Cds[CRows[r][i]].DockToR(Cds[CRows[r][i-1]]);
- Cds[CRows[r][i]].SetHome();
- }
-//Increment the row height
- RTop += Cds[0].GetH() + 5;
- }
-}
-
-function TimerStartUp(){
- setTimeout('StartUp()', 300);
-}
-
-[inclTimer]
-function TimesUp() {
- document.getElementById('Timer').innerHTML = '[strTimesUp]';
-[inclPreloadImages]
- RefreshImages();
-[/inclPreloadImages]
- TimeOver = true;
- CheckAnswer(0);
- Locked = true;
-}
-[/inclTimer]
View
102 mod/hotpot/v6/source/fjmatch6.ht_
@@ -1,102 +0,0 @@
-<?xml version="1.0"?>
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "xhtml11.dtd">
- <html xmlns="http://www.w3.org/1999/xhtml"
- xml:lang="en"><head>
-
-[strDublinCoreMetadata]
-
-<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
-
-<title>
-[strPlainTitle]
-</title>
-
-<!-- Made with executable version [strFullVersionInfo] -->
-
-<!-- The following insertion allows you to add your own code directly to this head tag from the configuration screen -->
-
-[strHeaderCode]
-
-<style type="text/css">
-
-[strStyleSheet]
-
-</style>
-
-<script type="text/javascript">
-
-//<![CDATA[
-
-<!--
-
-
-[strJSBrowserCheck]
-
-[strJSButtons]
-
-[strJSUtilities]
-
-[strJSFJMatch6]
-
-//-->
-
-//]]>
-
-</script>
-
-
-</head>
-<!--<body>Fool those dumb ad-inserting ISPs</body>-->
-
-<body onload="StartUp()" id="TheBody">
-
-<!-- BeginTopNavButtons -->
-
-[inclNavButtons]
-[strTopNavBar]
-[/inclNavButtons]
-
-<!-- EndTopNavButtons -->
-
-<div class="Titles">
- <h2 class="ExerciseTitle">[strExerciseTitle]</h2>
-[inclExerciseSubtitle]
- <h3 class="ExerciseSubtitle">[strExerciseSubtitle]</h3>
-[/inclExerciseSubtitle]
-</div>
-
-<div id="InstructionsDiv" class="StdDiv">
- <p id="Instructions">[strInstructions]</p>
-</div>
-
-<div id="MainDiv" class="StdDiv">
-
-<button class="FuncButton" onmouseover="FuncBtnOver(this)" onfocus="FuncBtnOver(this)" onmouseout="FuncBtnOut(this)" onblur="FuncBtnOut(this)" onmousedown="FuncBtnDown(this)" onmouseup="FuncBtnOut(this)" onclick="ShowItem()">[strNextCaption]</button>
-
-<button class="FuncButton" onmouseover="FuncBtnOver(this)" onfocus="FuncBtnOver(this)" onmouseout="FuncBtnOut(this)" onblur="FuncBtnOut(this)" onmousedown="FuncBtnDown(this)" onmouseup="FuncBtnOut(this)" onclick="DeleteItem()">[strDeleteCaption]</button>
-
-</div>
-
-<table class="FlashcardTable" border="0" cellspacing="0">
-<tbody id="Questions">
-
-[strTRows]
-
-</tbody>
-</table>
-
-<!-- BeginBottomNavButtons -->
-
-[inclNavButtons]
-[strBottomNavBar]
-[/inclNavButtons]
-
-<!-- EndBottomNavButtons -->
-
-<!-- BeginSubmissionForm -->
-
-<!-- EndSubmissionForm -->
-
-</body>
-
-</html>
View
107 mod/hotpot/v6/source/fjmatch6.js_
@@ -1,107 +0,0 @@
-
-var CurrItem = null;
-var Stage = 2;
-var QList = new Array();
-var ShuffleQs = [boolShuffleQs];
-
-function SetUpItems(){
-
- var i;
- var Row = null;
-
-//Remove all the table rows and put them in an array for processing
- var Qs = document.getElementById('Questions');
-
-//Remove the table rows to an array
- while (Qs.getElementsByTagName('tr').length > 0){
- Row = Qs.getElementsByTagName('tr')[0];
- Row.getElementsByTagName('td')[0].className = 'Hidden';
- Row.getElementsByTagName('td')[1].className = 'Hidden';
- QList.push(Qs.removeChild(Row));
- }
-
-//Shuffle the rows
- if (ShuffleQs == true){
- QList = Shuffle(QList);
- }
-
-//Write the rows back to the table body
- for (i=0; i<QList.length; i++){
- Qs.appendChild(QList[i]);
- }
-}
-
-function StartUp(){
-
- SetUpItems();
-
-[inclPreloadImages]
- PreloadImages([PreloadImageList]);
-[/inclPreloadImages]
-
-[inclPreloadImages]
- RefreshImages();
-[/inclPreloadImages]
-}
-
-var Started = false;
-
-function DeleteItem(){
- if ((CurrItem == null)||(document.getElementById('Questions').getElementsByTagName('tr').length < 1)){return;}
-
-//Delete the current item
- var DelItem = CurrItem;
- Stage = 2;
- ShowItem();
- document.getElementById('Questions').removeChild(DelItem);
-}
-
-function ShowItem(){
- var Qs = document.getElementById('Questions');
-
- var Len = Qs.getElementsByTagName('tr').length;
-
-//Bail if no more items
- if (Len < 1){
- return;
- }
-
-//if no current item, get the last item so we roll forward
- if (CurrItem == null){
- CurrItem = Qs.getElementsByTagName('tr')[Len-1];
- if (CurrItem == null){
- return;
- }
- }
-
-//if CurrItem has been fully shown, move to the next one
- if (Stage == 2){
- CurrItem.getElementsByTagName('td')[0].className = 'Hidden';
- CurrItem.getElementsByTagName('td')[1].className = 'Hidden';
- if (CurrItem.nextSibling != null){
- CurrItem = CurrItem.nextSibling;
- }
- else{
- CurrItem = Qs.getElementsByTagName('tr')[0];
- }
- }
-
-//Show the appropriate bits
- if (Stage == 2){
-//Show the first item and hide the second
- CurrItem.getElementsByTagName('td')[0].className = 'Showing';
- CurrItem.getElementsByTagName('td')[1].className = 'Hidden';
- Stage = 1;
- }
- else{
-//Show both items
- CurrItem.getElementsByTagName('td')[0].className = 'Showing';
- CurrItem.getElementsByTagName('td')[1].className = 'Showing';
- Stage = 2;
- }
-
-[inclPreloadImages]
- RefreshImages();
-[/inclPreloadImages]
-}
-
View
8 mod/hotpot/v6/source/hotpot6r.ht_
@@ -1,8 +0,0 @@
-
-[inclReadingTitle]
-<h3 class="ExerciseSubtitle">[strReadingTitle]</h3>
-[/inclReadingTitle]
-<div class="ReadingText">
-[strReadingText]
-</div>
-
View
596 mod/hotpot/v6/source/hp6.cs_
@@ -1,596 +0,0 @@
-
-/* This is the CSS stylesheet used in the exercise. */
-/* Elements in square brackets are replaced by data based on configuration settings when the exercise is built. */
-
-/* BeginCorePageCSS */
-
-/* Made with executable version [strFullVersionInfo] */
-
-body{
- font-family: [strFontFace];
-[inclPageBGColor] background-color: [strPageBGColor];[/inclPageBGColor]
- color: [strTextColor];
-[inclGraphicURL] background-image: url([strGraphicURL]);[/inclGraphicURL]
- margin-right: 5%;
- margin-left: 5%;
- font-size: [strFontSize];
-}
-
-p{
- text-align: left;
- margin: 0px;
- font-size: 100%;
-}
-
-table,div,span,td{
- font-size: 100%;
- color: [strTextColor];
-}
-
-div.Titles{
- padding: 0.5em;;
- text-align: center;
- color: [strTitleColor];
-}
-
-button{
- font-family: [strFontFace];
- font-size: 100%;
- display: inline;
-}
-
-.ExerciseTitle{
- font-size: 140%;
- color: [strTitleColor];
-}
-
-.ExerciseSubtitle{
- font-size: 120%;
- color: [strTitleColor];
-}
-
-div.StdDiv{
-[inclExBGColor] background-color: [strExBGColor];[/inclExBGColor]
- text-align: center;
- font-size: 100%;
- color: [strTextColor];
- padding: 0.5em;
- border-style: solid;
- border-width: 1px 1px 1px 1px;
- border-color: [strTextColor];
- margin-bottom: 1px;
-}
-
-/* EndCorePageCSS */
-
-.RTLText{
- text-align: right;
- font-size: 150%;
- direction: rtl;
- font-family: "Simplified Arabic", "Traditional Arabic", "Times New Roman", [strFontFace];
-}
-
-.CentredRTLText{
- text-align: center;
- font-size: 150%;
- direction: rtl;
- font-family: "Simplified Arabic", "Traditional Arabic", "Times New Roman", [strFontFace];
-}
-
-button p.RTLText{
- text-align: center;
-}
-
-.RTLGapBox{
- text-align: right;
- font-size: 150%;
- direction: rtl;
- font-family: "Times New Roman", [strFontFace];
-}
-
-.Guess{
- font-weight: bold;
-}
-
-.CorrectAnswer{
- font-weight: bold;
-}
-
-div#Timer{
- padding: 0.25em;
- margin-left: auto;
- margin-right: auto;
- text-align: center;
- color: [strTitleColor];
-}
-
-span#TimerText{
- padding: 0.25em;
- border-width: 1px;
- border-style: solid;
- font-weight: bold;
- display: none;
- color: [strTitleColor];
-}
-
-span.Instructions{
-
-}
-
-div.ExerciseText{
-
-}
-
-.FeedbackText, .FeedbackText span.CorrectAnswer, .FeedbackText span.Guess, .FeedbackText span.Answer{
- color: [strTitleColor];
-}
-
-.LeftItem{
- font-size: 100%;
- color: [strTextColor];
- text-align: left;
-}
-
-.RightItem{
- font-weight: bold;
- font-size: 100%;
- color: [strTextColor];
-}
-
-span.CorrectMark{
-
-}
-
-input, textarea{
- font-family: [strFontFace];
- font-size: 120%;
-}
-
-select{
- font-size: 100%;
-}
-
-div.Feedback {
-[inclPageBGColor] background-color: [strPageBGColor];[/inclPageBGColor]
- left: 33%;
- width: 34%;
- top: 33%;
- z-index: 1;
- border-style: solid;
- border-width: 1px;
- padding: 5px;
- text-align: center;
- color: [strTitleColor];
- position: absolute;
- display: none;
- font-size: 100%;
-}
-
-
-[inclReading]
-div.LeftContainer{
- border-style: none;
- padding: 2px 0px 2px 0px;
- float: left;
- width: 49.8%;
- margin-bottom: 0px;
-}
-
-div.RightContainer{
- border-style: none;
- padding: 2px 0px 2px 0px;
- float: right;
- width: 49.8%;
- margin-bottom: 0px;
-}
-
-.ReadingText{
- text-align: left;
-}
-
-#ReadingDiv h3.ExerciseSubtitle{
- color: [strTextColor];
-}
-
-[/inclReading]
-
-div.ExerciseDiv{
- color: [strTextColor];
-}
-
-/* JMatch flashcard styles */
-table.FlashcardTable{
- background-color: transparent;
- color: [strTextColor];
- border-color: [strTextColor];
- margin-left: 5%;
- margin-right: 5%;
- margin-top: 2em;
- margin-bottom: 2em;
- width: 90%;
- position: relative;
- text-align: center;
- padding: 0px;
-}
-
-table.FlashcardTable tr{
- border-style: none;
- margin: 0px;
- padding: 0px;
-[inclExBGColor] background-color: [strExBGColor];[/inclExBGColor]
-}
-
-table.FlashcardTable td.Showing{
- font-size: 140%;
- text-align: center;
- width: 50%;
- display: table-cell;
- padding: 2em;
- margin: 0px;
- border-style: solid;
- border-width: 1px;
- color: [strTextColor];
-[inclExBGColor] background-color: [strExBGColor];[/inclExBGColor]
-}
-
-table.FlashcardTable td.Hidden{
- display: none;
-}
-
-/* JMix styles */
-div#SegmentDiv{
- margin-top: 2em;
- margin-bottom: 2em;
- text-align: center;
-}
-
-a.ExSegment{
- font-size: 120%;
- font-weight: bold;
- text-decoration: none;
- color: [strTextColor];
-}
-
-span.RemainingWordList{
- font-style: italic;
-}
-
-div.DropLine {
- position: absolute;
- text-align: center;
- border-bottom-style: solid;
- border-bottom-width: 1px;
- border-bottom-color: [strTitleColor];
- width: 80%;
-}
-
-/* JCloze styles */
-
-.ClozeWordList{
- text-align: center;
- font-weight: bold;
-}
-
-div.ClozeBody{
- text-align: left;
- margin-top: 2em;
- margin-bottom: 2em;
- line-height: 2.0
-}
-
-span.GapSpan{
- font-weight: bold;
-}
-
-/* JCross styles */
-
-table.CrosswordGrid{
- margin: auto auto 1em auto;
- border-collapse: collapse;
- padding: 0px;
- background-color: #000000;
-}
-
-table.CrosswordGrid tbody tr td{
- width: 1.5em;
- height: 1.5em;
- text-align: center;
- vertical-align: middle;
- font-size: 140%;
- padding: 1px;
- margin: 0px;
- border-style: solid;
- border-width: 1px;
- border-color: #000000;
- color: #000000;
-}
-
-table.CrosswordGrid span{
- color: #000000;
-}
-
-table.CrosswordGrid td.BlankCell{
- background-color: #000000;
- color: #000000;
-}
-
-table.CrosswordGrid td.LetterOnlyCell{
- text-align: center;
- vertical-align: middle;
- background-color: #ffffff;
- color: #000000;
- font-weight: bold;
-}
-
-table.CrosswordGrid td.NumLetterCell{
- text-align: left;
- vertical-align: top;
- background-color: #ffffff;
- color: #000000;
- padding: 1px;
- font-weight: bold;
-}
-
-.NumLetterCellText{
- cursor: pointer;
- color: #000000;
-}
-
-.GridNum{
- vertical-align: super;
- font-size: 66%;
- font-weight: bold;
- text-decoration: none;
- color: #000000;
-}
-
-.GridNum:hover, .GridNum:visited{
- color: #000000;
-}
-
-table#Clues{
- margin: auto;
- vertical-align: top;
-}
-
-table#Clues td{
- vertical-align: top;
-}
-
-table.ClueList{
- margin: auto;
-}
-
-td.ClueNum{
- text-align: right;
- font-weight: bold;
- vertical-align: top;
-}
-
-td.Clue{
- text-align: left;
-}
-
-div#ClueEntry{
- text-align: left;
- margin-bottom: 1em;
-}
-
-/* Keypad styles */
-
-div.Keypad{
- text-align: center;
- display: none; /* initially hidden, shown if needed */
-}
-
-div.Keypad button{
- font-family: [strFontFace];
- font-size: 120%;
- background-color: #ffffff;
- color: #000000;
- width: 2em;
-}
-
-/* JQuiz styles */
-
-div.QuestionNavigation{
- text-align: center;
-}
-
-.QNum{
- margin: 0em 1em 0.5em 1em;
- font-weight: bold;
- vertical-align: middle;
-}
-
-textarea{
- font-family: [strFontFace];
-}
-
-.QuestionText{
-
-}
-
-.Answer{
- font-size: 120%;
- letter-spacing: 0.1em;
-}
-
-.PartialAnswer{
- font-size: 120%;
- letter-spacing: 0.1em;
- color: [strTitleColor];
-}
-
-.Highlight{
- color: #000000;
- background-color: #ffff00;
- font-weight: bold;
- font-size: 120%;
-}
-
-ol.QuizQuestions{
- text-align: left;
- list-style-type: none;
-}
-
-li.QuizQuestion{
- padding: 1em;
- border-style: solid;
- border-width: 0px 0px 1px 0px;
-}
-
-ol.MCAnswers{
- text-align: left;
- list-style-type: upper-alpha;
- padding: 1em;
-}
-
-ol.MCAnswers li{
- margin-bottom: 1em;
-}
-
-ol.MSelAnswers{
- text-align: left;
- list-style-type: lower-alpha;
- padding: 1em;
-}
-
-div.ShortAnswer{
- padding: 1em;
-}
-
-.FuncButton {
- text-align: center;
- border-style: solid;
-[inclExBGColor]
- border-left-color: [strFuncLightColor];
- border-top-color: [strFuncLightColor];
- border-right-color: [strFuncShadeColor];
- border-bottom-color: [strFuncShadeColor];
- color: [strTextColor];
- background-color: [strExBGColor];
-[/inclExBGColor]
- border-width: 2px;
- padding: 3px 6px 3px 6px;
- cursor: pointer;
-}
-
-.FuncButtonUp {
- color: [strExBGColor];
- text-align: center;
- border-style: solid;
-[inclExBGColor]
- border-left-color: [strFuncLightColor];
- border-top-color: [strFuncLightColor];
- border-right-color: [strFuncShadeColor];
- border-bottom-color: [strFuncShadeColor];
-[/inclExBGColor]
- background-color: [strTextColor];
- color: [strExBGColor];
- border-width: 2px;
- padding: 3px 6px 3px 6px;
- cursor: pointer;
-}
-
-.FuncButtonDown {
- color: [strExBGColor];
- text-align: center;
- border-style: solid;
-[inclExBGColor]
- border-left-color: [strFuncShadeColor];
- border-top-color: [strFuncShadeColor];
- border-right-color: [strFuncLightColor];
- border-bottom-color: [strFuncLightColor];
- background-color: [strTextColor];
- color: [strExBGColor];
-[/inclExBGColor]
- border-width: 2px;
- padding: 3px 6px 3px 6px;
- cursor: pointer;
-}
-
-/*BeginNavBarStyle*/
-
-div.NavButtonBar{
-[inclNavBarColor] background-color: [strNavBarColor];[/inclNavBarColor]
- text-align: center;
- margin: 2px 0px 2px 0px;
- clear: both;
- font-size: 100%;
-}
-
-.NavButton {
- border-style: solid;
-[inclNavBarColor]
- border-left-color: [strNavLightColor];
- border-top-color: [strNavLightColor];
- border-right-color: [strNavShadeColor];
- border-bottom-color: [strNavShadeColor];
- background-color: [strNavBarColor];
- color: [strNavTextColor];
-[/inclNavBarColor]
- border-width: 2px;
- cursor: pointer;
-}
-
-.NavButtonUp {
- border-style: solid;
-[inclNavBarColor]
- border-left-color: [strNavLightColor];
- border-top-color: [strNavLightColor];
- border-right-color: [strNavShadeColor];
- border-bottom-color: [strNavShadeColor];
- color: [strNavBarColor];
- background-color: [strNavTextColor];
-[/inclNavBarColor]
- border-width: 2px;
- cursor: pointer;
-}
-
-.NavButtonDown {
- border-style: solid;
-[inclNavBarColor]
- border-left-color: [strNavShadeColor];
- border-top-color: [strNavShadeColor];
- border-right-color: [strNavLightColor];
- border-bottom-color: [strNavLightColor];
- color: [strNavBarColor];
- background-color: [strNavTextColor];
-[/inclNavBarColor]
- border-width: 2px;
- cursor: pointer;
-}
-
-/*EndNavBarStyle*/
-
-a{
- color: [strLinkColor];
-}
-
-a:visited{
- color: [strVLinkColor];
-}
-
-a:hover{
- color: [strLinkColor];
-}
-
-div.CardStyle {
- position: absolute;
- font-family: [strFontFace];
- font-size: 100%;
- padding: 5px;
- border-style: solid;
- border-width: 1px;
- color: [strTextColor];
-[inclExBGColor] background-color: [strExBGColor];[/inclExBGColor]
- left: -50px;
- top: -50px;
- overflow: visible;
-}
-
-.rtl{
- text-align: right;
- font-size: 140%;
-}
View
55 mod/hotpot/v6/source/hp6browsercheck.js_
@@ -1,55 +0,0 @@
-
-function Client(){
-//if not a DOM browser, hopeless
- this.min = false; if (document.getElementById){this.min = true;};
-
- this.ua = navigator.userAgent;
- this.name = navigator.appName;
- this.ver = navigator.appVersion;
-
-//Get data about the browser
- this.mac = (this.ver.indexOf('Mac') != -1);
- this.win = (this.ver.indexOf('Windows') != -1);
-
-//Look for Gecko
- this.gecko = (this.ua.indexOf('Gecko') > 1);
- if (this.gecko){
- this.geckoVer = parseInt(this.ua.substring(this.ua.indexOf('Gecko')+6, this.ua.length));
- if (this.geckoVer < 20020000){this.min = false;}
- }
-
-//Look for Firebird
- this.firebird = (this.ua.indexOf('Firebird') > 1);
-
-//Look for Safari
- this.safari = (this.ua.indexOf('Safari') > 1);
- if (this.safari){
- this.gecko = false;
- }
-
-//Look for IE
- this.ie = (this.ua.indexOf('MSIE') > 0);
- if (this.ie){
- this.ieVer = parseFloat(this.ua.substring(this.ua.indexOf('MSIE')+5, this.ua.length));
- if (this.ieVer < 5.5){this.min = false;}
- }
-
-//Look for Opera
- this.opera = (this.ua.indexOf('Opera') > 0);
- if (this.opera){
- this.operaVer = parseFloat(this.ua.substring(this.ua.indexOf('Opera')+6, this.ua.length));
- if (this.operaVer < 7.04){this.min = false;}
- }
- if (this.min == false){
- alert('Your browser may not be able to handle this page.');
- }
-
-//Special case for the horrible ie5mac
- this.ie5mac = (this.ie&&this.mac&&(this.ieVer<6));
-}
-
-var C = new Client();
-
-//for (prop in C){
-// alert(prop + ': ' + C[prop]);
-//}
View
42 mod/hotpot/v6/source/hp6buttons.js_
@@ -1,42 +0,0 @@
-
-//CODE FOR HANDLING NAV BUTTONS AND FUNCTION BUTTONS
-
-//[strNavBarJS]
-function NavBtnOver(Btn){
- if (Btn.className != 'NavButtonDown'){Btn.className = 'NavButtonUp';}
-}
-
-function NavBtnOut(Btn){
- Btn.className = 'NavButton';
-}
-
-function NavBtnDown(Btn){
- Btn.className = 'NavButtonDown';
-}
-//[/strNavBarJS]
-
-function FuncBtnOver(Btn){
- if (Btn.className != 'FuncButtonDown'){Btn.className = 'FuncButtonUp';}
-}
-
-function FuncBtnOut(Btn){
- Btn.className = 'FuncButton';
-}
-
-function FuncBtnDown(Btn){
- Btn.className = 'FuncButtonDown';
-}
-
-function FocusAButton(){
- if (document.getElementById('CheckButton1') != null){
- document.getElementById('CheckButton1').focus();
- }
- else{
- if (document.getElementById('CheckButton2') != null){
- document.getElementById('CheckButton2').focus();
- }
- else{
- document.getElementsByTagName('button')[0].focus();
- }
- }
-}
View
152 mod/hotpot/v6/source/hp6card.js_
@@ -1,152 +0,0 @@
-
-function Card(ID, OverlapTolerance){
- this.elm=document.getElementById(ID);
- this.name=ID;
- this.css=this.elm.style;
- this.elm.style.left = 0 +'px';
- this.elm.style.top = 0 +'px';
- this.HomeL = 0;
- this.HomeT = 0;
- this.tag=-1;
- this.index=-1;
- this.OverlapTolerance = OverlapTolerance;
-}
-
-function CardGetL(){return parseInt(this.css.left)}
-Card.prototype.GetL=CardGetL;
-
-function CardGetT(){return parseInt(this.css.top)}
-Card.prototype.GetT=CardGetT;
-
-function CardGetW(){return parseInt(this.elm.offsetWidth)}
-Card.prototype.GetW=CardGetW;
-
-function CardGetH(){return parseInt(this.elm.offsetHeight)}
-Card.prototype.GetH=CardGetH;
-
-function CardGetB(){return this.GetT()+this.GetH()}
-Card.prototype.GetB=CardGetB;
-
-function CardGetR(){return this.GetL()+this.GetW()}
-Card.prototype.GetR=CardGetR;
-
-function CardSetL(NewL){this.css.left = NewL+'px'}
-Card.prototype.SetL=CardSetL;
-
-function CardSetT(NewT){this.css.top = NewT+'px'}
-Card.prototype.SetT=CardSetT;
-
-function CardSetW(NewW){this.css.width = NewW+'px'}
-Card.prototype.SetW=CardSetW;
-
-function CardSetH(NewH){this.css.height = NewH+'px'}
-Card.prototype.SetH=CardSetH;
-
-function CardInside(X,Y){
- var Result=false;
- if(X>=this.GetL()){if(X<=this.GetR()){if(Y>=this.GetT()){if(Y<=this.GetB()){Result=true;}}}}
- return Result;
-}
-Card.prototype.Inside=CardInside;
-
-function CardSwapColours(){
- var c=this.css.backgroundColor;
- this.css.backgroundColor=this.css.color;
- this.css.color=c;
-}
-Card.prototype.SwapColours=CardSwapColours;
-
-function CardHighlight(){
- this.css.backgroundColor='[strTextColor]';
- this.css.color='[strExBGColor]';
-}
-Card.prototype.Highlight=CardHighlight;
-
-function CardUnhighlight(){
- this.css.backgroundColor='[strExBGColor]';
- this.css.color='[strTextColor]';
-}
-Card.prototype.Unhighlight=CardUnhighlight;
-
-function CardOverlap(OtherCard){
- var smR=(this.GetR()<(OtherCard.GetR()+this.OverlapTolerance))? this.GetR(): (OtherCard.GetR()+this.OverlapTolerance);
- var lgL=(this.GetL()>OtherCard.GetL())? this.GetL(): OtherCard.GetL();
- var HDim=smR-lgL;
- if (HDim<1){return 0;}
- var smB=(this.GetB()<OtherCard.GetB())? this.GetB(): OtherCard.GetB();
- var lgT=(this.GetT()>OtherCard.GetT())? this.GetT(): OtherCard.GetT();
- var VDim=smB-lgT;
- if (VDim<1){return 0;}
- return (HDim*VDim);
-}
-Card.prototype.Overlap=CardOverlap;
-
-function CardDockToR(OtherCard){
- this.SetL(OtherCard.GetR() + 5);
- this.SetT(OtherCard.GetT());
-}
-
-Card.prototype.DockToR=CardDockToR;
-
-function CardSetHome(){
- this.HomeL=this.GetL();
- this.HomeT=this.GetT();
-}
-Card.prototype.SetHome=CardSetHome;
-
-function CardGoHome(){
- this.SetL(this.HomeL);
- this.SetT(this.HomeT);
-}
-
-Card.prototype.GoHome=CardGoHome;
-
-
-function doDrag(e) {
- if (CurrDrag == -1) {return};
- if (C.ie){var Ev = window.event}else{var Ev = e}
- var difX = Ev.clientX-window.lastX;
- var difY = Ev.clientY-window.lastY;
- var newX = DC[CurrDrag].GetL()+difX;
- var newY = DC[CurrDrag].GetT()+difY;
- DC[CurrDrag].SetL(newX);
- DC[CurrDrag].SetT(newY);
- window.lastX = Ev.clientX;
- window.lastY = Ev.clientY;
- return false;
-}
-
-function beginDrag(e, DragNum) {
- CurrDrag = DragNum;
- if (C.ie){
- var Ev = window.event;
- document.onmousemove=doDrag;
- document.onmouseup=endDrag;
- }
- else{
- var Ev = e;
- window.onmousemove=doDrag;
- window.onmouseup=endDrag;
- }
- DC[CurrDrag].Highlight();
- topZ++;
- DC[CurrDrag].css.zIndex = topZ;
- window.lastX=Ev.clientX;
- window.lastY=Ev.clientY;
- return false;
-}
-
-function endDrag(e) {
- if (CurrDrag == -1) {return};
- DC[CurrDrag].Unhighlight();
- if (C.ie){document.onmousemove=null}else{window.onmousemove=null;}
- onEndDrag();
- CurrDrag = -1;
-//Need a bugfix for Opera focus problem here
- if (C.opera){FocusAButton();}
- return true;
-}
-
-var CurrDrag = -1;
-var topZ = 100;
-
View
400 mod/hotpot/v6/source/hp6checkshortanswer.js_
@@ -1,400 +0,0 @@
-//CORE CODE FOR CHECKING SHORT ANSWER GUESSES AGAINST ANSWER ARRAYS
-
-var CaseSensitive = [boolCaseSensitive];
-var ShowAlsoCorrect = [boolShowAlsoCorrect];
-var PleaseEnter = '[strPleaseEnter]';
-var HybridTries = [intHybridTries];
-var PartlyIncorrect = '[strPartlyIncorrect]';
-var CorrectList = '[strCorrectList]';
-var NextCorrect = '[strNextCorrect]';
-var CurrBox = null;
-
-function TrackFocus(BoxID){
- InTextBox = true;
- CurrBox = document.getElementById(BoxID);
-}
-
-function LeaveGap(){
- InTextBox = false;
-}
-
-function TypeChars(Chars){
- if (CurrBox != null){
-//Following check added for 6.0.4.4 to avoid error message in IE6
- if (CurrBox.style.display != 'none'){
- CurrBox.value += Chars;
- CurrBox.focus();
- }
- }
-}
-
-function CheckGuess(Guess, Answer, CaseSensitive, PercentCorrect, Feedback){
- this.Guess = Guess;
- this.Answer = Answer;
- this.PercentCorrect = PercentCorrect;
- this.Feedback = Feedback;
- if (CaseSensitive == false){
- this.WorkingGuess = Guess.toLowerCase();
- this.WorkingAnswer = Answer.toLowerCase();
- }
- else{
- this.WorkingGuess = Guess;
- this.WorkingAnswer = Answer;
- }
- this.Hint = '';
- this.HintPenalty = 1/Answer.length;
- this.CorrectStart = '';
- this.WrongMiddle = '';
- this.CorrectEnd = '';
- this.PercentMatch = 0;
- this.DoCheck();
-}
-
-function CheckGuess_DoCheck(){
-//Check if it's an exact match
- if (this.WorkingAnswer == this.WorkingGuess){
- this.PercentMatch = 100;
- this.CorrectStart = this.Guess;
- return;
- }
-//Figure out how much of the beginning is correct
- var i = 0;
- var CorrectChars = 0;
- while (this.WorkingAnswer.charAt(i) == this.WorkingGuess.charAt(i)){
- i++;
- CorrectChars++;
- }
-//Stash the hint
- this.Hint = this.Answer.charAt(i);
-
- this.CorrectStart = this.Guess.substring(0, i);
-
-//If there's more to the answer, look at the rest of it
- if (i<this.Guess.length){
-
-//Figure out how much of the end is correct
- var j = this.WorkingGuess.length-1;
- var k = this.WorkingAnswer.length-1;
- while ((j>=i)&&((this.WorkingAnswer.charAt(k) == this.WorkingGuess.charAt(j))&&(CorrectChars < this.Answer.length))){
- CorrectChars++;
- j--;
- k--;
- }
- this.CorrectEnd = this.Guess.substring(j+1, this.Guess.length);
- this.WrongMiddle = this.Guess.substring(i, j+1);
- }
- if (TrimString(this.WrongMiddle).length < 1){this.WrongMiddle = '_';}
-//Calculate match score based on how much of the guess is correct
- if (CorrectChars < this.Answer.length){
- this.PercentMatch = Math.floor(100*CorrectChars)/this.Answer.length;
- }
- else{
- this.PercentMatch = Math.floor((100 * CorrectChars)/this.Guess.length);
- }
-}
-
-CheckGuess.prototype.DoCheck = CheckGuess_DoCheck;
-
-function CheckAnswerArray(CaseSensitive){
- this.CaseSensitive = CaseSensitive;
- this.Answers = new Array();
- this.Score = 0;
- this.Feedback = '';
- this.Hint = '';
- this.HintPenalty = 0;
- this.MatchedAnswerLength = 1;
- this.CompleteMatch = false;
- this.MatchNum = -1;
-}
-
-function CheckAnswerArray_AddAnswer(Guess, Answer, PercentCorrect, Feedback){
- this.Answers.push(new CheckGuess(Guess, Answer, this.CaseSensitive, PercentCorrect, Feedback));
-}
-
-CheckAnswerArray.prototype.AddAnswer = CheckAnswerArray_AddAnswer;
-
-function CheckAnswerArray_ClearAll(){
- this.Answers.length = 0;
-}
-
-CheckAnswerArray.prototype.ClearAll = CheckAnswerArray_ClearAll;
-
-function CheckAnswerArray_GetBestMatch(){
-//First check for a 100% match
- for (var i=0; i<this.Answers.length; i++){
- if (this.Answers[i].PercentMatch == 100){
- this.Feedback = this.Answers[i].Feedback;
- this.Score = this.Answers[i].PercentCorrect;
- this.CompleteMatch = true;
- this.MatchNum = i;
- return;
- }
- }
-//Now check for the best alternative match
- var PercentMatch = 0;
- var BestMatch = -1;
- for (i=0; i<this.Answers.length; i++){
- if ((this.Answers[i].PercentMatch > PercentMatch)&&(this.Answers[i].PercentCorrect == 100)){
- BestMatch = i;
- PercentMatch = this.Answers[i].PercentMatch;
- }
- }
- if (BestMatch > -1){
- this.Score = this.Answers[BestMatch].PercentMatch;
- this.Feedback = PartlyIncorrect + ' ';
- this.Feedback += '<span class="PartialAnswer">' + this.Answers[BestMatch].CorrectStart;
- this.Feedback += '<span class="Highlight">' + this.Answers[BestMatch].WrongMiddle + '</span>';
- this.Feedback += this.Answers[BestMatch].CorrectEnd + '</span>';
- this.Hint = '<span class="PartialAnswer">' + this.Answers[BestMatch].CorrectStart;
- this.Hint += '<span class="Highlight">' + this.Answers[BestMatch].Hint + '</span></span>';
- this.HintPenalty = this.Answers[BestMatch].HintPenalty;
- }
- else{
- this.Score = 0;
- this.Feedback = '';
- }
-}
-
-CheckAnswerArray.prototype.GetBestMatch = CheckAnswerArray_GetBestMatch;
-
-function CheckShortAnswer(QNum){
-//bail if question doesn't exist or exercise finished
- if ((State[QNum].length < 1)||(Finished == true)){return;}
-
-//bail if question already complete
- if (State[QNum][0] > -1){return;}
-
-//Get the guess (TrimString added to fix bug for 6.0.4.3)
- var G = TrimString(document.getElementById('Q_' + QNum + '_Guess').value);
-
-//If no guess, bail with message; no penalty
- if (G.length < 1){
- ShowMessage(PleaseEnter);
- return;
- }
-
-//Increment tries
- State[QNum][2]++;
-
-//Create a check object
- var CA = new CheckAnswerArray(CaseSensitive);
-
- CA.ClearAll();
- for (var ANum=0; ANum<I[QNum][3].length; ANum++){
- CA.AddAnswer(G, I[QNum][3][ANum][0], I[QNum][3][ANum][3], I[QNum][3][ANum][1]);
- }
- CA.GetBestMatch();
-
-//Store any match in the state tracking field
- if (CA.MatchNum > -1){
- State[QNum][5] += String.fromCharCode(65+CA.MatchNum) + ',';
- }
-
-//Add the percent correct value for this answer to the Q State (works for all
-//situations, wrong or right)
- State[QNum][3] += CA.Score;
-
-//Now branch, based on the nature of the match
-//Is it a complete match?
- if (CA.CompleteMatch == true){
-
-//Is it with a wrong answer, or a right answer?
- if (CA.Score == 100){
-//It's right
- CalculateShortAnsQuestionScore(QNum);
-//Get correct answer list if required, assuming there are any other correct alternatives
- if (ShowAlsoCorrect == true){
- var AlsoCorrectList = GetCorrectList(QNum, G, false);
- if (AlsoCorrectList.length > 0){
- CA.Feedback += '<br />' + CorrectList + '<br />' + AlsoCorrectList;
- }
- }
-
-//Get the overall score and add it to the feedback
- if (ContinuousScoring == true){
- CalculateOverallScore();
- CA.Feedback += '<br />' + YourScoreIs + ' ' + Score + '%.';
- WriteToInstructions(YourScoreIs + ' ' + Score + '%.');
- }
- ShowMessage(CA.Feedback);
-//Put the answer in
- ReplaceGuessBox(QNum, G);
- CheckFinished();
- return;
- }
- }
-
-//Otherwise, it's a match to a predicted wrong/partially correct, or a partial
-//match to a right answer
- if (CA.Feedback.length < 1){CA.Feedback = DefaultWrong;}
-//Remove any previous score unless exercise is finished (6.0.3.8+)
- if (Finished == false){
- WriteToInstructions(strInstructions);
- }
- ShowMessage(CA.Feedback);
-
-//If necessary, switch a hybrid question to m/c
- if (State[QNum][2] >= HybridTries){
- SwitchHybridDisplay(QNum);
- }
-}
-
-function CalculateShortAnsQuestionScore(QNum){
- var Tries = State[QNum][2] + State[QNum][4]; //include tries and hint penalties;
- var PercentCorrect = State[QNum][3];
- var HintPenalties = State[QNum][4];
-
-//Make sure it's not already complete
- if (State[QNum][0] < 0){
- if (HintPenalties >= 1){
- State[QNum][0] = 0;
- }
- else{
- State[QNum][0] = (PercentCorrect/(100*Tries));
- }
- if (State[QNum][0] < 0){
- State[QNum][0] = 0;
- }
- }
-}
-
-function SwitchHybridDisplay(QNum){
- if (document.getElementById('Q_' + QNum + '_Hybrid_MC') != null){
- document.getElementById('Q_' + QNum + '_Hybrid_MC').style.display = '';
- if (document.getElementById('Q_' + QNum + '_SA') != null){
- document.getElementById('Q_' + QNum + '_SA').style.display = 'none';
- }
- }
-}
-
-function GetCorrectArray(QNum){
- var Result = new Array();
- for (var ANum=0; ANum<I[QNum][3].length; ANum++){
- if (I[QNum][3][ANum][2] == 1){ //This is an acceptable correct answer
- Result.push(I[QNum][3][ANum][0]);
- }
- }
- return Result;
-}
-
-function GetCorrectList(QNum, Answer, IncludeAnswer){
- var As = GetCorrectArray(QNum);
- var Result = '';
- for (var ANum=0; ANum<As.length; ANum++){
- if ((IncludeAnswer == true)||(As[ANum] != Answer)){
- Result += As[ANum] + '<br />';
- }
- }
- return Result;
-}
-
-function GetFirstCorrectAnswer(QNum){
- var As = GetCorrectArray(QNum);
- if (As.length > 0){
- return As[0];
- }
- else{
- return '';
- }
-}
-
-function ReplaceGuessBox(QNum, Ans){
- if (document.getElementById('Q_' + QNum + '_SA') != null){
- var El = document.getElementById('Q_' + QNum + '_SA');
- while (El.childNodes.length > 0){
- El.removeChild(El.childNodes[0]);
- }
- var A = document.createElement('span');
- A.setAttribute('class', 'Answer');
- var T = document.createTextNode(Ans);
- A.appendChild(T);
- El.appendChild(A);
- }
-}
-
-[inclShowAnswer]
-
-function ShowAnswers(QNum){
-//bail if question doesn't exist or exercise finished
- if ((State[QNum].length < 1)||(Finished == true)){return;}
-
-//Get the answer list to display
- var Ans = GetCorrectList(QNum, '', false);
- Ans = CorrectList + '<br />' + Ans;
-
-//Display feedback
- ShowMessage(Ans);
-
-//Set the score for this question to 0 if no
- if (State[QNum][0] < 1){
- State[QNum][0] = 0;
- }
-
-//Get the first correct answer
- var FirstAns = GetFirstCorrectAnswer(QNum);
-
-//Replace the textbox
- ReplaceGuessBox(QNum, FirstAns);
-
-//Remove any current score
- WriteToInstructions(strInstructions);
-
-//This may be the last, so check finished status
- CheckFinished();
-}
-
-[/inclShowAnswer]
-
-[inclHint]
-
-function ShowHint(QNum){
-//bail if question doesn't exist or exercise finished
- if ((State[QNum].length < 1)||(Finished == true)){return;}
-
-//bail if question already complete
- if (State[QNum][0] > -1){return;}
-
-//Get the guess
- var G = document.getElementById('Q_' + QNum + '_Guess').value;
-
-//If no guess, give the first correct bit
- if (G.length < 1){
- var Ans = GetFirstCorrectAnswer(QNum);
- var Hint = Ans.charAt(0);
- ShowMessage(NextCorrect + '<br />' + Hint);
-//Penalty for hint
- State[QNum][4] += (1/Ans.length);
- return;
- }
-
-//Increment tries
- State[QNum][2]++;
-
-//Create a check object
- var CA = new CheckAnswerArray(CaseSensitive);
-
- CA.ClearAll();
- for (var ANum=0; ANum<I[QNum][3].length; ANum++){
-//Use only correct answers
- if (I[QNum][3][ANum][2] == 1){
- CA.AddAnswer(G, I[QNum][3][ANum][0], I[QNum][3][ANum][3], I[QNum][3][ANum][1]);
- }
- }
- CA.GetBestMatch();
- if (CA.CompleteMatch == true){
-//It's right!
- CheckShortAnswer(QNum);
- return;
- }
- else{
- if (CA.Hint.length > 0){
- ShowMessage(NextCorrect + '<br />' + CA.Hint);
- State[QNum][4] += CA.HintPenalty;
- }
- else{
- ShowMessage(DefaultWrong + '<br />' + NextCorrect + '<br />' + GetFirstCorrectAnswer(QNum).charAt(0));
- }
- }
-}
-
-[/inclHint]
View
18 mod/hotpot/v6/source/hp6hotpotnet.js_
@@ -1,18 +0,0 @@
-
-//HOTPOTNET-RELATED CODE
-
-var HPNStartTime = (new Date()).getTime();
-var SubmissionTimeout = 30000;
-var Detail = ''; //Global that is used to submit tracking data
-
-function Finish(){
-//If there's a form, fill it out and submit it
- if (document.store != null){
- Frm = document.store;
- Frm.starttime.value = HPNStartTime;
- Frm.endtime.value = (new Date()).getTime();
- Frm.mark.value = Score;
- Frm.detail.value = Detail;
- Frm.submit();
- }
-}
View
15 mod/hotpot/v6/source/hp6navbar.ht_
@@ -1,15 +0,0 @@
-<div class="NavButtonBar" id="[strNavBarID]">
-
-[inclBack]
-<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;">[strBackCaption]</button>
-[/inclBack]
-
-[inclContents]
-<button class="NavButton" onfocus="NavBtnOver(this)" onblur="NavBtnOut(this)" onmouseover="NavBtnOver(this)" onmouseout="NavBtnOut(this)" onmousedown="NavBtnDown(this)" onmouseup="NavBtnOut(this)" onclick="location='[strContentsURL]'; return false;"> [strContentsCaption] </button>
-[/inclContents]
-
-[inclNextEx]
-<button class="NavButton" onfocus="NavBtnOver(this)" onblur="NavBtnOut(this)" onmouseover="NavBtnOver(this)" onmouseout="NavBtnOut(this)" onmousedown="NavBtnDown(this)" onmouseup="NavBtnOut(this)" onclick="location='[strNextExURL]'; return false;">[strNextExCaption]</button>
-[/inclNextEx]
-
-</div>
View
35 mod/hotpot/v6/source/hp6objecttags.ht_
@@ -1,35 +0,0 @@
-
-[QuickTime Player]
-<object classid="clsid:02bf25d5-8c17-4b23-bc80-d3488abddc6b" data="[strFilePath]" width="[strWidth]" height="[strHeight]">
-<param name="src" value="[strFilePath]" />
-<param name="autoplay" value="false" />
-<param name="controller" value="true" />
-<object type="audio/quicktime" data="[strFilePath]" width="[strWidth]" height="[strHeight]">
-<param name="src" value="[strFilePath]" />
-<param name="autoplay" value="false" />
-<param name="controller" value="true" />
-[strContent]</object>
-</object>[/QuickTime Player]
-
-[Windows Media Player]
-<object classid="CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6" width="[strWidth]" height="[strHeight]">
-<param name="url" value="[strFilePath]" />
-<param name="autostart" value="false" />
-<param name="showcontrols" value="true" />[strContent]</object>
-[/Windows Media Player]
-
-[Real Player]
-<object type="audio/x-pn-realaudio-plugin" classid="CLSID:CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA" width="[strWidth]" height="[strHeight]">
-<param name="type" value="audio/x-pn-realaudio-plugin" />
-<param name="src" value="[strFilePath]" />
-<param name="autostart" value="false" />
-<param name="controls" value="[inclVideo]ImageWindow,[/inclVideo]ControlPanel" />
-[strContent]</object>[/Real Player]
-
-[Flash Player]
-<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"
-codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,14,0"
-type="application/x-shockwave-flash"
-width="[strWidth]" height="[strHeight]">
-<param name="movie" value="[strFilePath]" />
-[strContent]</object>[/Flash Player]
View
42 mod/hotpot/v6/source/hp6plainpage.ht_
@@ -1,42 +0,0 @@
-<?xml version="1.0"?>
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "xhtml11.dtd">
- <html xmlns="http://www.w3.org/1999/xhtml"
- xml:lang="en"><head>
-
-<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
-
-<title>
-Page Title
-</title>
-
-<!-- Made with executable version [strFullVersionInfo] -->
-
-<!-- The following insertion allows you to add your own code directly to this head tag from the configuration screen -->
-
-[strHeaderCode]
-
-<style type="text/css">
-
-[strStyleSheet]
-
-</style>
-
-</head>
-
-<body id="TheBody">
-
-<div class="Titles">
- <h2 class="ExerciseTitle">Page Title</h2>
- <h3 class="ExerciseSubtitle">Page Subtitle</h3>
-</div>
-
-<div id="MainDiv" class="StdDiv">
-
-<p>Page content...</p>
-
-</div>
-
-
-</body>
-
-</html>
View
53 mod/hotpot/v6/source/hp6sendresults.js_
@@ -1,53 +0,0 @@
-
-
-//CODE FOR HANDLING SENDING OF RESULTS
-
-var UserName = '';
-var StartTime = (new Date()).toLocaleString();
-
-var ResultForm = '<html><body><form name="Results" action="[strFormMailURL]" method="post" enctype="x-www-form-encoded">';
-ResultForm += '<input type="hidden" name="recipient" value="[strEMail]"></input>';
-ResultForm += '<input type="hidden" name="subject" value="[strEscapedExerciseTitle]"></input>';
-ResultForm += '<input type="hidden" name="Exercise" value="[strEscapedExerciseTitle]"></input>';
-ResultForm += '<input type="hidden" name="realname" value=""></input>';
-ResultForm += '<input type="hidden" name="Score" value=""></input>';
-ResultForm += '<input type="hidden" name="Start_Time" value=""></input>';
-ResultForm += '<input type="hidden" name="End_Time" value=""></input>';
-ResultForm += '<input type="hidden" name="title" value="Thanks!"></input>';
-[inclPageBGColor]ResultForm += '<input type="hidden" name="bgcolor" value="[strPageBGColor]"></input>';[/inclPageBGColor]
-ResultForm += '<input type="hidden" name="text_color" value="[strTitleColor]"></input>';
-ResultForm += '<input type="hidden" name="sort" value="order:realname,Exercise,Score,Start_Time,End_Time"></input>';
-ResultForm += '</form></body></html>';
-
-function GetUserName(){
- UserName = prompt('[strNamePlease]','');
- UserName += '';
- if ((UserName.substring(0,4) == 'null')||(UserName.length < 1)){
- UserName = prompt('[strNamePlease]','');
- UserName += '';
- if ((UserName.substring(0,4) == 'null')||(UserName.length < 1)){
- history.back();
- }
- }
-}
-
-function SendResults(Score){
- var today = new Date;
- var NewName = '' + today.getTime();
- var NewWin = window.open('', NewName, 'toolbar=no,location=no,directories=no,status=no, menubar=no,scrollbars=yes,resizable=no,,width=400,height=300');
-
-//If user has prevented popups, no way to proceed -- exit
- if (NewWin == null){
- return;
- }
-
- NewWin.document.clear();
- NewWin.document.open();
- NewWin.document.write(ResultForm);
- NewWin.document.close();
- NewWin.document.Results.Score.value = Score + '%';
- NewWin.document.Results.realname.value = UserName;
- NewWin.document.Results.End_Time.value = (new Date()).toLocaleString();
- NewWin.document.Results.Start_Time.value = StartTime;
- NewWin.document.Results.submit();
-}