removed bad newlines (\r\r\n) which caused double-spacing in HTML/JS/CSS source
This commit is contained in:
+124
-124
@@ -1,124 +1,124 @@
|
||||
<?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"> <span id="TimerText"> </span> </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()"> [strCheckCaption] </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;"> [strOKCaption] </button>
|
||||
</div>
|
||||
|
||||
<!-- BeginBottomNavButtons -->
|
||||
|
||||
<!-- EndBottomNavButtons -->
|
||||
|
||||
<!-- BeginSubmissionForm -->
|
||||
|
||||
<!-- EndSubmissionForm -->
|
||||
|
||||
</body>
|
||||
</html>
|
||||
<?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"> <span id="TimerText"> </span> </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()"> [strCheckCaption] </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;"> [strOKCaption] </button>
|
||||
</div>
|
||||
|
||||
<!-- BeginBottomNavButtons -->
|
||||
|
||||
<!-- EndBottomNavButtons -->
|
||||
|
||||
<!-- BeginSubmissionForm -->
|
||||
|
||||
<!-- EndSubmissionForm -->
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
||||
+323
-323
@@ -1,323 +1,323 @@
|
||||
|
||||
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]
|
||||
|
||||
|
||||
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]
|
||||
|
||||
|
||||
+132
-132
@@ -1,132 +1,132 @@
|
||||
<?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"> <span id="TimerText"> </span> </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)"> [strCheckCaption] </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()"> [strRestartCaption] </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)"> [strHintCaption] </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"> <br /> </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;"> [strOKCaption] </button>
|
||||
</div>
|
||||
|
||||
<!-- BeginBottomNavButtons -->
|
||||
|
||||
<!-- EndBottomNavButtons -->
|
||||
|
||||
<!-- BeginSubmissionForm -->
|
||||
|
||||
<!-- EndSubmissionForm -->
|
||||
|
||||
</body>
|
||||
</html>
|
||||
<?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"> <span id="TimerText"> </span> </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)"> [strCheckCaption] </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()"> [strRestartCaption] </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)"> [strHintCaption] </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"> <br /> </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;"> [strOKCaption] </button>
|
||||
</div>
|
||||
|
||||
<!-- BeginBottomNavButtons -->
|
||||
|
||||
<!-- EndBottomNavButtons -->
|
||||
|
||||
<!-- BeginSubmissionForm -->
|
||||
|
||||
<!-- EndSubmissionForm -->
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
||||
+521
-521
File diff suppressed because it is too large
Load Diff
+102
-102
@@ -1,102 +1,102 @@
|
||||
<?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>
|
||||
<?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>
|
||||
|
||||
+107
-107
@@ -1,107 +1,107 @@
|
||||
|
||||
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]
|
||||
}
|
||||
|
||||
|
||||
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]
|
||||
}
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
|
||||
[inclReadingTitle]
|
||||
<h3 class="ExerciseSubtitle">[strReadingTitle]</h3>
|
||||
[/inclReadingTitle]
|
||||
<div class="ReadingText">
|
||||
[strReadingText]
|
||||
</div>
|
||||
|
||||
|
||||
[inclReadingTitle]
|
||||
<h3 class="ExerciseSubtitle">[strReadingTitle]</h3>
|
||||
[/inclReadingTitle]
|
||||
<div class="ReadingText">
|
||||
[strReadingText]
|
||||
</div>
|
||||
|
||||
|
||||
+596
-596
File diff suppressed because it is too large
Load Diff
@@ -1,55 +1,55 @@
|
||||
|
||||
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]);
|
||||
//}
|
||||
|
||||
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]);
|
||||
//}
|
||||
|
||||
@@ -1,42 +1,42 @@
|
||||
|
||||
//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();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//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();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+152
-152
@@ -1,152 +1,152 @@
|
||||
|
||||
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;
|
||||
|
||||
|
||||
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;
|
||||
|
||||
|
||||
@@ -1,400 +1,400 @@
|
||||
//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));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//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]
|
||||
@@ -1,18 +1,18 @@
|
||||
|
||||
//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();
|
||||
}
|
||||
}
|
||||
|
||||
//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();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,15 +1,15 @@
|
||||
<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>
|
||||
<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>
|
||||
|
||||
@@ -1,35 +1,35 @@
|
||||
|
||||
[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]
|
||||
|
||||
[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]
|
||||
|
||||
@@ -1,42 +1,42 @@
|
||||
<?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>
|
||||
<?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>
|
||||
|
||||
@@ -1,53 +1,53 @@
|
||||
|
||||
|
||||
//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();
|
||||
}
|
||||
|
||||
|
||||
//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();
|
||||
}
|
||||
|
||||
@@ -1,60 +1,60 @@
|
||||
|
||||
|
||||
//CODE FOR HANDLING DISPLAY OF POPUP FEEDBACK BOX
|
||||
|
||||
var topZ = 1000;
|
||||
|
||||
function ShowMessage(Feedback){
|
||||
var Output = Feedback + '<br /><br />';
|
||||
|
||||
var obj = document.getElementById('FeedbackContent');
|
||||
if (obj) {
|
||||
obj.innerHTML = Output;
|
||||
}
|
||||
var obj = document.getElementById('FeedbackDiv');
|
||||
if (obj) {
|
||||
topZ++;
|
||||
obj.style.zIndex = topZ;
|
||||
obj.style.top = TopSettingWithScrollOffset(30) + 'px';
|
||||
obj.style.display = 'block';
|
||||
}
|
||||
|
||||
ShowElements(false, 'input');
|
||||
ShowElements(false, 'select');
|
||||
ShowElements(false, 'object');
|
||||
|
||||
//Focus the OK button
|
||||
var obj = document.getElementById('FeedbackOKButton');
|
||||
if (obj) {
|
||||
setTimeout("document.getElementById('FeedbackOKButton').focus()", 50);
|
||||
}
|
||||
|
||||
//[inclPreloadImages]
|
||||
// RefreshImages();
|
||||
//[/inclPreloadImages]
|
||||
}
|
||||
|
||||
function ShowElements(Show, TagName){
|
||||
//Special for IE bug -- hide all the form elements that will show through the popup
|
||||
if (C.ie){
|
||||
var Els = document.getElementsByTagName(TagName);
|
||||
for (var i=0; i<Els.length; i++){
|
||||
if (Show == true){
|
||||
Els[i].style.display = 'inline';
|
||||
}
|
||||
else{
|
||||
Els[i].style.display = 'none';
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function HideFeedback(){
|
||||
document.getElementById('FeedbackDiv').style.display = 'none';
|
||||
ShowElements(true, 'input');
|
||||
ShowElements(true, 'select');
|
||||
ShowElements(true, 'object');
|
||||
if (Finished == true){
|
||||
Finish();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//CODE FOR HANDLING DISPLAY OF POPUP FEEDBACK BOX
|
||||
|
||||
var topZ = 1000;
|
||||
|
||||
function ShowMessage(Feedback){
|
||||
var Output = Feedback + '<br /><br />';
|
||||
|
||||
var obj = document.getElementById('FeedbackContent');
|
||||
if (obj) {
|
||||
obj.innerHTML = Output;
|
||||
}
|
||||
var obj = document.getElementById('FeedbackDiv');
|
||||
if (obj) {
|
||||
topZ++;
|
||||
obj.style.zIndex = topZ;
|
||||
obj.style.top = TopSettingWithScrollOffset(30) + 'px';
|
||||
obj.style.display = 'block';
|
||||
}
|
||||
|
||||
ShowElements(false, 'input');
|
||||
ShowElements(false, 'select');
|
||||
ShowElements(false, 'object');
|
||||
|
||||
//Focus the OK button
|
||||
var obj = document.getElementById('FeedbackOKButton');
|
||||
if (obj) {
|
||||
setTimeout("document.getElementById('FeedbackOKButton').focus()", 50);
|
||||
}
|
||||
|
||||
//[inclPreloadImages]
|
||||
// RefreshImages();
|
||||
//[/inclPreloadImages]
|
||||
}
|
||||
|
||||
function ShowElements(Show, TagName){
|
||||
//Special for IE bug -- hide all the form elements that will show through the popup
|
||||
if (C.ie){
|
||||
var Els = document.getElementsByTagName(TagName);
|
||||
for (var i=0; i<Els.length; i++){
|
||||
if (Show == true){
|
||||
Els[i].style.display = 'inline';
|
||||
}
|
||||
else{
|
||||
Els[i].style.display = 'none';
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function HideFeedback(){
|
||||
document.getElementById('FeedbackDiv').style.display = 'none';
|
||||
ShowElements(true, 'input');
|
||||
ShowElements(true, 'select');
|
||||
ShowElements(true, 'object');
|
||||
if (Finished == true){
|
||||
Finish();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,33 +1,33 @@
|
||||
|
||||
|
||||
//CODE FOR HANDLING TIMER
|
||||
//Timer code
|
||||
var Seconds = [intSeconds];
|
||||
var Interval = null;
|
||||
|
||||
function StartTimer(){
|
||||
Interval = window.setInterval('DownTime()',1000);
|
||||
document.getElementById('TimerText').style.display = 'inline';
|
||||
}
|
||||
|
||||
function DownTime(){
|
||||
var ss = Seconds % 60;
|
||||
if (ss<10){
|
||||
ss='0' + ss + '';
|
||||
}
|
||||
|
||||
var mm = Math.floor(Seconds / 60);
|
||||
|
||||
if (document.getElementById('Timer') == null){
|
||||
return;
|
||||
}
|
||||
|
||||
document.getElementById('TimerText').innerHTML = mm + ':' + ss;
|
||||
if (Seconds < 1){
|
||||
window.clearInterval(Interval);
|
||||
TimeOver = true;
|
||||
TimesUp();
|
||||
}
|
||||
Seconds--;
|
||||
}
|
||||
|
||||
|
||||
|
||||
//CODE FOR HANDLING TIMER
|
||||
//Timer code
|
||||
var Seconds = [intSeconds];
|
||||
var Interval = null;
|
||||
|
||||
function StartTimer(){
|
||||
Interval = window.setInterval('DownTime()',1000);
|
||||
document.getElementById('TimerText').style.display = 'inline';
|
||||
}
|
||||
|
||||
function DownTime(){
|
||||
var ss = Seconds % 60;
|
||||
if (ss<10){
|
||||
ss='0' + ss + '';
|
||||
}
|
||||
|
||||
var mm = Math.floor(Seconds / 60);
|
||||
|
||||
if (document.getElementById('Timer') == null){
|
||||
return;
|
||||
}
|
||||
|
||||
document.getElementById('TimerText').innerHTML = mm + ':' + ss;
|
||||
if (Seconds < 1){
|
||||
window.clearInterval(Interval);
|
||||
TimeOver = true;
|
||||
TimesUp();
|
||||
}
|
||||
Seconds--;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,237 +1,237 @@
|
||||
//GENERAL UTILITY FUNCTIONS AND VARIABLES
|
||||
|
||||
//PAGE DIMENSION FUNCTIONS
|
||||
function PageDim(){
|
||||
//Get the page width and height
|
||||
this.W = 600;
|
||||
this.H = 400;
|
||||
this.W = document.getElementsByTagName('body')[0].clientWidth;
|
||||
this.H = document.getElementsByTagName('body')[0].clientHeight;
|
||||
}
|
||||
|
||||
var pg = null;
|
||||
|
||||
function GetPageXY(El) {
|
||||
var XY = {x: 0, y: 0};
|
||||
while(El){
|
||||
XY.x += El.offsetLeft;
|
||||
XY.y += El.offsetTop;
|
||||
El = El.offsetParent;
|
||||
}
|
||||
return XY;
|
||||
}
|
||||
|
||||
function GetScrollTop(){
|
||||
if (document.documentElement && document.documentElement.scrollTop){
|
||||
return document.documentElement.scrollTop;
|
||||
}
|
||||
else{
|
||||
if (document.body){
|
||||
return document.body.scrollTop;
|
||||
}
|
||||
else{
|
||||
return window.pageYOffset;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function GetViewportHeight(){
|
||||
if (window.innerHeight){
|
||||
return window.innerHeight;
|
||||
}
|
||||
else{
|
||||
return document.getElementsByTagName('body')[0].clientHeight;
|
||||
}
|
||||
}
|
||||
|
||||
function TopSettingWithScrollOffset(TopPercent){
|
||||
var T = Math.floor(GetViewportHeight() * (TopPercent/100));
|
||||
return GetScrollTop() + T;
|
||||
}
|
||||
|
||||
//CODE FOR AVOIDING LOSS OF DATA WHEN BACKSPACE KEY INVOKES history.back()
|
||||
var InTextBox = false;
|
||||
|
||||
function SuppressBackspace(e){
|
||||
if (InTextBox == true){return;}
|
||||
if (C.ie) {
|
||||
thisKey = window.event.keyCode;
|
||||
}
|
||||
else {
|
||||
thisKey = e.keyCode;
|
||||
}
|
||||
|
||||
var Suppress = false;
|
||||
|
||||
if (thisKey == 8) {
|
||||
Suppress = true;
|
||||
}
|
||||
|
||||
if (Suppress == true){
|
||||
if (C.ie){
|
||||
window.event.returnValue = false;
|
||||
window.event.cancelBubble = true;
|
||||
}
|
||||
else{
|
||||
e.preventDefault();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (C.ie){
|
||||
document.attachEvent('onkeydown',SuppressBackspace);
|
||||
window.attachEvent('onkeydown',SuppressBackspace);
|
||||
}
|
||||
else{
|
||||
if (window.addEventListener){
|
||||
window.addEventListener('keypress',SuppressBackspace,false);
|
||||
}
|
||||
}
|
||||
|
||||
function ReduceItems(InArray, ReduceToSize){
|
||||
var ItemToDump=0;
|
||||
var j=0;
|
||||
while (InArray.length > ReduceToSize){
|
||||
ItemToDump = Math.floor(InArray.length*Math.random());
|
||||
InArray.splice(ItemToDump, 1);
|
||||
}
|
||||
}
|
||||
|
||||
function Shuffle(InArray){
|
||||
var Num;
|
||||
var Temp = new Array();
|
||||
var Len = InArray.length;
|
||||
|
||||
var j = Len;
|
||||
|
||||
for (var i=0; i<Len; i++){
|
||||
Temp[i] = InArray[i];
|
||||
}
|
||||
|
||||
for (i=0; i<Len; i++){
|
||||
Num = Math.floor(j * Math.random());
|
||||
InArray[i] = Temp[Num];
|
||||
|
||||
for (var k=Num; k < (j-1); k++) {
|
||||
Temp[k] = Temp[k+1];
|
||||
}
|
||||
j--;
|
||||
}
|
||||
return InArray;
|
||||
}
|
||||
|
||||
function WriteToInstructions(Feedback) {
|
||||
document.getElementById('InstructionsDiv').innerHTML = Feedback;
|
||||
[inclPreloadImages]
|
||||
RefreshImages();
|
||||
[/inclPreloadImages]
|
||||
}
|
||||
|
||||
|
||||
[inclPreloadImages]
|
||||
Imgs = new Array();
|
||||
|
||||
function PreloadImages(){
|
||||
var a = PreloadImages.arguments;
|
||||
for (var i=0; i<a.length; i++){
|
||||
Imgs[i] = new Image();
|
||||
Imgs[i].src = a[i];
|
||||
}
|
||||
}
|
||||
|
||||
function RefreshImages(){
|
||||
for (var i=0; i<document.images.length; i++){
|
||||
if (document.images[i].name.substring(0,6) != 'NavBar'){
|
||||
document.images[i].src = document.images[i].src;
|
||||
}
|
||||
}
|
||||
}
|
||||
[/inclPreloadImages]
|
||||
|
||||
function EscapeDoubleQuotes(InString){
|
||||
return InString.replace(/"/g, '"')
|
||||
}
|
||||
|
||||
function TrimString(InString){
|
||||
var x = 0;
|
||||
|
||||
if (InString.length != 0) {
|
||||
while ((InString.charAt(InString.length - 1) == '\u0020') || (InString.charAt(InString.length - 1) == '\u000A') || (InString.charAt(InString.length - 1) == '\u000D')){
|
||||
InString = InString.substring(0, InString.length - 1)
|
||||
}
|
||||
|
||||
while ((InString.charAt(0) == '\u0020') || (InString.charAt(0) == '\u000A') || (InString.charAt(0) == '\u000D')){
|
||||
InString = InString.substring(1, InString.length)
|
||||
}
|
||||
|
||||
while (InString.indexOf(' ') != -1) {
|
||||
x = InString.indexOf(' ')
|
||||
InString = InString.substring(0, x) + InString.substring(x+1, InString.length)
|
||||
}
|
||||
|
||||
return InString;
|
||||
}
|
||||
|
||||
else {
|
||||
return '';
|
||||
}
|
||||
}
|
||||
|
||||
function FindLongest(InArray){
|
||||
if (InArray.length < 1){return -1;}
|
||||
|
||||
var Longest = 0;
|
||||
for (var i=1; i<InArray.length; i++){
|
||||
if (InArray[i].length > InArray[Longest].length){
|
||||
Longest = i;
|
||||
}
|
||||
}
|
||||
return Longest;
|
||||
}
|
||||
|
||||
//UNICODE CHARACTER FUNCTIONS
|
||||
function IsCombiningDiacritic(CharNum){
|
||||
var Result = (((CharNum >= 0x0300)&&(CharNum <= 0x370))||((CharNum >= 0x20d0)&&(CharNum <= 0x20ff)));
|
||||
Result = Result || (((CharNum >= 0x3099)&&(CharNum <= 0x309a))||((CharNum >= 0xfe20)&&(CharNum <= 0xfe23)));
|
||||
return Result;
|
||||
}
|
||||
|
||||
function IsCJK(CharNum){
|
||||
return ((CharNum >= 0x3000)&&(CharNum < 0xd800));
|
||||
}
|
||||
|
||||
//SETUP FUNCTIONS
|
||||
//BROWSER WILL REFILL TEXT BOXES FROM CACHE IF NOT PREVENTED
|
||||
function ClearTextBoxes(){
|
||||
var NList = document.getElementsByTagName('input');
|
||||
for (var i=0; i<NList.length; i++){
|
||||
if ((NList[i].id.indexOf('Guess') > -1)||(NList[i].id.indexOf('Gap') > -1)){
|
||||
NList[i].value = '';
|
||||
}
|
||||
if (NList[i].id.indexOf('Chk') > -1){
|
||||
NList[i].checked = '';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//EXTENSION TO ARRAY OBJECT
|
||||
function Array_IndexOf(Input){
|
||||
var Result = -1;
|
||||
for (var i=0; i<this.length; i++){
|
||||
if (this[i] == Input){
|
||||
Result = i;
|
||||
}
|
||||
}
|
||||
return Result;
|
||||
}
|
||||
Array.prototype.indexOf = Array_IndexOf;
|
||||
|
||||
//IE HAS RENDERING BUG WITH BOTTOM NAVBAR
|
||||
function RemoveBottomNavBarForIE(){
|
||||
if ((C.ie)&&(document.getElementById('Reading') != null)){
|
||||
if (document.getElementById('BottomNavBar') != null){
|
||||
document.getElementById('TheBody').removeChild(document.getElementById('BottomNavBar'));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//GENERAL UTILITY FUNCTIONS AND VARIABLES
|
||||
|
||||
//PAGE DIMENSION FUNCTIONS
|
||||
function PageDim(){
|
||||
//Get the page width and height
|
||||
this.W = 600;
|
||||
this.H = 400;
|
||||
this.W = document.getElementsByTagName('body')[0].clientWidth;
|
||||
this.H = document.getElementsByTagName('body')[0].clientHeight;
|
||||
}
|
||||
|
||||
var pg = null;
|
||||
|
||||
function GetPageXY(El) {
|
||||
var XY = {x: 0, y: 0};
|
||||
while(El){
|
||||
XY.x += El.offsetLeft;
|
||||
XY.y += El.offsetTop;
|
||||
El = El.offsetParent;
|
||||
}
|
||||
return XY;
|
||||
}
|
||||
|
||||
function GetScrollTop(){
|
||||
if (document.documentElement && document.documentElement.scrollTop){
|
||||
return document.documentElement.scrollTop;
|
||||
}
|
||||
else{
|
||||
if (document.body){
|
||||
return document.body.scrollTop;
|
||||
}
|
||||
else{
|
||||
return window.pageYOffset;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function GetViewportHeight(){
|
||||
if (window.innerHeight){
|
||||
return window.innerHeight;
|
||||
}
|
||||
else{
|
||||
return document.getElementsByTagName('body')[0].clientHeight;
|
||||
}
|
||||
}
|
||||
|
||||
function TopSettingWithScrollOffset(TopPercent){
|
||||
var T = Math.floor(GetViewportHeight() * (TopPercent/100));
|
||||
return GetScrollTop() + T;
|
||||
}
|
||||
|
||||
//CODE FOR AVOIDING LOSS OF DATA WHEN BACKSPACE KEY INVOKES history.back()
|
||||
var InTextBox = false;
|
||||
|
||||
function SuppressBackspace(e){
|
||||
if (InTextBox == true){return;}
|
||||
if (C.ie) {
|
||||
thisKey = window.event.keyCode;
|
||||
}
|
||||
else {
|
||||
thisKey = e.keyCode;
|
||||
}
|
||||
|
||||
var Suppress = false;
|
||||
|
||||
if (thisKey == 8) {
|
||||
Suppress = true;
|
||||
}
|
||||
|
||||
if (Suppress == true){
|
||||
if (C.ie){
|
||||
window.event.returnValue = false;
|
||||
window.event.cancelBubble = true;
|
||||
}
|
||||
else{
|
||||
e.preventDefault();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (C.ie){
|
||||
document.attachEvent('onkeydown',SuppressBackspace);
|
||||
window.attachEvent('onkeydown',SuppressBackspace);
|
||||
}
|
||||
else{
|
||||
if (window.addEventListener){
|
||||
window.addEventListener('keypress',SuppressBackspace,false);
|
||||
}
|
||||
}
|
||||
|
||||
function ReduceItems(InArray, ReduceToSize){
|
||||
var ItemToDump=0;
|
||||
var j=0;
|
||||
while (InArray.length > ReduceToSize){
|
||||
ItemToDump = Math.floor(InArray.length*Math.random());
|
||||
InArray.splice(ItemToDump, 1);
|
||||
}
|
||||
}
|
||||
|
||||
function Shuffle(InArray){
|
||||
var Num;
|
||||
var Temp = new Array();
|
||||
var Len = InArray.length;
|
||||
|
||||
var j = Len;
|
||||
|
||||
for (var i=0; i<Len; i++){
|
||||
Temp[i] = InArray[i];
|
||||
}
|
||||
|
||||
for (i=0; i<Len; i++){
|
||||
Num = Math.floor(j * Math.random());
|
||||
InArray[i] = Temp[Num];
|
||||
|
||||
for (var k=Num; k < (j-1); k++) {
|
||||
Temp[k] = Temp[k+1];
|
||||
}
|
||||
j--;
|
||||
}
|
||||
return InArray;
|
||||
}
|
||||
|
||||
function WriteToInstructions(Feedback) {
|
||||
document.getElementById('InstructionsDiv').innerHTML = Feedback;
|
||||
[inclPreloadImages]
|
||||
RefreshImages();
|
||||
[/inclPreloadImages]
|
||||
}
|
||||
|
||||
|
||||
[inclPreloadImages]
|
||||
Imgs = new Array();
|
||||
|
||||
function PreloadImages(){
|
||||
var a = PreloadImages.arguments;
|
||||
for (var i=0; i<a.length; i++){
|
||||
Imgs[i] = new Image();
|
||||
Imgs[i].src = a[i];
|
||||
}
|
||||
}
|
||||
|
||||
function RefreshImages(){
|
||||
for (var i=0; i<document.images.length; i++){
|
||||
if (document.images[i].name.substring(0,6) != 'NavBar'){
|
||||
document.images[i].src = document.images[i].src;
|
||||
}
|
||||
}
|
||||
}
|
||||
[/inclPreloadImages]
|
||||
|
||||
function EscapeDoubleQuotes(InString){
|
||||
return InString.replace(/"/g, '"')
|
||||
}
|
||||
|
||||
function TrimString(InString){
|
||||
var x = 0;
|
||||
|
||||
if (InString.length != 0) {
|
||||
while ((InString.charAt(InString.length - 1) == '\u0020') || (InString.charAt(InString.length - 1) == '\u000A') || (InString.charAt(InString.length - 1) == '\u000D')){
|
||||
InString = InString.substring(0, InString.length - 1)
|
||||
}
|
||||
|
||||
while ((InString.charAt(0) == '\u0020') || (InString.charAt(0) == '\u000A') || (InString.charAt(0) == '\u000D')){
|
||||
InString = InString.substring(1, InString.length)
|
||||
}
|
||||
|
||||
while (InString.indexOf(' ') != -1) {
|
||||
x = InString.indexOf(' ')
|
||||
InString = InString.substring(0, x) + InString.substring(x+1, InString.length)
|
||||
}
|
||||
|
||||
return InString;
|
||||
}
|
||||
|
||||
else {
|
||||
return '';
|
||||
}
|
||||
}
|
||||
|
||||
function FindLongest(InArray){
|
||||
if (InArray.length < 1){return -1;}
|
||||
|
||||
var Longest = 0;
|
||||
for (var i=1; i<InArray.length; i++){
|
||||
if (InArray[i].length > InArray[Longest].length){
|
||||
Longest = i;
|
||||
}
|
||||
}
|
||||
return Longest;
|
||||
}
|
||||
|
||||
//UNICODE CHARACTER FUNCTIONS
|
||||
function IsCombiningDiacritic(CharNum){
|
||||
var Result = (((CharNum >= 0x0300)&&(CharNum <= 0x370))||((CharNum >= 0x20d0)&&(CharNum <= 0x20ff)));
|
||||
Result = Result || (((CharNum >= 0x3099)&&(CharNum <= 0x309a))||((CharNum >= 0xfe20)&&(CharNum <= 0xfe23)));
|
||||
return Result;
|
||||
}
|
||||
|
||||
function IsCJK(CharNum){
|
||||
return ((CharNum >= 0x3000)&&(CharNum < 0xd800));
|
||||
}
|
||||
|
||||
//SETUP FUNCTIONS
|
||||
//BROWSER WILL REFILL TEXT BOXES FROM CACHE IF NOT PREVENTED
|
||||
function ClearTextBoxes(){
|
||||
var NList = document.getElementsByTagName('input');
|
||||
for (var i=0; i<NList.length; i++){
|
||||
if ((NList[i].id.indexOf('Guess') > -1)||(NList[i].id.indexOf('Gap') > -1)){
|
||||
NList[i].value = '';
|
||||
}
|
||||
if (NList[i].id.indexOf('Chk') > -1){
|
||||
NList[i].checked = '';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//EXTENSION TO ARRAY OBJECT
|
||||
function Array_IndexOf(Input){
|
||||
var Result = -1;
|
||||
for (var i=0; i<this.length; i++){
|
||||
if (this[i] == Input){
|
||||
Result = i;
|
||||
}
|
||||
}
|
||||
return Result;
|
||||
}
|
||||
Array.prototype.indexOf = Array_IndexOf;
|
||||
|
||||
//IE HAS RENDERING BUG WITH BOTTOM NAVBAR
|
||||
function RemoveBottomNavBarForIE(){
|
||||
if ((C.ie)&&(document.getElementById('Reading') != null)){
|
||||
if (document.getElementById('BottomNavBar') != null){
|
||||
document.getElementById('TheBody').removeChild(document.getElementById('BottomNavBar'));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+165
-165
@@ -1,165 +1,165 @@
|
||||
<?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]
|
||||
|
||||
[strJSJCloze6]
|
||||
|
||||
[inclTimer]
|
||||
[strJSTimer]
|
||||
[/inclTimer]
|
||||
|
||||
[inclSendResults]
|
||||
[strJSSendResults]
|
||||
[/inclSendResults]
|
||||
|
||||
//-->
|
||||
|
||||
//]]>
|
||||
|
||||
</script>
|
||||
|
||||
|
||||
</head>
|
||||
|
||||
<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]
|
||||
[inclTimer]
|
||||
<div id="Timer"><span id="TimerText"> </span></div>
|
||||
[/inclTimer]
|
||||
|
||||
</div>
|
||||
|
||||
<div id="InstructionsDiv" class="StdDiv">
|
||||
<p id="Instructions">[strInstructions]</p>
|
||||
</div>
|
||||
|
||||
[inclReading]
|
||||
<div class="LeftContainer">
|
||||
|
||||
<div id="Reading" class="StdDiv">
|
||||
|
||||
<div id="ReadingDiv">
|
||||
[strReadingText]
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<div class="RightContainer">
|
||||
[/inclReading]
|
||||
|
||||
[inclWordList]
|
||||
<div id="WordsDiv" class="StdDiv">
|
||||
<span id="WordList" class="ClozeWordList">[strWordList]</span>
|
||||
</div>
|
||||
[/inclWordList]
|
||||
|
||||
<div id="MainDiv" class="StdDiv">
|
||||
|
||||
<!-- These top buttons hidden; reveal if required -->
|
||||
<!--
|
||||
<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()"> [strCheckCaption] </button>
|
||||
|
||||
[inclHint]
|
||||
<button class="FuncButton" onmouseover="FuncBtnOver(this)" onfocus="FuncBtnOver(this)" onmouseout="FuncBtnOut(this)" onblur="FuncBtnOut(this)" onmousedown="FuncBtnDown(this)" onmouseup="FuncBtnOut(this)" onclick="ShowHint()"> [strHintCaption] </button>
|
||||
[/inclHint]
|
||||
|
||||
-->
|
||||
|
||||
<div id="ClozeDiv">
|
||||
<form id="Cloze" method="post" action="" onsubmit="return false;">
|
||||
<div class="ClozeBody">
|
||||
[strClozeBody]
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
[inclKeypad]
|
||||
<div class="Keypad">
|
||||
[strKeypad]
|
||||
</div>
|
||||
[/inclKeypad]
|
||||
|
||||
<button id="CheckButton2" class="FuncButton" onmouseover="FuncBtnOver(this)" onfocus="FuncBtnOver(this)" onmouseout="FuncBtnOut(this)" onblur="FuncBtnOut(this)" onmousedown="FuncBtnDown(this)" onmouseup="FuncBtnOut(this)" onclick="CheckAnswers()"> [strCheckCaption] </button>
|
||||
|
||||
[inclHint]
|
||||
<button class="FuncButton" onmouseover="FuncBtnOver(this)" onfocus="FuncBtnOver(this)" onmouseout="FuncBtnOut(this)" onblur="FuncBtnOut(this)" onmousedown="FuncBtnDown(this)" onmouseup="FuncBtnOut(this)" onclick="ShowHint()"> [strHintCaption] </button>
|
||||
[/inclHint]
|
||||
|
||||
</div>
|
||||
|
||||
[inclReading]
|
||||
</div>
|
||||
[/inclReading]
|
||||
|
||||
<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;"> [strOKCaption] </button>
|
||||
</div>
|
||||
|
||||
<!-- BeginBottomNavButtons -->
|
||||
|
||||
[inclNavButtons]
|
||||
[strBottomNavBar]
|
||||
[/inclNavButtons]
|
||||
|
||||
<!-- EndBottomNavButtons -->
|
||||
|
||||
<!-- BeginSubmissionForm -->
|
||||
|
||||
<!-- EndSubmissionForm -->
|
||||
|
||||
</body>
|
||||
|
||||
</html>
|
||||
<?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]
|
||||
|
||||
[strJSJCloze6]
|
||||
|
||||
[inclTimer]
|
||||
[strJSTimer]
|
||||
[/inclTimer]
|
||||
|
||||
[inclSendResults]
|
||||
[strJSSendResults]
|
||||
[/inclSendResults]
|
||||
|
||||
//-->
|
||||
|
||||
//]]>
|
||||
|
||||
</script>
|
||||
|
||||
|
||||
</head>
|
||||
|
||||
<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]
|
||||
[inclTimer]
|
||||
<div id="Timer"><span id="TimerText"> </span></div>
|
||||
[/inclTimer]
|
||||
|
||||
</div>
|
||||
|
||||
<div id="InstructionsDiv" class="StdDiv">
|
||||
<p id="Instructions">[strInstructions]</p>
|
||||
</div>
|
||||
|
||||
[inclReading]
|
||||
<div class="LeftContainer">
|
||||
|
||||
<div id="Reading" class="StdDiv">
|
||||
|
||||
<div id="ReadingDiv">
|
||||
[strReadingText]
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<div class="RightContainer">
|
||||
[/inclReading]
|
||||
|
||||
[inclWordList]
|
||||
<div id="WordsDiv" class="StdDiv">
|
||||
<span id="WordList" class="ClozeWordList">[strWordList]</span>
|
||||
</div>
|
||||
[/inclWordList]
|
||||
|
||||
<div id="MainDiv" class="StdDiv">
|
||||
|
||||
<!-- These top buttons hidden; reveal if required -->
|
||||
<!--
|
||||
<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()"> [strCheckCaption] </button>
|
||||
|
||||
[inclHint]
|
||||
<button class="FuncButton" onmouseover="FuncBtnOver(this)" onfocus="FuncBtnOver(this)" onmouseout="FuncBtnOut(this)" onblur="FuncBtnOut(this)" onmousedown="FuncBtnDown(this)" onmouseup="FuncBtnOut(this)" onclick="ShowHint()"> [strHintCaption] </button>
|
||||
[/inclHint]
|
||||
|
||||
-->
|
||||
|
||||
<div id="ClozeDiv">
|
||||
<form id="Cloze" method="post" action="" onsubmit="return false;">
|
||||
<div class="ClozeBody">
|
||||
[strClozeBody]
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
[inclKeypad]
|
||||
<div class="Keypad">
|
||||
[strKeypad]
|
||||
</div>
|
||||
[/inclKeypad]
|
||||
|
||||
<button id="CheckButton2" class="FuncButton" onmouseover="FuncBtnOver(this)" onfocus="FuncBtnOver(this)" onmouseout="FuncBtnOut(this)" onblur="FuncBtnOut(this)" onmousedown="FuncBtnDown(this)" onmouseup="FuncBtnOut(this)" onclick="CheckAnswers()"> [strCheckCaption] </button>
|
||||
|
||||
[inclHint]
|
||||
<button class="FuncButton" onmouseover="FuncBtnOver(this)" onfocus="FuncBtnOver(this)" onmouseout="FuncBtnOut(this)" onblur="FuncBtnOut(this)" onmousedown="FuncBtnDown(this)" onmouseup="FuncBtnOut(this)" onclick="ShowHint()"> [strHintCaption] </button>
|
||||
[/inclHint]
|
||||
|
||||
</div>
|
||||
|
||||
[inclReading]
|
||||
</div>
|
||||
[/inclReading]
|
||||
|
||||
<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;"> [strOKCaption] </button>
|
||||
</div>
|
||||
|
||||
<!-- BeginBottomNavButtons -->
|
||||
|
||||
[inclNavButtons]
|
||||
[strBottomNavBar]
|
||||
[/inclNavButtons]
|
||||
|
||||
<!-- EndBottomNavButtons -->
|
||||
|
||||
<!-- BeginSubmissionForm -->
|
||||
|
||||
<!-- EndSubmissionForm -->
|
||||
|
||||
</body>
|
||||
|
||||
</html>
|
||||
|
||||
+333
-333
@@ -1,334 +1,334 @@
|
||||
|
||||
//JCLOZE CORE JAVASCRIPT CODE
|
||||
|
||||
function ItemState(){
|
||||
this.ClueGiven = false;
|
||||
this.HintsAndChecks = 0;
|
||||
this.MatchedAnswerLength = 0;
|
||||
this.ItemScore = 0;
|
||||
this.AnsweredCorrectly = false;
|
||||
this.Guesses = new Array();
|
||||
return this;
|
||||
}
|
||||
|
||||
var Feedback = '';
|
||||
var Correct = '[strCorrect]';
|
||||
var Incorrect = '[strIncorrect]';
|
||||
var GiveHint = '[strGiveHint]';
|
||||
var CaseSensitive = [boolCaseSensitive];
|
||||
var YourScoreIs = '[strYourScoreIs]';
|
||||
var Finished = false;
|
||||
var Locked = false;
|
||||
var Score = 0;
|
||||
var CurrentWord = 0;
|
||||
var Guesses = '';
|
||||
var TimeOver = false;
|
||||
|
||||
I = new Array();
|
||||
[strItemArray]
|
||||
|
||||
State = new Array();
|
||||
|
||||
function StartUp(){
|
||||
RemoveBottomNavBarForIE();
|
||||
|
||||
[inclSendResults]
|
||||
GetUserName();
|
||||
[/inclSendResults]
|
||||
|
||||
[inclPreloadImages]
|
||||
PreloadImages([PreloadImageList]);
|
||||
[/inclPreloadImages]
|
||||
|
||||
var i = 0;
|
||||
|
||||
State.length = 0;
|
||||
for (i=0; i<I.length; i++){
|
||||
State[i] = new ItemState();
|
||||
}
|
||||
|
||||
ClearTextBoxes();
|
||||
|
||||
[inclTimer]
|
||||
StartTimer();
|
||||
[/inclTimer]
|
||||
|
||||
}
|
||||
|
||||
function ShowClue(ItemNum){
|
||||
if (Locked == true){return;}
|
||||
State[ItemNum].ClueGiven = true;
|
||||
ShowMessage(I[ItemNum][2]);
|
||||
}
|
||||
|
||||
function SaveCurrentAnswers(){
|
||||
var Ans = ''
|
||||
for (var i=0; i<I.length; i++){
|
||||
Ans = GetGapValue(i);
|
||||
if ((Ans.length > 0)&&(Ans != State[i].Guesses[State[i].Guesses.length-1])){
|
||||
State[i].Guesses[State[i].Guesses.length] = Ans;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function CompileGuesses(){
|
||||
var F = document.getElementById('store');
|
||||
if (F != null){
|
||||
var Temp = '<?xml version="1.0"?><hpnetresult><fields>';
|
||||
var GapLabel = '';
|
||||
for (var i=0; i<State.length; i++){
|
||||
GapLabel = 'Gap ' + (i+1).toString();
|
||||
Temp += '<field><fieldname>' + GapLabel + '</fieldname>';
|
||||
Temp += '<fieldtype>student-responses</fieldtype><fieldlabel>' + GapLabel + '</fieldlabel>';
|
||||
Temp += '<fieldlabelid>JClozeStudentResponses</fieldlabelid><fielddata>';
|
||||
for (var j=0; j<State[i].Guesses.length; j++){
|
||||
if (j>0){Temp += '| ';}
|
||||
Temp += State[i].Guesses[j] + ' ';
|
||||
}
|
||||
Temp += '</fielddata></field>';
|
||||
}
|
||||
Temp += '</fields></hpnetresult>';
|
||||
Detail = Temp;
|
||||
}
|
||||
}
|
||||
|
||||
function CheckAnswers(){
|
||||
if (Locked == true){return;}
|
||||
SaveCurrentAnswers();
|
||||
var AllCorrect = true;
|
||||
|
||||
//Check each answer
|
||||
for (var i = 0; i<I.length; i++){
|
||||
|
||||
if (State[i].AnsweredCorrectly == false){
|
||||
//If it's right, calculate its score
|
||||
if (CheckAnswer(i, true) > -1){
|
||||
var TotalChars = GetGapValue(i).length;
|
||||
State[i].ItemScore = (TotalChars-State[i].HintsAndChecks)/TotalChars;
|
||||
if (State[i].ClueGiven == true){State[i].ItemScore /= 2;}
|
||||
if (State[i].ItemScore <0 ){State[i].ItemScore = 0;}
|
||||
State[i].AnsweredCorrectly = true;
|
||||
//Drop the correct answer into the page, replacing the text box
|
||||
SetCorrectAnswer(i, GetGapValue(i));
|
||||
}
|
||||
else{
|
||||
//Otherwise, increment the hints for this item, as a penalty
|
||||
State[i].HintsAndChecks++;
|
||||
|
||||
//then set the flag
|
||||
AllCorrect = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//Calculate the total score
|
||||
var TotalScore = 0;
|
||||
for (i=0; i<State.length; i++){
|
||||
TotalScore += State[i].ItemScore;
|
||||
}
|
||||
TotalScore = Math.floor((TotalScore * 100)/I.length);
|
||||
|
||||
//Compile the output
|
||||
Output = '';
|
||||
|
||||
if (AllCorrect == true){
|
||||
Output = Correct + '<br />';
|
||||
}
|
||||
|
||||
Output += YourScoreIs + ' ' + TotalScore + '%.<br />';
|
||||
if (AllCorrect == false){
|
||||
Output += '<br />' + Incorrect;
|
||||
}
|
||||
ShowMessage(Output);
|
||||
setTimeout('WriteToInstructions(Output)', 50);
|
||||
|
||||
Score = TotalScore;
|
||||
CompileGuesses();
|
||||
|
||||
if ((AllCorrect == true)||(Finished == true)){
|
||||
[inclSendResults]
|
||||
setTimeout('SendResults(' + TotalScore + ')', 50);
|
||||
[/inclSendResults]
|
||||
[inclTimer]
|
||||
window.clearInterval(Interval);
|
||||
[/inclTimer]
|
||||
TimeOver = true;
|
||||
Locked = true;
|
||||
Finished = true;
|
||||
setTimeout('Finish()', SubmissionTimeout);
|
||||
}
|
||||
}
|
||||
|
||||
function TrackFocus(BoxNumber){
|
||||
CurrentWord = BoxNumber;
|
||||
InTextBox = true;
|
||||
}
|
||||
|
||||
function LeaveGap(){
|
||||
InTextBox = false;
|
||||
}
|
||||
|
||||
function CheckBeginning(Guess, Answer){
|
||||
var OutString = '';
|
||||
var i = 0;
|
||||
var UpperGuess = '';
|
||||
var UpperAnswer = '';
|
||||
|
||||
if (CaseSensitive == false) {
|
||||
UpperGuess = Guess.toUpperCase();
|
||||
UpperAnswer = Answer.toUpperCase();
|
||||
}
|
||||
else {
|
||||
UpperGuess = Guess;
|
||||
UpperAnswer = Answer;
|
||||
}
|
||||
|
||||
while (UpperGuess.charAt(i) == UpperAnswer.charAt(i)) {
|
||||
OutString += Guess.charAt(i);
|
||||
i++;
|
||||
}
|
||||
OutString += Answer.charAt(i);
|
||||
return OutString;
|
||||
}
|
||||
|
||||
function GetGapValue(GNum){
|
||||
var RetVal = '';
|
||||
if ((GNum<0)||(GNum>=I.length)){return RetVal;}
|
||||
if (document.getElementById('Gap' + GNum) != null){
|
||||
RetVal = document.getElementById('Gap' + GNum).value;
|
||||
RetVal = TrimString(RetVal);
|
||||
}
|
||||
else{
|
||||
RetVal = State[GNum].Guesses[State[GNum].Guesses.length-1];
|
||||
}
|
||||
return RetVal;
|
||||
}
|
||||
|
||||
function SetGapValue(GNum, Val){
|
||||
if ((GNum<0)||(GNum>=I.length)){return;}
|
||||
if (document.getElementById('Gap' + GNum) != null){
|
||||
document.getElementById('Gap' + GNum).value = Val;
|
||||
document.getElementById('Gap' + GNum).focus();
|
||||
}
|
||||
}
|
||||
|
||||
function SetCorrectAnswer(GNum, Val){
|
||||
if ((GNum<0)||(GNum>=I.length)){return;}
|
||||
if (document.getElementById('GapSpan' + GNum) != null){
|
||||
document.getElementById('GapSpan' + GNum).innerHTML = Val;
|
||||
}
|
||||
}
|
||||
|
||||
function FindCurrent() {
|
||||
var x = 0;
|
||||
FoundCurrent = -1;
|
||||
|
||||
//Test the current word:
|
||||
//If its state is not set to already correct, check the word.
|
||||
if (State[CurrentWord].AnsweredCorrectly == false){
|
||||
if (CheckAnswer(CurrentWord, false) < 0){
|
||||
return CurrentWord;
|
||||
}
|
||||
}
|
||||
|
||||
x=CurrentWord + 1;
|
||||
while (x<I.length){
|
||||
if (State[x].AnsweredCorrectly == false){
|
||||
if (CheckAnswer(x, false) < 0){
|
||||
return x;
|
||||
}
|
||||
}
|
||||
x++;
|
||||
}
|
||||
|
||||
x = 0;
|
||||
while (x<CurrentWord){
|
||||
if (State[x].AnsweredCorrectly == false){
|
||||
if (CheckAnswer(x, false) < 0){
|
||||
return x;
|
||||
}
|
||||
}
|
||||
x++;
|
||||
}
|
||||
return FoundCurrent;
|
||||
}
|
||||
|
||||
function CheckAnswer(GapNum, MarkAnswer){
|
||||
var Guess = GetGapValue(GapNum);
|
||||
var UpperGuess = '';
|
||||
var UpperAnswer = '';
|
||||
if (CaseSensitive == false){
|
||||
UpperGuess = Guess.toUpperCase();
|
||||
}
|
||||
else{
|
||||
UpperGuess = Guess;
|
||||
}
|
||||
var Match = -1;
|
||||
for (var i = 0; i<I[GapNum][1].length; i++){
|
||||
if (CaseSensitive == false){
|
||||
UpperAnswer = I[GapNum][1][i][0].toUpperCase();
|
||||
}
|
||||
else{
|
||||
UpperAnswer = I[GapNum][1][i][0];
|
||||
}
|
||||
if (TrimString(UpperGuess) == UpperAnswer){
|
||||
Match = i;
|
||||
if (MarkAnswer == true){
|
||||
State[GapNum].AnsweredCorrectly = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return Match;
|
||||
}
|
||||
|
||||
function GetHint(GapNum){
|
||||
Guess = GetGapValue(GapNum);
|
||||
|
||||
if (CheckAnswer(GapNum, false) > -1){return ''}
|
||||
RightBits = new Array();
|
||||
for (var i=0; i<I[GapNum][1].length; i++){
|
||||
RightBits[i] = CheckBeginning(Guess, I[GapNum][1][i][0]);
|
||||
}
|
||||
var RightOne = FindLongest(RightBits);
|
||||
var Result = I[GapNum][1][RightOne][0].substring(0,RightBits[RightOne].length);
|
||||
//Add another char if the last one is a space
|
||||
if (Result.charAt(Result.length-1) == ' '){
|
||||
Result = I[GapNum][1][RightOne][0].substring(0,RightBits[RightOne].length+1);
|
||||
}
|
||||
return Result;
|
||||
}
|
||||
|
||||
function ShowHint(){
|
||||
if (Locked == true){return;}
|
||||
var CurrGap = FindCurrent();
|
||||
if (CurrGap < 0){return;}
|
||||
|
||||
var HintString = GetHint(CurrGap);
|
||||
|
||||
if (HintString.length > 0){
|
||||
SetGapValue(CurrGap, HintString);
|
||||
State[CurrGap].HintsAndChecks += 1;
|
||||
}
|
||||
ShowMessage(GiveHint);
|
||||
}
|
||||
|
||||
function TypeChars(Chars){
|
||||
var CurrGap = FindCurrent();
|
||||
if (CurrGap < 0){return;}
|
||||
if (document.getElementById('Gap' + CurrGap) != null){
|
||||
SetGapValue(CurrGap, document.getElementById('Gap' + CurrGap).value + Chars);
|
||||
}
|
||||
}
|
||||
|
||||
[inclTimer]
|
||||
function TimesUp() {
|
||||
document.getElementById('Timer').innerHTML = '[strTimesUp]';
|
||||
[inclPreloadImages]
|
||||
RefreshImages();
|
||||
[/inclPreloadImages]
|
||||
TimeOver = true;
|
||||
Finished = true;
|
||||
CheckAnswers();
|
||||
Locked = true;
|
||||
}
|
||||
|
||||
//JCLOZE CORE JAVASCRIPT CODE
|
||||
|
||||
function ItemState(){
|
||||
this.ClueGiven = false;
|
||||
this.HintsAndChecks = 0;
|
||||
this.MatchedAnswerLength = 0;
|
||||
this.ItemScore = 0;
|
||||
this.AnsweredCorrectly = false;
|
||||
this.Guesses = new Array();
|
||||
return this;
|
||||
}
|
||||
|
||||
var Feedback = '';
|
||||
var Correct = '[strCorrect]';
|
||||
var Incorrect = '[strIncorrect]';
|
||||
var GiveHint = '[strGiveHint]';
|
||||
var CaseSensitive = [boolCaseSensitive];
|
||||
var YourScoreIs = '[strYourScoreIs]';
|
||||
var Finished = false;
|
||||
var Locked = false;
|
||||
var Score = 0;
|
||||
var CurrentWord = 0;
|
||||
var Guesses = '';
|
||||
var TimeOver = false;
|
||||
|
||||
I = new Array();
|
||||
[strItemArray]
|
||||
|
||||
State = new Array();
|
||||
|
||||
function StartUp(){
|
||||
RemoveBottomNavBarForIE();
|
||||
|
||||
[inclSendResults]
|
||||
GetUserName();
|
||||
[/inclSendResults]
|
||||
|
||||
[inclPreloadImages]
|
||||
PreloadImages([PreloadImageList]);
|
||||
[/inclPreloadImages]
|
||||
|
||||
var i = 0;
|
||||
|
||||
State.length = 0;
|
||||
for (i=0; i<I.length; i++){
|
||||
State[i] = new ItemState();
|
||||
}
|
||||
|
||||
ClearTextBoxes();
|
||||
|
||||
[inclTimer]
|
||||
StartTimer();
|
||||
[/inclTimer]
|
||||
|
||||
}
|
||||
|
||||
function ShowClue(ItemNum){
|
||||
if (Locked == true){return;}
|
||||
State[ItemNum].ClueGiven = true;
|
||||
ShowMessage(I[ItemNum][2]);
|
||||
}
|
||||
|
||||
function SaveCurrentAnswers(){
|
||||
var Ans = ''
|
||||
for (var i=0; i<I.length; i++){
|
||||
Ans = GetGapValue(i);
|
||||
if ((Ans.length > 0)&&(Ans != State[i].Guesses[State[i].Guesses.length-1])){
|
||||
State[i].Guesses[State[i].Guesses.length] = Ans;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function CompileGuesses(){
|
||||
var F = document.getElementById('store');
|
||||
if (F != null){
|
||||
var Temp = '<?xml version="1.0"?><hpnetresult><fields>';
|
||||
var GapLabel = '';
|
||||
for (var i=0; i<State.length; i++){
|
||||
GapLabel = 'Gap ' + (i+1).toString();
|
||||
Temp += '<field><fieldname>' + GapLabel + '</fieldname>';
|
||||
Temp += '<fieldtype>student-responses</fieldtype><fieldlabel>' + GapLabel + '</fieldlabel>';
|
||||
Temp += '<fieldlabelid>JClozeStudentResponses</fieldlabelid><fielddata>';
|
||||
for (var j=0; j<State[i].Guesses.length; j++){
|
||||
if (j>0){Temp += '| ';}
|
||||
Temp += State[i].Guesses[j] + ' ';
|
||||
}
|
||||
Temp += '</fielddata></field>';
|
||||
}
|
||||
Temp += '</fields></hpnetresult>';
|
||||
Detail = Temp;
|
||||
}
|
||||
}
|
||||
|
||||
function CheckAnswers(){
|
||||
if (Locked == true){return;}
|
||||
SaveCurrentAnswers();
|
||||
var AllCorrect = true;
|
||||
|
||||
//Check each answer
|
||||
for (var i = 0; i<I.length; i++){
|
||||
|
||||
if (State[i].AnsweredCorrectly == false){
|
||||
//If it's right, calculate its score
|
||||
if (CheckAnswer(i, true) > -1){
|
||||
var TotalChars = GetGapValue(i).length;
|
||||
State[i].ItemScore = (TotalChars-State[i].HintsAndChecks)/TotalChars;
|
||||
if (State[i].ClueGiven == true){State[i].ItemScore /= 2;}
|
||||
if (State[i].ItemScore <0 ){State[i].ItemScore = 0;}
|
||||
State[i].AnsweredCorrectly = true;
|
||||
//Drop the correct answer into the page, replacing the text box
|
||||
SetCorrectAnswer(i, GetGapValue(i));
|
||||
}
|
||||
else{
|
||||
//Otherwise, increment the hints for this item, as a penalty
|
||||
State[i].HintsAndChecks++;
|
||||
|
||||
//then set the flag
|
||||
AllCorrect = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//Calculate the total score
|
||||
var TotalScore = 0;
|
||||
for (i=0; i<State.length; i++){
|
||||
TotalScore += State[i].ItemScore;
|
||||
}
|
||||
TotalScore = Math.floor((TotalScore * 100)/I.length);
|
||||
|
||||
//Compile the output
|
||||
Output = '';
|
||||
|
||||
if (AllCorrect == true){
|
||||
Output = Correct + '<br />';
|
||||
}
|
||||
|
||||
Output += YourScoreIs + ' ' + TotalScore + '%.<br />';
|
||||
if (AllCorrect == false){
|
||||
Output += '<br />' + Incorrect;
|
||||
}
|
||||
ShowMessage(Output);
|
||||
setTimeout('WriteToInstructions(Output)', 50);
|
||||
|
||||
Score = TotalScore;
|
||||
CompileGuesses();
|
||||
|
||||
if ((AllCorrect == true)||(Finished == true)){
|
||||
[inclSendResults]
|
||||
setTimeout('SendResults(' + TotalScore + ')', 50);
|
||||
[/inclSendResults]
|
||||
[inclTimer]
|
||||
window.clearInterval(Interval);
|
||||
[/inclTimer]
|
||||
TimeOver = true;
|
||||
Locked = true;
|
||||
Finished = true;
|
||||
setTimeout('Finish()', SubmissionTimeout);
|
||||
}
|
||||
}
|
||||
|
||||
function TrackFocus(BoxNumber){
|
||||
CurrentWord = BoxNumber;
|
||||
InTextBox = true;
|
||||
}
|
||||
|
||||
function LeaveGap(){
|
||||
InTextBox = false;
|
||||
}
|
||||
|
||||
function CheckBeginning(Guess, Answer){
|
||||
var OutString = '';
|
||||
var i = 0;
|
||||
var UpperGuess = '';
|
||||
var UpperAnswer = '';
|
||||
|
||||
if (CaseSensitive == false) {
|
||||
UpperGuess = Guess.toUpperCase();
|
||||
UpperAnswer = Answer.toUpperCase();
|
||||
}
|
||||
else {
|
||||
UpperGuess = Guess;
|
||||
UpperAnswer = Answer;
|
||||
}
|
||||
|
||||
while (UpperGuess.charAt(i) == UpperAnswer.charAt(i)) {
|
||||
OutString += Guess.charAt(i);
|
||||
i++;
|
||||
}
|
||||
OutString += Answer.charAt(i);
|
||||
return OutString;
|
||||
}
|
||||
|
||||
function GetGapValue(GNum){
|
||||
var RetVal = '';
|
||||
if ((GNum<0)||(GNum>=I.length)){return RetVal;}
|
||||
if (document.getElementById('Gap' + GNum) != null){
|
||||
RetVal = document.getElementById('Gap' + GNum).value;
|
||||
RetVal = TrimString(RetVal);
|
||||
}
|
||||
else{
|
||||
RetVal = State[GNum].Guesses[State[GNum].Guesses.length-1];
|
||||
}
|
||||
return RetVal;
|
||||
}
|
||||
|
||||
function SetGapValue(GNum, Val){
|
||||
if ((GNum<0)||(GNum>=I.length)){return;}
|
||||
if (document.getElementById('Gap' + GNum) != null){
|
||||
document.getElementById('Gap' + GNum).value = Val;
|
||||
document.getElementById('Gap' + GNum).focus();
|
||||
}
|
||||
}
|
||||
|
||||
function SetCorrectAnswer(GNum, Val){
|
||||
if ((GNum<0)||(GNum>=I.length)){return;}
|
||||
if (document.getElementById('GapSpan' + GNum) != null){
|
||||
document.getElementById('GapSpan' + GNum).innerHTML = Val;
|
||||
}
|
||||
}
|
||||
|
||||
function FindCurrent() {
|
||||
var x = 0;
|
||||
FoundCurrent = -1;
|
||||
|
||||
//Test the current word:
|
||||
//If its state is not set to already correct, check the word.
|
||||
if (State[CurrentWord].AnsweredCorrectly == false){
|
||||
if (CheckAnswer(CurrentWord, false) < 0){
|
||||
return CurrentWord;
|
||||
}
|
||||
}
|
||||
|
||||
x=CurrentWord + 1;
|
||||
while (x<I.length){
|
||||
if (State[x].AnsweredCorrectly == false){
|
||||
if (CheckAnswer(x, false) < 0){
|
||||
return x;
|
||||
}
|
||||
}
|
||||
x++;
|
||||
}
|
||||
|
||||
x = 0;
|
||||
while (x<CurrentWord){
|
||||
if (State[x].AnsweredCorrectly == false){
|
||||
if (CheckAnswer(x, false) < 0){
|
||||
return x;
|
||||
}
|
||||
}
|
||||
x++;
|
||||
}
|
||||
return FoundCurrent;
|
||||
}
|
||||
|
||||
function CheckAnswer(GapNum, MarkAnswer){
|
||||
var Guess = GetGapValue(GapNum);
|
||||
var UpperGuess = '';
|
||||
var UpperAnswer = '';
|
||||
if (CaseSensitive == false){
|
||||
UpperGuess = Guess.toUpperCase();
|
||||
}
|
||||
else{
|
||||
UpperGuess = Guess;
|
||||
}
|
||||
var Match = -1;
|
||||
for (var i = 0; i<I[GapNum][1].length; i++){
|
||||
if (CaseSensitive == false){
|
||||
UpperAnswer = I[GapNum][1][i][0].toUpperCase();
|
||||
}
|
||||
else{
|
||||
UpperAnswer = I[GapNum][1][i][0];
|
||||
}
|
||||
if (TrimString(UpperGuess) == UpperAnswer){
|
||||
Match = i;
|
||||
if (MarkAnswer == true){
|
||||
State[GapNum].AnsweredCorrectly = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return Match;
|
||||
}
|
||||
|
||||
function GetHint(GapNum){
|
||||
Guess = GetGapValue(GapNum);
|
||||
|
||||
if (CheckAnswer(GapNum, false) > -1){return ''}
|
||||
RightBits = new Array();
|
||||
for (var i=0; i<I[GapNum][1].length; i++){
|
||||
RightBits[i] = CheckBeginning(Guess, I[GapNum][1][i][0]);
|
||||
}
|
||||
var RightOne = FindLongest(RightBits);
|
||||
var Result = I[GapNum][1][RightOne][0].substring(0,RightBits[RightOne].length);
|
||||
//Add another char if the last one is a space
|
||||
if (Result.charAt(Result.length-1) == ' '){
|
||||
Result = I[GapNum][1][RightOne][0].substring(0,RightBits[RightOne].length+1);
|
||||
}
|
||||
return Result;
|
||||
}
|
||||
|
||||
function ShowHint(){
|
||||
if (Locked == true){return;}
|
||||
var CurrGap = FindCurrent();
|
||||
if (CurrGap < 0){return;}
|
||||
|
||||
var HintString = GetHint(CurrGap);
|
||||
|
||||
if (HintString.length > 0){
|
||||
SetGapValue(CurrGap, HintString);
|
||||
State[CurrGap].HintsAndChecks += 1;
|
||||
}
|
||||
ShowMessage(GiveHint);
|
||||
}
|
||||
|
||||
function TypeChars(Chars){
|
||||
var CurrGap = FindCurrent();
|
||||
if (CurrGap < 0){return;}
|
||||
if (document.getElementById('Gap' + CurrGap) != null){
|
||||
SetGapValue(CurrGap, document.getElementById('Gap' + CurrGap).value + Chars);
|
||||
}
|
||||
}
|
||||
|
||||
[inclTimer]
|
||||
function TimesUp() {
|
||||
document.getElementById('Timer').innerHTML = '[strTimesUp]';
|
||||
[inclPreloadImages]
|
||||
RefreshImages();
|
||||
[/inclPreloadImages]
|
||||
TimeOver = true;
|
||||
Finished = true;
|
||||
CheckAnswers();
|
||||
Locked = true;
|
||||
}
|
||||
[/inclTimer]
|
||||
+187
-187
@@ -1,187 +1,187 @@
|
||||
<?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]
|
||||
|
||||
[strJSJCross6]
|
||||
|
||||
[inclTimer]
|
||||
[strJSTimer]
|
||||
[/inclTimer]
|
||||
|
||||
[inclSendResults]
|
||||
[strJSSendResults]
|
||||
[/inclSendResults]
|
||||
|
||||
//-->
|
||||
|
||||
//]]>
|
||||
|
||||
</script>
|
||||
|
||||
|
||||
</head>
|
||||
|
||||
<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]
|
||||
[inclTimer]
|
||||
<div id="Timer"><span id="TimerText"> </span></div>
|
||||
[/inclTimer]
|
||||
|
||||
</div>
|
||||
|
||||
<div id="InstructionsDiv" class="StdDiv">
|
||||
<p id="Instructions">[strInstructions]</p>
|
||||
</div>
|
||||
|
||||
[inclReading]
|
||||
<div class="LeftContainer">
|
||||
|
||||
<div id="Reading" class="StdDiv">
|
||||
|
||||
<div id="ReadingDiv">
|
||||
[strReadingText]
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<div class="RightContainer">
|
||||
[/inclReading]
|
||||
|
||||
<div id="MainDiv" class="StdDiv">
|
||||
|
||||
[inclKeypad]
|
||||
<div class="Keypad" style="float: left;">
|
||||
[strKeypad]
|
||||
</div>
|
||||
[/inclKeypad]
|
||||
|
||||
<div id="ClueEntry">
|
||||
|
||||
</div>
|
||||
|
||||
<!-- This top button is hidden; uncomment it to reveal it. -->
|
||||
<!--
|
||||
<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()"> [strCheckCaption] </button>
|
||||
|
||||
-->
|
||||
|
||||
<table class="CrosswordGrid">
|
||||
<tbody>
|
||||
|
||||
[strGridBody]
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<button id="CheckButton2" class="FuncButton" onmouseover="FuncBtnOver(this)" onfocus="FuncBtnOver(this)" onmouseout="FuncBtnOut(this)" onblur="FuncBtnOut(this)" onmousedown="FuncBtnDown(this)" onmouseup="FuncBtnOut(this)" onclick="CheckAnswers()"> [strCheckCaption] </button>
|
||||
|
||||
<table id="Clues"[ShowHideClueList]>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>
|
||||
|
||||
<table class="ClueList">
|
||||
<tbody id="CluesAcross">
|
||||
<tr><td colspan="2"><h3 class="ExerciseSubtitle" id="CluesAcrossLabel">[strCluesAcrossLabel]</h3></td></tr>
|
||||
|
||||
[strCluesAcross]
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
</td>
|
||||
|
||||
<td>
|
||||
|
||||
<table class="ClueList">
|
||||
<tbody id="CluesDown">
|
||||
<tr><td colspan="2"><h3 class="ExerciseSubtitle" id="CluesDownLabel">[strCluesDownLabel]</h3></td></tr>
|
||||
|
||||
[strCluesDown]
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
</div>
|
||||
|
||||
[inclReading]
|
||||
</div>
|
||||
[/inclReading]
|
||||
|
||||
<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;"> [strOKCaption] </button>
|
||||
</div>
|
||||
|
||||
<!-- BeginBottomNavButtons -->
|
||||
|
||||
[inclNavButtons]
|
||||
[strBottomNavBar]
|
||||
[/inclNavButtons]
|
||||
|
||||
<!-- EndBottomNavButtons -->
|
||||
|
||||
<!-- BeginSubmissionForm -->
|
||||
|
||||
<!-- EndSubmissionForm -->
|
||||
|
||||
</body>
|
||||
|
||||
</html>
|
||||
<?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]
|
||||
|
||||
[strJSJCross6]
|
||||
|
||||
[inclTimer]
|
||||
[strJSTimer]
|
||||
[/inclTimer]
|
||||
|
||||
[inclSendResults]
|
||||
[strJSSendResults]
|
||||
[/inclSendResults]
|
||||
|
||||
//-->
|
||||
|
||||
//]]>
|
||||
|
||||
</script>
|
||||
|
||||
|
||||
</head>
|
||||
|
||||
<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]
|
||||
[inclTimer]
|
||||
<div id="Timer"><span id="TimerText"> </span></div>
|
||||
[/inclTimer]
|
||||
|
||||
</div>
|
||||
|
||||
<div id="InstructionsDiv" class="StdDiv">
|
||||
<p id="Instructions">[strInstructions]</p>
|
||||
</div>
|
||||
|
||||
[inclReading]
|
||||
<div class="LeftContainer">
|
||||
|
||||
<div id="Reading" class="StdDiv">
|
||||
|
||||
<div id="ReadingDiv">
|
||||
[strReadingText]
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<div class="RightContainer">
|
||||
[/inclReading]
|
||||
|
||||
<div id="MainDiv" class="StdDiv">
|
||||
|
||||
[inclKeypad]
|
||||
<div class="Keypad" style="float: left;">
|
||||
[strKeypad]
|
||||
</div>
|
||||
[/inclKeypad]
|
||||
|
||||
<div id="ClueEntry">
|
||||
|
||||
</div>
|
||||
|
||||
<!-- This top button is hidden; uncomment it to reveal it. -->
|
||||
<!--
|
||||
<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()"> [strCheckCaption] </button>
|
||||
|
||||
-->
|
||||
|
||||
<table class="CrosswordGrid">
|
||||
<tbody>
|
||||
|
||||
[strGridBody]
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<button id="CheckButton2" class="FuncButton" onmouseover="FuncBtnOver(this)" onfocus="FuncBtnOver(this)" onmouseout="FuncBtnOut(this)" onblur="FuncBtnOut(this)" onmousedown="FuncBtnDown(this)" onmouseup="FuncBtnOut(this)" onclick="CheckAnswers()"> [strCheckCaption] </button>
|
||||
|
||||
<table id="Clues"[ShowHideClueList]>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>
|
||||
|
||||
<table class="ClueList">
|
||||
<tbody id="CluesAcross">
|
||||
<tr><td colspan="2"><h3 class="ExerciseSubtitle" id="CluesAcrossLabel">[strCluesAcrossLabel]</h3></td></tr>
|
||||
|
||||
[strCluesAcross]
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
</td>
|
||||
|
||||
<td>
|
||||
|
||||
<table class="ClueList">
|
||||
<tbody id="CluesDown">
|
||||
<tr><td colspan="2"><h3 class="ExerciseSubtitle" id="CluesDownLabel">[strCluesDownLabel]</h3></td></tr>
|
||||
|
||||
[strCluesDown]
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
</div>
|
||||
|
||||
[inclReading]
|
||||
</div>
|
||||
[/inclReading]
|
||||
|
||||
<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;"> [strOKCaption] </button>
|
||||
</div>
|
||||
|
||||
<!-- BeginBottomNavButtons -->
|
||||
|
||||
[inclNavButtons]
|
||||
[strBottomNavBar]
|
||||
[/inclNavButtons]
|
||||
|
||||
<!-- EndBottomNavButtons -->
|
||||
|
||||
<!-- BeginSubmissionForm -->
|
||||
|
||||
<!-- EndSubmissionForm -->
|
||||
|
||||
</body>
|
||||
|
||||
</html>
|
||||
|
||||
+296
-296
@@ -1,297 +1,297 @@
|
||||
|
||||
//JCROSS CORE JAVASCRIPT CODE
|
||||
|
||||
var InGap = false;
|
||||
var CurrentBox = null;
|
||||
var Feedback = '';
|
||||
var AcrossCaption = '';
|
||||
var DownCaption = '';
|
||||
var Correct = '[strCorrect]';
|
||||
var Incorrect = '[strIncorrect]';
|
||||
var GiveHint = '[strGiveHint]';
|
||||
var YourScoreIs = '[strYourScoreIs]';
|
||||
var BuiltGrid = '';
|
||||
var BuiltExercise = '';
|
||||
var Penalties = 0;
|
||||
var Score = 0;
|
||||
var InTextBox = false;
|
||||
var Locked = false;
|
||||
var TimeOver = false;
|
||||
|
||||
var InputStuff = '<form method="post" action="" onsubmit="return false;"><span class="ClueNum">[strClueNum]: </span>';
|
||||
InputStuff += '[strClue] <input onfocus="CurrentBox=this;InTextBox=true;" onblur="InTextBox=false;" id="[strBoxId]" type="edit" size="[strEditSize]" maxlength="[strMaxLength]"></input>';
|
||||
InputStuff += '<button class="FuncButton" onfocus="FuncBtnOver(this)" onblur="FuncBtnOut(this)" onmouseover="FuncBtnOver(this)" onmouseout="FuncBtnOut(this)" onmousedown="FuncBtnDown(this)" onmouseup="FuncBtnOut(this)" onclick="EnterGuess([strParams])">[strEnterCaption]</button>';
|
||||
InputStuff += '[inclHint]<button class="FuncButton" onfocus="FuncBtnOver(this)" onblur="FuncBtnOut(this)" onmouseover="FuncBtnOver(this)" onmouseout="FuncBtnOut(this)" onmousedown="FuncBtnDown(this)" onmouseup="FuncBtnOut(this)" onclick="ShowHint([strParams])">[strHintCaption]</button>[/inclHint]';
|
||||
InputStuff += '</form>';
|
||||
|
||||
var CurrBoxElement = null;
|
||||
var Finished = false;
|
||||
|
||||
function StartUp(){
|
||||
RemoveBottomNavBarForIE();
|
||||
AcrossCaption = document.getElementById('CluesAcrossLabel').innerHTML;
|
||||
DownCaption = document.getElementById('CluesDownLabel').innerHTML;
|
||||
[inclSendResults]
|
||||
GetUserName();
|
||||
[/inclSendResults]
|
||||
|
||||
[inclPreloadImages]
|
||||
PreloadImages([PreloadImageList]);
|
||||
[/inclPreloadImages]
|
||||
|
||||
[inclTimer]
|
||||
StartTimer();
|
||||
[/inclTimer]
|
||||
|
||||
}
|
||||
|
||||
function GetAnswerLength(Across,x,y){
|
||||
Result = 0;
|
||||
if (Across == false){
|
||||
while ((x<L.length)&&(L[x][y].length > 0)){
|
||||
Result += L[x][y].length;
|
||||
x++;
|
||||
}
|
||||
return Result;
|
||||
}
|
||||
else{
|
||||
while ((y<L[x].length)&&(L[x][y].length > 0)){
|
||||
Result += L[x][y].length;
|
||||
y++;
|
||||
}
|
||||
return Result;
|
||||
}
|
||||
}
|
||||
|
||||
function GetEditSize(Across,x,y){
|
||||
var Len = GetAnswerLength(Across,x,y);
|
||||
if (IsCJK(L[x][y].charCodeAt(0))){
|
||||
Len *= 2;
|
||||
}
|
||||
return Len;
|
||||
}
|
||||
|
||||
function ShowClue(ClueNum,x,y){
|
||||
var Result = '';
|
||||
var Temp;
|
||||
var strParams;
|
||||
var Clue = document.getElementById('Clue_A_' + ClueNum);
|
||||
if (Clue != null){
|
||||
Temp = InputStuff.replace(/\[ClueNum\]/g, ClueNum);
|
||||
Temp = Temp.replace(/\[strClueNum\]/g, AcrossCaption + ' ' + ClueNum);
|
||||
strParams = 'true,' + ClueNum + ',' + x + ',' + y + ',\'[strBoxId]\'';
|
||||
Temp = Temp.replace(/\[strParams\]/g, strParams);
|
||||
Temp = Temp.replace(/\[strBoxId\]/g, 'GA_' + ClueNum + '_' + x + '_' + y);
|
||||
Temp = Temp.replace(/\[strEditSize\]/g, GetEditSize(true,x,y));
|
||||
Temp = Temp.replace(/\[strMaxLength\]/g, GetAnswerLength(true,x,y));
|
||||
Temp = Temp.replace(/\[strClue\]/g, Clue.innerHTML, Temp);
|
||||
Result += Temp;
|
||||
}
|
||||
Clue = document.getElementById('Clue_D_' + ClueNum);
|
||||
if (Clue != null){
|
||||
Temp = InputStuff.replace(/\[ClueNum\]/g, ClueNum);
|
||||
Temp = Temp.replace(/\[strClueNum\]/g, DownCaption + ' ' + ClueNum);
|
||||
strParams = 'false,' + ClueNum + ',' + x + ',' + y + ',\'[strBoxId]\'';
|
||||
Temp = Temp.replace(/\[strParams\]/g, strParams);
|
||||
Temp = Temp.replace(/\[strBoxId\]/g, 'GD_' + ClueNum + '_' + x + '_' + y);
|
||||
Temp = Temp.replace(/\[strEditSize\]/g, GetAnswerLength(false,x,y));
|
||||
Temp = Temp.replace(/\[strClue\]/g, Clue.innerHTML, Temp);
|
||||
Result += Temp;
|
||||
}
|
||||
document.getElementById('ClueEntry').innerHTML = Result;
|
||||
}
|
||||
|
||||
function EnterGuess(Across,ClueNum,x,y,BoxId){
|
||||
if (document.getElementById(BoxId) != null){
|
||||
var Guess = document.getElementById(BoxId).value;
|
||||
var AnsLength = GetAnswerLength(Across,x,y);
|
||||
EnterAnswer(Guess,Across,AnsLength,x,y);
|
||||
}
|
||||
}
|
||||
|
||||
function SplitStringToPerceivedChars(InString, PC){
|
||||
var Temp = InString.charAt(0);
|
||||
if (InString.length > 1){
|
||||
for (var i=1; i<InString.length; i++){
|
||||
if (IsCombiningDiacritic(InString.charCodeAt(i)) == true){
|
||||
Temp += InString.charAt(i);
|
||||
}
|
||||
else{
|
||||
PC.push(Temp);
|
||||
Temp = InString.charAt(i);
|
||||
}
|
||||
}
|
||||
}
|
||||
PC.push(Temp);
|
||||
}
|
||||
|
||||
function EnterAnswer(Guess,Across,AnsLength,x,y){
|
||||
Guess = Guess.toUpperCase();
|
||||
|
||||
var PC = new Array();
|
||||
SplitStringToPerceivedChars(Guess, PC);
|
||||
|
||||
var i=x;
|
||||
var j=y;
|
||||
var Letter = 0;
|
||||
while (Letter < AnsLength){
|
||||
if (Letter < PC.length){
|
||||
G[i][j] = PC[Letter];
|
||||
if (document.getElementById('L_' + i + '_' + j) != null){
|
||||
document.getElementById('L_' + i + '_' + j).innerHTML = PC[Letter];
|
||||
}
|
||||
}
|
||||
if (Across == true){
|
||||
j++;
|
||||
}
|
||||
else{
|
||||
i++;
|
||||
}
|
||||
Letter++;
|
||||
}
|
||||
}
|
||||
|
||||
function SetGridSquareValue(x,y,Val){
|
||||
var GridId = 'L_' + x + '_' + y;
|
||||
if (document.getElementById(GridId) != null){
|
||||
document.getElementById(GridId).innerHTML = Val;
|
||||
}
|
||||
}
|
||||
|
||||
function ShowHint(Across,ClueNum,x,y,BoxId){
|
||||
var i=x;
|
||||
var j=y;
|
||||
var OutString = '';
|
||||
if (Across==true){
|
||||
while (j<L[i].length){
|
||||
if (L[i][j] != ''){
|
||||
OutString += L[i][j];
|
||||
if (G[i][j] != L[i][j]){
|
||||
G[i][j] = L[i][j];
|
||||
Penalties++;
|
||||
break;
|
||||
}
|
||||
}
|
||||
else{
|
||||
break;
|
||||
}
|
||||
j++;
|
||||
}
|
||||
}
|
||||
else{
|
||||
while (i<L.length){
|
||||
if (L[i][j] != ''){
|
||||
OutString += L[i][j];
|
||||
if (G[i][j] != L[i][j]){
|
||||
G[i][j] = L[i][j];
|
||||
Penalties++;
|
||||
break;
|
||||
}
|
||||
}
|
||||
else{
|
||||
break;
|
||||
}
|
||||
i++;
|
||||
}
|
||||
}
|
||||
if (document.getElementById(BoxId) != null){
|
||||
document.getElementById(BoxId).value = OutString;
|
||||
}
|
||||
}
|
||||
|
||||
L = new Array();
|
||||
[strLetterArray]
|
||||
|
||||
CL = new Array();
|
||||
[strClueNumArray]
|
||||
|
||||
G = new Array();
|
||||
[strGuessArray]
|
||||
|
||||
function CheckAnswers(){
|
||||
if (Locked == true){return;}
|
||||
|
||||
var AllCorrect = true;
|
||||
var TotLetters = 0;
|
||||
var CorrectLetters = 0;
|
||||
|
||||
//Check each letter
|
||||
for (var i=0; i<L.length; i++){
|
||||
for (var j=0; j<L[i].length; j++){
|
||||
if (L[i][j] != ''){
|
||||
TotLetters++;
|
||||
if (G[i][j] != L[i][j]){
|
||||
G[i][j] = '';
|
||||
//Blank that square in the grid
|
||||
SetGridSquareValue(i,j,'');
|
||||
AllCorrect = false;
|
||||
}
|
||||
else{
|
||||
CorrectLetters++;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Score = Math.floor(((CorrectLetters-Penalties) * 100)/TotLetters);
|
||||
if (Score < 0){Score = 0;}
|
||||
|
||||
//Compile the output
|
||||
var Output = '';
|
||||
|
||||
if (AllCorrect == true){
|
||||
Output = Correct + '<br />';
|
||||
}
|
||||
|
||||
Output += YourScoreIs + ' ' + Score + '%.<br />';
|
||||
if (AllCorrect == false){
|
||||
Output += Incorrect;
|
||||
Penalties++;
|
||||
}
|
||||
|
||||
ShowMessage(Output);
|
||||
WriteToInstructions(Output);
|
||||
|
||||
if ((AllCorrect == true)||(TimeOver == true)){
|
||||
[inclSendResults]
|
||||
setTimeout('SendResults(' + Score + ')', 50);
|
||||
[/inclSendResults]
|
||||
[inclTimer]
|
||||
window.clearInterval(Interval);
|
||||
[/inclTimer]
|
||||
TimeOver = true;
|
||||
Locked = true;
|
||||
Finished = true;
|
||||
setTimeout('Finish()', SubmissionTimeout);
|
||||
}
|
||||
}
|
||||
|
||||
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.submit();
|
||||
}
|
||||
}
|
||||
|
||||
function TypeChars(Chars){
|
||||
if (CurrentBox != null){
|
||||
CurrentBox.value += Chars;
|
||||
}
|
||||
}
|
||||
|
||||
[inclTimer]
|
||||
function TimesUp() {
|
||||
document.getElementById('Timer').innerHTML = '[strTimesUp]';
|
||||
[inclPreloadImages]
|
||||
RefreshImages();
|
||||
[/inclPreloadImages]
|
||||
TimeOver = true;
|
||||
Finished = true;
|
||||
CheckAnswers();
|
||||
Locked = true;
|
||||
}
|
||||
|
||||
//JCROSS CORE JAVASCRIPT CODE
|
||||
|
||||
var InGap = false;
|
||||
var CurrentBox = null;
|
||||
var Feedback = '';
|
||||
var AcrossCaption = '';
|
||||
var DownCaption = '';
|
||||
var Correct = '[strCorrect]';
|
||||
var Incorrect = '[strIncorrect]';
|
||||
var GiveHint = '[strGiveHint]';
|
||||
var YourScoreIs = '[strYourScoreIs]';
|
||||
var BuiltGrid = '';
|
||||
var BuiltExercise = '';
|
||||
var Penalties = 0;
|
||||
var Score = 0;
|
||||
var InTextBox = false;
|
||||
var Locked = false;
|
||||
var TimeOver = false;
|
||||
|
||||
var InputStuff = '<form method="post" action="" onsubmit="return false;"><span class="ClueNum">[strClueNum]: </span>';
|
||||
InputStuff += '[strClue] <input onfocus="CurrentBox=this;InTextBox=true;" onblur="InTextBox=false;" id="[strBoxId]" type="edit" size="[strEditSize]" maxlength="[strMaxLength]"></input>';
|
||||
InputStuff += '<button class="FuncButton" onfocus="FuncBtnOver(this)" onblur="FuncBtnOut(this)" onmouseover="FuncBtnOver(this)" onmouseout="FuncBtnOut(this)" onmousedown="FuncBtnDown(this)" onmouseup="FuncBtnOut(this)" onclick="EnterGuess([strParams])">[strEnterCaption]</button>';
|
||||
InputStuff += '[inclHint]<button class="FuncButton" onfocus="FuncBtnOver(this)" onblur="FuncBtnOut(this)" onmouseover="FuncBtnOver(this)" onmouseout="FuncBtnOut(this)" onmousedown="FuncBtnDown(this)" onmouseup="FuncBtnOut(this)" onclick="ShowHint([strParams])">[strHintCaption]</button>[/inclHint]';
|
||||
InputStuff += '</form>';
|
||||
|
||||
var CurrBoxElement = null;
|
||||
var Finished = false;
|
||||
|
||||
function StartUp(){
|
||||
RemoveBottomNavBarForIE();
|
||||
AcrossCaption = document.getElementById('CluesAcrossLabel').innerHTML;
|
||||
DownCaption = document.getElementById('CluesDownLabel').innerHTML;
|
||||
[inclSendResults]
|
||||
GetUserName();
|
||||
[/inclSendResults]
|
||||
|
||||
[inclPreloadImages]
|
||||
PreloadImages([PreloadImageList]);
|
||||
[/inclPreloadImages]
|
||||
|
||||
[inclTimer]
|
||||
StartTimer();
|
||||
[/inclTimer]
|
||||
|
||||
}
|
||||
|
||||
function GetAnswerLength(Across,x,y){
|
||||
Result = 0;
|
||||
if (Across == false){
|
||||
while ((x<L.length)&&(L[x][y].length > 0)){
|
||||
Result += L[x][y].length;
|
||||
x++;
|
||||
}
|
||||
return Result;
|
||||
}
|
||||
else{
|
||||
while ((y<L[x].length)&&(L[x][y].length > 0)){
|
||||
Result += L[x][y].length;
|
||||
y++;
|
||||
}
|
||||
return Result;
|
||||
}
|
||||
}
|
||||
|
||||
function GetEditSize(Across,x,y){
|
||||
var Len = GetAnswerLength(Across,x,y);
|
||||
if (IsCJK(L[x][y].charCodeAt(0))){
|
||||
Len *= 2;
|
||||
}
|
||||
return Len;
|
||||
}
|
||||
|
||||
function ShowClue(ClueNum,x,y){
|
||||
var Result = '';
|
||||
var Temp;
|
||||
var strParams;
|
||||
var Clue = document.getElementById('Clue_A_' + ClueNum);
|
||||
if (Clue != null){
|
||||
Temp = InputStuff.replace(/\[ClueNum\]/g, ClueNum);
|
||||
Temp = Temp.replace(/\[strClueNum\]/g, AcrossCaption + ' ' + ClueNum);
|
||||
strParams = 'true,' + ClueNum + ',' + x + ',' + y + ',\'[strBoxId]\'';
|
||||
Temp = Temp.replace(/\[strParams\]/g, strParams);
|
||||
Temp = Temp.replace(/\[strBoxId\]/g, 'GA_' + ClueNum + '_' + x + '_' + y);
|
||||
Temp = Temp.replace(/\[strEditSize\]/g, GetEditSize(true,x,y));
|
||||
Temp = Temp.replace(/\[strMaxLength\]/g, GetAnswerLength(true,x,y));
|
||||
Temp = Temp.replace(/\[strClue\]/g, Clue.innerHTML, Temp);
|
||||
Result += Temp;
|
||||
}
|
||||
Clue = document.getElementById('Clue_D_' + ClueNum);
|
||||
if (Clue != null){
|
||||
Temp = InputStuff.replace(/\[ClueNum\]/g, ClueNum);
|
||||
Temp = Temp.replace(/\[strClueNum\]/g, DownCaption + ' ' + ClueNum);
|
||||
strParams = 'false,' + ClueNum + ',' + x + ',' + y + ',\'[strBoxId]\'';
|
||||
Temp = Temp.replace(/\[strParams\]/g, strParams);
|
||||
Temp = Temp.replace(/\[strBoxId\]/g, 'GD_' + ClueNum + '_' + x + '_' + y);
|
||||
Temp = Temp.replace(/\[strEditSize\]/g, GetAnswerLength(false,x,y));
|
||||
Temp = Temp.replace(/\[strClue\]/g, Clue.innerHTML, Temp);
|
||||
Result += Temp;
|
||||
}
|
||||
document.getElementById('ClueEntry').innerHTML = Result;
|
||||
}
|
||||
|
||||
function EnterGuess(Across,ClueNum,x,y,BoxId){
|
||||
if (document.getElementById(BoxId) != null){
|
||||
var Guess = document.getElementById(BoxId).value;
|
||||
var AnsLength = GetAnswerLength(Across,x,y);
|
||||
EnterAnswer(Guess,Across,AnsLength,x,y);
|
||||
}
|
||||
}
|
||||
|
||||
function SplitStringToPerceivedChars(InString, PC){
|
||||
var Temp = InString.charAt(0);
|
||||
if (InString.length > 1){
|
||||
for (var i=1; i<InString.length; i++){
|
||||
if (IsCombiningDiacritic(InString.charCodeAt(i)) == true){
|
||||
Temp += InString.charAt(i);
|
||||
}
|
||||
else{
|
||||
PC.push(Temp);
|
||||
Temp = InString.charAt(i);
|
||||
}
|
||||
}
|
||||
}
|
||||
PC.push(Temp);
|
||||
}
|
||||
|
||||
function EnterAnswer(Guess,Across,AnsLength,x,y){
|
||||
Guess = Guess.toUpperCase();
|
||||
|
||||
var PC = new Array();
|
||||
SplitStringToPerceivedChars(Guess, PC);
|
||||
|
||||
var i=x;
|
||||
var j=y;
|
||||
var Letter = 0;
|
||||
while (Letter < AnsLength){
|
||||
if (Letter < PC.length){
|
||||
G[i][j] = PC[Letter];
|
||||
if (document.getElementById('L_' + i + '_' + j) != null){
|
||||
document.getElementById('L_' + i + '_' + j).innerHTML = PC[Letter];
|
||||
}
|
||||
}
|
||||
if (Across == true){
|
||||
j++;
|
||||
}
|
||||
else{
|
||||
i++;
|
||||
}
|
||||
Letter++;
|
||||
}
|
||||
}
|
||||
|
||||
function SetGridSquareValue(x,y,Val){
|
||||
var GridId = 'L_' + x + '_' + y;
|
||||
if (document.getElementById(GridId) != null){
|
||||
document.getElementById(GridId).innerHTML = Val;
|
||||
}
|
||||
}
|
||||
|
||||
function ShowHint(Across,ClueNum,x,y,BoxId){
|
||||
var i=x;
|
||||
var j=y;
|
||||
var OutString = '';
|
||||
if (Across==true){
|
||||
while (j<L[i].length){
|
||||
if (L[i][j] != ''){
|
||||
OutString += L[i][j];
|
||||
if (G[i][j] != L[i][j]){
|
||||
G[i][j] = L[i][j];
|
||||
Penalties++;
|
||||
break;
|
||||
}
|
||||
}
|
||||
else{
|
||||
break;
|
||||
}
|
||||
j++;
|
||||
}
|
||||
}
|
||||
else{
|
||||
while (i<L.length){
|
||||
if (L[i][j] != ''){
|
||||
OutString += L[i][j];
|
||||
if (G[i][j] != L[i][j]){
|
||||
G[i][j] = L[i][j];
|
||||
Penalties++;
|
||||
break;
|
||||
}
|
||||
}
|
||||
else{
|
||||
break;
|
||||
}
|
||||
i++;
|
||||
}
|
||||
}
|
||||
if (document.getElementById(BoxId) != null){
|
||||
document.getElementById(BoxId).value = OutString;
|
||||
}
|
||||
}
|
||||
|
||||
L = new Array();
|
||||
[strLetterArray]
|
||||
|
||||
CL = new Array();
|
||||
[strClueNumArray]
|
||||
|
||||
G = new Array();
|
||||
[strGuessArray]
|
||||
|
||||
function CheckAnswers(){
|
||||
if (Locked == true){return;}
|
||||
|
||||
var AllCorrect = true;
|
||||
var TotLetters = 0;
|
||||
var CorrectLetters = 0;
|
||||
|
||||
//Check each letter
|
||||
for (var i=0; i<L.length; i++){
|
||||
for (var j=0; j<L[i].length; j++){
|
||||
if (L[i][j] != ''){
|
||||
TotLetters++;
|
||||
if (G[i][j] != L[i][j]){
|
||||
G[i][j] = '';
|
||||
//Blank that square in the grid
|
||||
SetGridSquareValue(i,j,'');
|
||||
AllCorrect = false;
|
||||
}
|
||||
else{
|
||||
CorrectLetters++;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Score = Math.floor(((CorrectLetters-Penalties) * 100)/TotLetters);
|
||||
if (Score < 0){Score = 0;}
|
||||
|
||||
//Compile the output
|
||||
var Output = '';
|
||||
|
||||
if (AllCorrect == true){
|
||||
Output = Correct + '<br />';
|
||||
}
|
||||
|
||||
Output += YourScoreIs + ' ' + Score + '%.<br />';
|
||||
if (AllCorrect == false){
|
||||
Output += Incorrect;
|
||||
Penalties++;
|
||||
}
|
||||
|
||||
ShowMessage(Output);
|
||||
WriteToInstructions(Output);
|
||||
|
||||
if ((AllCorrect == true)||(TimeOver == true)){
|
||||
[inclSendResults]
|
||||
setTimeout('SendResults(' + Score + ')', 50);
|
||||
[/inclSendResults]
|
||||
[inclTimer]
|
||||
window.clearInterval(Interval);
|
||||
[/inclTimer]
|
||||
TimeOver = true;
|
||||
Locked = true;
|
||||
Finished = true;
|
||||
setTimeout('Finish()', SubmissionTimeout);
|
||||
}
|
||||
}
|
||||
|
||||
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.submit();
|
||||
}
|
||||
}
|
||||
|
||||
function TypeChars(Chars){
|
||||
if (CurrentBox != null){
|
||||
CurrentBox.value += Chars;
|
||||
}
|
||||
}
|
||||
|
||||
[inclTimer]
|
||||
function TimesUp() {
|
||||
document.getElementById('Timer').innerHTML = '[strTimesUp]';
|
||||
[inclPreloadImages]
|
||||
RefreshImages();
|
||||
[/inclPreloadImages]
|
||||
TimeOver = true;
|
||||
Finished = true;
|
||||
CheckAnswers();
|
||||
Locked = true;
|
||||
}
|
||||
[/inclTimer]
|
||||
@@ -1,182 +1,182 @@
|
||||
<!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></title>
|
||||
|
||||
<script type="text/javascript">
|
||||
|
||||
//<![CDATA[
|
||||
|
||||
<!--
|
||||
|
||||
var strPrintExplanation = '[strPrintExplanation]';
|
||||
|
||||
function ShowMessage(){
|
||||
alert(strPrintExplanation);
|
||||
}
|
||||
|
||||
function ShowKey(){
|
||||
var NList = document.getElementsByTagName('span');
|
||||
for (var i=0; i<NList.length; i++){
|
||||
if (NList[i].className == 'Letter'){
|
||||
if (NList[i].style.display == 'inline'){
|
||||
NList[i].style.display = 'none';
|
||||
}
|
||||
else{
|
||||
NList[i].style.display = 'inline';
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//-->
|
||||
|
||||
//]]>
|
||||
|
||||
</script>
|
||||
|
||||
<style type="text/css">
|
||||
<!--
|
||||
|
||||
body{
|
||||
background-color: #ffffff;
|
||||
color: #000000;
|
||||
font-family: [strFontFace];
|
||||
font-size: [strFontSize];
|
||||
}
|
||||
|
||||
div.Titles{
|
||||
padding: 0.5em;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
table{
|
||||
margin: auto;
|
||||
}
|
||||
|
||||
table#Grid td{
|
||||
width: 2em;
|
||||
height: 2em;
|
||||
text-align: center;
|
||||
vertical-align: middle;
|
||||
font-size: 140%;
|
||||
}
|
||||
|
||||
table#Grid td.BlankCell{
|
||||
width: 2em;
|
||||
height: 2em;
|
||||
padding: 0px;
|
||||
text-align: center;
|
||||
vertical-align: middle;
|
||||
background-color: #000000;
|
||||
color: #000000;
|
||||
}
|
||||
|
||||
table#Grid td.LetterOnlyCell{
|
||||
width: 2em;
|
||||
height: 2em;
|
||||
text-align: center;
|
||||
vertical-align: middle;
|
||||
background-color: #ffffff;
|
||||
color: #000000;
|
||||
}
|
||||
|
||||
table#Grid td.NumLetterCell{
|
||||
width: 2em;
|
||||
height: 2em;
|
||||
text-align: left;
|
||||
vertical-align: top;
|
||||
background-color: #ffffff;
|
||||
color: #000000;
|
||||
padding: 1px;
|
||||
}
|
||||
|
||||
span.Num{
|
||||
vertical-align: super;
|
||||
font-size: 100%;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
span.Letter{
|
||||
font-weight: bold;
|
||||
font-size: 140%;
|
||||
display: none;
|
||||
}
|
||||
|
||||
table.ClueTable{
|
||||
padding: 0.5em;
|
||||
}
|
||||
|
||||
.ClueNum{
|
||||
font-weight: bold;
|
||||
font-size: 140%;
|
||||
padding: 0px 1em 0px 0px;
|
||||
}
|
||||
|
||||
.Clue{
|
||||
|
||||
}
|
||||
|
||||
-->
|
||||
</style>
|
||||
|
||||
|
||||
</head>
|
||||
<body onload="ShowMessage()">
|
||||
|
||||
<div class="Titles">
|
||||
<h2 style="cursor: pointer;" onclick="ShowKey()">[strExerciseTitle]</h2>
|
||||
[inclExerciseSubtitle]
|
||||
<h3 class="ExerciseSubtitle">[strExerciseSubtitle]</h3>
|
||||
[/inclExerciseSubtitle]
|
||||
</div>
|
||||
|
||||
<table id="Grid" border="1" cellspacing="0" cellpadding="0">
|
||||
|
||||
[StartBlankCell]
|
||||
<td class="BlankCell"> </td>
|
||||
[EndBlankCell]
|
||||
|
||||
[StartLetterOnlyCell]
|
||||
<td class="LetterOnlyCell"> <span class="Letter">[Letter]</span></td>
|
||||
[EndLetterOnlyCell]
|
||||
|
||||
[StartNumLetterCell]
|
||||
<td class="NumLetterCell"><span class="Num">[ClueNum]</span> <span class="Letter">[Letter]</span></td>
|
||||
[EndNumLetterCell]
|
||||
|
||||
</table>
|
||||
|
||||
<table border="0">
|
||||
<tr>
|
||||
<td valign="top">
|
||||
<table border="0" class="ClueTable">
|
||||
<tr><td colspan="2"><h3>[strCluesAcrossLabel]</h3></td></tr>
|
||||
|
||||
[StartCluesAcrossLoop]
|
||||
<tr><td class="ClueNum">[ClueNum]</td>
|
||||
<td class="Clue">[Clue]</td></tr>
|
||||
[EndCluesAcrossLoop]
|
||||
|
||||
</table>
|
||||
|
||||
</td>
|
||||
|
||||
<td valign="top">
|
||||
|
||||
<table border="0" class="ClueTable">
|
||||
<tr><td colspan="2"><h3>[strCluesDownLabel]</h3></td></tr>
|
||||
|
||||
[StartCluesDownLoop]
|
||||
<tr><td class="ClueNum">[ClueNum]</td>
|
||||
<td class="Clue">[Clue]</td></tr>
|
||||
[EndCluesDownLoop]
|
||||
</table>
|
||||
|
||||
</td>
|
||||
</tr></table>
|
||||
|
||||
</body></html>
|
||||
<!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></title>
|
||||
|
||||
<script type="text/javascript">
|
||||
|
||||
//<![CDATA[
|
||||
|
||||
<!--
|
||||
|
||||
var strPrintExplanation = '[strPrintExplanation]';
|
||||
|
||||
function ShowMessage(){
|
||||
alert(strPrintExplanation);
|
||||
}
|
||||
|
||||
function ShowKey(){
|
||||
var NList = document.getElementsByTagName('span');
|
||||
for (var i=0; i<NList.length; i++){
|
||||
if (NList[i].className == 'Letter'){
|
||||
if (NList[i].style.display == 'inline'){
|
||||
NList[i].style.display = 'none';
|
||||
}
|
||||
else{
|
||||
NList[i].style.display = 'inline';
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//-->
|
||||
|
||||
//]]>
|
||||
|
||||
</script>
|
||||
|
||||
<style type="text/css">
|
||||
<!--
|
||||
|
||||
body{
|
||||
background-color: #ffffff;
|
||||
color: #000000;
|
||||
font-family: [strFontFace];
|
||||
font-size: [strFontSize];
|
||||
}
|
||||
|
||||
div.Titles{
|
||||
padding: 0.5em;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
table{
|
||||
margin: auto;
|
||||
}
|
||||
|
||||
table#Grid td{
|
||||
width: 2em;
|
||||
height: 2em;
|
||||
text-align: center;
|
||||
vertical-align: middle;
|
||||
font-size: 140%;
|
||||
}
|
||||
|
||||
table#Grid td.BlankCell{
|
||||
width: 2em;
|
||||
height: 2em;
|
||||
padding: 0px;
|
||||
text-align: center;
|
||||
vertical-align: middle;
|
||||
background-color: #000000;
|
||||
color: #000000;
|
||||
}
|
||||
|
||||
table#Grid td.LetterOnlyCell{
|
||||
width: 2em;
|
||||
height: 2em;
|
||||
text-align: center;
|
||||
vertical-align: middle;
|
||||
background-color: #ffffff;
|
||||
color: #000000;
|
||||
}
|
||||
|
||||
table#Grid td.NumLetterCell{
|
||||
width: 2em;
|
||||
height: 2em;
|
||||
text-align: left;
|
||||
vertical-align: top;
|
||||
background-color: #ffffff;
|
||||
color: #000000;
|
||||
padding: 1px;
|
||||
}
|
||||
|
||||
span.Num{
|
||||
vertical-align: super;
|
||||
font-size: 100%;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
span.Letter{
|
||||
font-weight: bold;
|
||||
font-size: 140%;
|
||||
display: none;
|
||||
}
|
||||
|
||||
table.ClueTable{
|
||||
padding: 0.5em;
|
||||
}
|
||||
|
||||
.ClueNum{
|
||||
font-weight: bold;
|
||||
font-size: 140%;
|
||||
padding: 0px 1em 0px 0px;
|
||||
}
|
||||
|
||||
.Clue{
|
||||
|
||||
}
|
||||
|
||||
-->
|
||||
</style>
|
||||
|
||||
|
||||
</head>
|
||||
<body onload="ShowMessage()">
|
||||
|
||||
<div class="Titles">
|
||||
<h2 style="cursor: pointer;" onclick="ShowKey()">[strExerciseTitle]</h2>
|
||||
[inclExerciseSubtitle]
|
||||
<h3 class="ExerciseSubtitle">[strExerciseSubtitle]</h3>
|
||||
[/inclExerciseSubtitle]
|
||||
</div>
|
||||
|
||||
<table id="Grid" border="1" cellspacing="0" cellpadding="0">
|
||||
|
||||
[StartBlankCell]
|
||||
<td class="BlankCell"> </td>
|
||||
[EndBlankCell]
|
||||
|
||||
[StartLetterOnlyCell]
|
||||
<td class="LetterOnlyCell"> <span class="Letter">[Letter]</span></td>
|
||||
[EndLetterOnlyCell]
|
||||
|
||||
[StartNumLetterCell]
|
||||
<td class="NumLetterCell"><span class="Num">[ClueNum]</span> <span class="Letter">[Letter]</span></td>
|
||||
[EndNumLetterCell]
|
||||
|
||||
</table>
|
||||
|
||||
<table border="0">
|
||||
<tr>
|
||||
<td valign="top">
|
||||
<table border="0" class="ClueTable">
|
||||
<tr><td colspan="2"><h3>[strCluesAcrossLabel]</h3></td></tr>
|
||||
|
||||
[StartCluesAcrossLoop]
|
||||
<tr><td class="ClueNum">[ClueNum]</td>
|
||||
<td class="Clue">[Clue]</td></tr>
|
||||
[EndCluesAcrossLoop]
|
||||
|
||||
</table>
|
||||
|
||||
</td>
|
||||
|
||||
<td valign="top">
|
||||
|
||||
<table border="0" class="ClueTable">
|
||||
<tr><td colspan="2"><h3>[strCluesDownLabel]</h3></td></tr>
|
||||
|
||||
[StartCluesDownLoop]
|
||||
<tr><td class="ClueNum">[ClueNum]</td>
|
||||
<td class="Clue">[Clue]</td></tr>
|
||||
[EndCluesDownLoop]
|
||||
</table>
|
||||
|
||||
</td>
|
||||
</tr></table>
|
||||
|
||||
</body></html>
|
||||
|
||||
+144
-144
@@ -1,144 +1,144 @@
|
||||
<?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]
|
||||
|
||||
[strJSJMatch6]
|
||||
|
||||
[inclTimer]
|
||||
[strJSTimer]
|
||||
[/inclTimer]
|
||||
|
||||
[inclSendResults]
|
||||
[strJSSendResults]
|
||||
[/inclSendResults]
|
||||
|
||||
//-->
|
||||
|
||||
//]]>
|
||||
|
||||
</script>
|
||||
|
||||
|
||||
</head>
|
||||
|
||||
<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]
|
||||
[inclTimer]
|
||||
<div id="Timer"><span id="TimerText"> </span></div>
|
||||
[/inclTimer]
|
||||
|
||||
</div>
|
||||
|
||||
<div id="InstructionsDiv" class="StdDiv">
|
||||
<p id="Instructions">[strInstructions]</p>
|
||||
</div>
|
||||
|
||||
[inclReading]
|
||||
<div class="LeftContainer">
|
||||
|
||||
<div id="Reading" class="StdDiv">
|
||||
|
||||
<div id="ReadingDiv">
|
||||
[strReadingText]
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<div class="RightContainer">
|
||||
[/inclReading]
|
||||
|
||||
<div id="MainDiv" class="StdDiv">
|
||||
|
||||
<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()"> [strCheckCaption] </button>
|
||||
|
||||
<div id="MatchDiv" style="text-align: center;">
|
||||
|
||||
<form id="QForm" method="post" action="" onsubmit="return false;">
|
||||
<table border="0" style="margin: 2em auto 2em auto;"><tbody id="Questions">
|
||||
|
||||
[strMatchDivItems]
|
||||
|
||||
</tbody></table>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<button id="CheckButton2" class="FuncButton" onmouseover="FuncBtnOver(this)" onfocus="FuncBtnOver(this)" onmouseout="FuncBtnOut(this)" onblur="FuncBtnOut(this)" onmousedown="FuncBtnDown(this)" onmouseup="FuncBtnOut(this)" onclick="CheckAnswers()"> [strCheckCaption] </button>
|
||||
|
||||
</div>
|
||||
|
||||
[inclReading]
|
||||
</div>
|
||||
[/inclReading]
|
||||
|
||||
<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;"> [strOKCaption] </button>
|
||||
</div>
|
||||
|
||||
<!-- BeginBottomNavButtons -->
|
||||
|
||||
[inclNavButtons]
|
||||
[strBottomNavBar]
|
||||
[/inclNavButtons]
|
||||
|
||||
<!-- EndBottomNavButtons -->
|
||||
|
||||
<!-- BeginSubmissionForm -->
|
||||
|
||||
<!-- EndSubmissionForm -->
|
||||
|
||||
</body>
|
||||
|
||||
</html>
|
||||
<?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]
|
||||
|
||||
[strJSJMatch6]
|
||||
|
||||
[inclTimer]
|
||||
[strJSTimer]
|
||||
[/inclTimer]
|
||||
|
||||
[inclSendResults]
|
||||
[strJSSendResults]
|
||||
[/inclSendResults]
|
||||
|
||||
//-->
|
||||
|
||||
//]]>
|
||||
|
||||
</script>
|
||||
|
||||
|
||||
</head>
|
||||
|
||||
<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]
|
||||
[inclTimer]
|
||||
<div id="Timer"><span id="TimerText"> </span></div>
|
||||
[/inclTimer]
|
||||
|
||||
</div>
|
||||
|
||||
<div id="InstructionsDiv" class="StdDiv">
|
||||
<p id="Instructions">[strInstructions]</p>
|
||||
</div>
|
||||
|
||||
[inclReading]
|
||||
<div class="LeftContainer">
|
||||
|
||||
<div id="Reading" class="StdDiv">
|
||||
|
||||
<div id="ReadingDiv">
|
||||
[strReadingText]
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<div class="RightContainer">
|
||||
[/inclReading]
|
||||
|
||||
<div id="MainDiv" class="StdDiv">
|
||||
|
||||
<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()"> [strCheckCaption] </button>
|
||||
|
||||
<div id="MatchDiv" style="text-align: center;">
|
||||
|
||||
<form id="QForm" method="post" action="" onsubmit="return false;">
|
||||
<table border="0" style="margin: 2em auto 2em auto;"><tbody id="Questions">
|
||||
|
||||
[strMatchDivItems]
|
||||
|
||||
</tbody></table>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<button id="CheckButton2" class="FuncButton" onmouseover="FuncBtnOver(this)" onfocus="FuncBtnOver(this)" onmouseout="FuncBtnOut(this)" onblur="FuncBtnOut(this)" onmousedown="FuncBtnDown(this)" onmouseup="FuncBtnOut(this)" onclick="CheckAnswers()"> [strCheckCaption] </button>
|
||||
|
||||
</div>
|
||||
|
||||
[inclReading]
|
||||
</div>
|
||||
[/inclReading]
|
||||
|
||||
<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;"> [strOKCaption] </button>
|
||||
</div>
|
||||
|
||||
<!-- BeginBottomNavButtons -->
|
||||
|
||||
[inclNavButtons]
|
||||
[strBottomNavBar]
|
||||
[/inclNavButtons]
|
||||
|
||||
<!-- EndBottomNavButtons -->
|
||||
|
||||
<!-- BeginSubmissionForm -->
|
||||
|
||||
<!-- EndSubmissionForm -->
|
||||
|
||||
</body>
|
||||
|
||||
</html>
|
||||
|
||||
+252
-252
@@ -1,252 +1,252 @@
|
||||
|
||||
var CorrectIndicator = '[strCorrectIndicator]';
|
||||
var IncorrectIndicator = '[strIncorrectIndicator]';
|
||||
var YourScoreIs = '[strYourScoreIs]';
|
||||
var CorrectResponse = '[strGuessCorrect]';
|
||||
var IncorrectResponse = '[strGuessIncorrect]';
|
||||
var TotalUnfixedLeftItems = 0;
|
||||
var TotCorrectChoices = 0;
|
||||
var Penalties = 0;
|
||||
var Finished = false;
|
||||
var TimeOver = false;
|
||||
|
||||
var Score = 0;
|
||||
var Locked = false;
|
||||
var ShuffleQs = [boolShuffleQs];
|
||||
var QsToShow = [QsToShow];
|
||||
|
||||
|
||||
function StartUp(){
|
||||
RemoveBottomNavBarForIE();
|
||||
|
||||
[inclSendResults]
|
||||
GetUserName();
|
||||
[/inclSendResults]
|
||||
|
||||
[inclPreloadImages]
|
||||
PreloadImages([PreloadImageList]);
|
||||
[/inclPreloadImages]
|
||||
|
||||
SetUpItems(ShuffleQs,QsToShow);
|
||||
|
||||
TotalUnfixedLeftItems = document.getElementById('MatchDiv').getElementsByTagName('select').length;
|
||||
|
||||
//Create arrays
|
||||
CreateStatusArrays();
|
||||
|
||||
[inclTimer]
|
||||
StartTimer();
|
||||
[/inclTimer]
|
||||
}
|
||||
|
||||
Status = new Array();
|
||||
|
||||
|
||||
function CreateStatusArrays(){
|
||||
var Selects = document.getElementById('Questions').getElementsByTagName('select');
|
||||
for (var x=0; x<Selects.length; x++){
|
||||
Status[x] = new Array();
|
||||
Status[x][0] = 0; // Item not matched correctly yet
|
||||
Status[x][1] = 0; //Tries at this item so far
|
||||
Status[x][2] = Selects[x].id; //Store a ref to the original drop-down
|
||||
}
|
||||
}
|
||||
|
||||
function GetKeyFromSelectContainer(Container){
|
||||
var Result = -1;
|
||||
if (Container.getElementsByTagName('select').length > 0){
|
||||
var Select = Container.getElementsByTagName('select')[0];
|
||||
if (Select != null){
|
||||
Result = parseInt(Select.id.substring(1, Select.id.length));
|
||||
}
|
||||
}
|
||||
return Result;
|
||||
}
|
||||
|
||||
function GetKeyFromSelect(Select){
|
||||
var Result = -1;
|
||||
if (Select != null){
|
||||
Result = parseInt(Select.id.substring(1, Select.id.length));
|
||||
}
|
||||
return Result;
|
||||
}
|
||||
|
||||
var OriginalKeys = new Array();
|
||||
var ReducedKeys = new Array();
|
||||
|
||||
function GetUniqueKeys(Container, TargetArray){
|
||||
TargetArray.length = 0;
|
||||
var x = -1;
|
||||
var SList = Container.getElementsByTagName('select');
|
||||
if (SList.length > 0){
|
||||
for (var i=0; i<SList.length; i++){
|
||||
x = GetKeyFromSelect(SList[i]);
|
||||
if (TargetArray.indexOf(x) < 0){
|
||||
TargetArray.push(x);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function SetUpItems(ShuffleQs, ReduceTo){
|
||||
var QList = new Array();
|
||||
var i, j, k, Selects, Options;
|
||||
|
||||
//Remove all the table rows and put them in an array for processing
|
||||
var Qs = document.getElementById('Questions');
|
||||
|
||||
//First, get a list of keys
|
||||
GetUniqueKeys(Qs, OriginalKeys);
|
||||
|
||||
//Remove the table rows to an array
|
||||
while (Qs.getElementsByTagName('tr').length > 0){
|
||||
QList.push(Qs.removeChild(Qs.getElementsByTagName('tr')[0]));
|
||||
}
|
||||
|
||||
var Reducing = (QList.length > ReduceTo);
|
||||
|
||||
//If required, select random rows to delete
|
||||
if (Reducing == true){
|
||||
var DumpItem = 0;
|
||||
while (ReduceTo < QList.length){
|
||||
|
||||
//Get a number to delete from the array
|
||||
DumpItem = Math.floor(QList.length*Math.random());
|
||||
for (i=DumpItem; i<(QList.length-1); i++){
|
||||
QList[i] = QList[i+1];
|
||||
}
|
||||
QList.length = QList.length-1;
|
||||
}
|
||||
}
|
||||
//Shuffle the rows if necessary
|
||||
if (ShuffleQs == true){
|
||||
QList = Shuffle(QList);
|
||||
}
|
||||
|
||||
TotalUnfixedLeftItems = QList.length;
|
||||
|
||||
//Write the rows back to the table body
|
||||
for (i=0; i<QList.length; i++){
|
||||
Qs.appendChild(QList[i]);
|
||||
}
|
||||
|
||||
//Now we need to remove any drop-down options that no longer have associated select items
|
||||
if (Reducing == true){
|
||||
GetUniqueKeys(Qs, ReducedKeys);
|
||||
|
||||
Selects = Qs.getElementsByTagName('select');
|
||||
for (i=0; i<Selects.length; i++){
|
||||
Options = Selects[i].getElementsByTagName('option');
|
||||
for (j=Options.length-1; j>=0; j--){
|
||||
if (OptionRequired(Options[j].value) == false){
|
||||
Selects[i].removeChild(Options[j]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function OptionRequired(Key){
|
||||
if (ReducedKeys.indexOf(Key) > -1){
|
||||
return true;
|
||||
}
|
||||
else{
|
||||
if (OriginalKeys.indexOf(Key) > -1){
|
||||
return false;
|
||||
}
|
||||
else{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function CheckAnswers(){
|
||||
if (Locked == true){return;}
|
||||
var Select = null;
|
||||
var Key = -1;
|
||||
var Parent = null;
|
||||
var Answer = null;
|
||||
var AnsText = '';
|
||||
var AllDone = true;
|
||||
TotCorrectChoices = 0;
|
||||
|
||||
//for each item not fixed or a distractor
|
||||
for (var i=0; i<Status.length; i++){
|
||||
|
||||
//if it hasn't been answered correctly yet
|
||||
if (Status[i][0] < 1){
|
||||
|
||||
//Add one to the number of tries for this item
|
||||
Status[i][1]++;
|
||||
|
||||
//Get a pointer to the drop-down
|
||||
Select = document.getElementById(Status[i][2]);
|
||||
Key = GetKeyFromSelect(Select);
|
||||
|
||||
//Check the answer
|
||||
if (Select.options[Select.selectedIndex].value == Key){
|
||||
Status[i][0] = 1;
|
||||
AnsText = Select.options[Select.selectedIndex].innerHTML;
|
||||
Parent = Select.parentNode;
|
||||
Parent.removeChild(Select);
|
||||
Parent.innerHTML = AnsText;
|
||||
Parent.nextSibling.innerHTML = CorrectIndicator;
|
||||
}
|
||||
else{
|
||||
AllDone = false;
|
||||
Parent = Select.parentNode;
|
||||
Parent.nextSibling.innerHTML = IncorrectIndicator;
|
||||
}
|
||||
}
|
||||
//If it's correct, count it
|
||||
if (Status[i][0] == 1){
|
||||
TotCorrectChoices++;
|
||||
}
|
||||
}
|
||||
//Calculate the score
|
||||
Score = Math.floor(((TotCorrectChoices-Penalties)/TotalUnfixedLeftItems)*100);
|
||||
if (Score<0){Score = 0;}
|
||||
var Feedback = '';
|
||||
|
||||
//Build the feedback
|
||||
if (AllDone == true){
|
||||
Feedback = CorrectResponse + '<br />' + YourScoreIs + Score + '%.';
|
||||
}
|
||||
else{
|
||||
Feedback = IncorrectResponse + '<br />' + YourScoreIs + Score + '%.';
|
||||
//Penalty for incorrect check
|
||||
Penalties++;
|
||||
}
|
||||
|
||||
//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);
|
||||
}
|
||||
|
||||
//Show the feedback
|
||||
ShowMessage(Feedback);
|
||||
}
|
||||
|
||||
[inclTimer]
|
||||
function TimesUp() {
|
||||
document.getElementById('Timer').innerHTML = '[strTimesUp]';
|
||||
[inclPreloadImages]
|
||||
RefreshImages();
|
||||
[/inclPreloadImages]
|
||||
TimeOver = true;
|
||||
Finished = true;
|
||||
CheckAnswers();
|
||||
Locked = true;
|
||||
}
|
||||
[/inclTimer]
|
||||
|
||||
|
||||
var CorrectIndicator = '[strCorrectIndicator]';
|
||||
var IncorrectIndicator = '[strIncorrectIndicator]';
|
||||
var YourScoreIs = '[strYourScoreIs]';
|
||||
var CorrectResponse = '[strGuessCorrect]';
|
||||
var IncorrectResponse = '[strGuessIncorrect]';
|
||||
var TotalUnfixedLeftItems = 0;
|
||||
var TotCorrectChoices = 0;
|
||||
var Penalties = 0;
|
||||
var Finished = false;
|
||||
var TimeOver = false;
|
||||
|
||||
var Score = 0;
|
||||
var Locked = false;
|
||||
var ShuffleQs = [boolShuffleQs];
|
||||
var QsToShow = [QsToShow];
|
||||
|
||||
|
||||
function StartUp(){
|
||||
RemoveBottomNavBarForIE();
|
||||
|
||||
[inclSendResults]
|
||||
GetUserName();
|
||||
[/inclSendResults]
|
||||
|
||||
[inclPreloadImages]
|
||||
PreloadImages([PreloadImageList]);
|
||||
[/inclPreloadImages]
|
||||
|
||||
SetUpItems(ShuffleQs,QsToShow);
|
||||
|
||||
TotalUnfixedLeftItems = document.getElementById('MatchDiv').getElementsByTagName('select').length;
|
||||
|
||||
//Create arrays
|
||||
CreateStatusArrays();
|
||||
|
||||
[inclTimer]
|
||||
StartTimer();
|
||||
[/inclTimer]
|
||||
}
|
||||
|
||||
Status = new Array();
|
||||
|
||||
|
||||
function CreateStatusArrays(){
|
||||
var Selects = document.getElementById('Questions').getElementsByTagName('select');
|
||||
for (var x=0; x<Selects.length; x++){
|
||||
Status[x] = new Array();
|
||||
Status[x][0] = 0; // Item not matched correctly yet
|
||||
Status[x][1] = 0; //Tries at this item so far
|
||||
Status[x][2] = Selects[x].id; //Store a ref to the original drop-down
|
||||
}
|
||||
}
|
||||
|
||||
function GetKeyFromSelectContainer(Container){
|
||||
var Result = -1;
|
||||
if (Container.getElementsByTagName('select').length > 0){
|
||||
var Select = Container.getElementsByTagName('select')[0];
|
||||
if (Select != null){
|
||||
Result = parseInt(Select.id.substring(1, Select.id.length));
|
||||
}
|
||||
}
|
||||
return Result;
|
||||
}
|
||||
|
||||
function GetKeyFromSelect(Select){
|
||||
var Result = -1;
|
||||
if (Select != null){
|
||||
Result = parseInt(Select.id.substring(1, Select.id.length));
|
||||
}
|
||||
return Result;
|
||||
}
|
||||
|
||||
var OriginalKeys = new Array();
|
||||
var ReducedKeys = new Array();
|
||||
|
||||
function GetUniqueKeys(Container, TargetArray){
|
||||
TargetArray.length = 0;
|
||||
var x = -1;
|
||||
var SList = Container.getElementsByTagName('select');
|
||||
if (SList.length > 0){
|
||||
for (var i=0; i<SList.length; i++){
|
||||
x = GetKeyFromSelect(SList[i]);
|
||||
if (TargetArray.indexOf(x) < 0){
|
||||
TargetArray.push(x);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function SetUpItems(ShuffleQs, ReduceTo){
|
||||
var QList = new Array();
|
||||
var i, j, k, Selects, Options;
|
||||
|
||||
//Remove all the table rows and put them in an array for processing
|
||||
var Qs = document.getElementById('Questions');
|
||||
|
||||
//First, get a list of keys
|
||||
GetUniqueKeys(Qs, OriginalKeys);
|
||||
|
||||
//Remove the table rows to an array
|
||||
while (Qs.getElementsByTagName('tr').length > 0){
|
||||
QList.push(Qs.removeChild(Qs.getElementsByTagName('tr')[0]));
|
||||
}
|
||||
|
||||
var Reducing = (QList.length > ReduceTo);
|
||||
|
||||
//If required, select random rows to delete
|
||||
if (Reducing == true){
|
||||
var DumpItem = 0;
|
||||
while (ReduceTo < QList.length){
|
||||
|
||||
//Get a number to delete from the array
|
||||
DumpItem = Math.floor(QList.length*Math.random());
|
||||
for (i=DumpItem; i<(QList.length-1); i++){
|
||||
QList[i] = QList[i+1];
|
||||
}
|
||||
QList.length = QList.length-1;
|
||||
}
|
||||
}
|
||||
//Shuffle the rows if necessary
|
||||
if (ShuffleQs == true){
|
||||
QList = Shuffle(QList);
|
||||
}
|
||||
|
||||
TotalUnfixedLeftItems = QList.length;
|
||||
|
||||
//Write the rows back to the table body
|
||||
for (i=0; i<QList.length; i++){
|
||||
Qs.appendChild(QList[i]);
|
||||
}
|
||||
|
||||
//Now we need to remove any drop-down options that no longer have associated select items
|
||||
if (Reducing == true){
|
||||
GetUniqueKeys(Qs, ReducedKeys);
|
||||
|
||||
Selects = Qs.getElementsByTagName('select');
|
||||
for (i=0; i<Selects.length; i++){
|
||||
Options = Selects[i].getElementsByTagName('option');
|
||||
for (j=Options.length-1; j>=0; j--){
|
||||
if (OptionRequired(Options[j].value) == false){
|
||||
Selects[i].removeChild(Options[j]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function OptionRequired(Key){
|
||||
if (ReducedKeys.indexOf(Key) > -1){
|
||||
return true;
|
||||
}
|
||||
else{
|
||||
if (OriginalKeys.indexOf(Key) > -1){
|
||||
return false;
|
||||
}
|
||||
else{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function CheckAnswers(){
|
||||
if (Locked == true){return;}
|
||||
var Select = null;
|
||||
var Key = -1;
|
||||
var Parent = null;
|
||||
var Answer = null;
|
||||
var AnsText = '';
|
||||
var AllDone = true;
|
||||
TotCorrectChoices = 0;
|
||||
|
||||
//for each item not fixed or a distractor
|
||||
for (var i=0; i<Status.length; i++){
|
||||
|
||||
//if it hasn't been answered correctly yet
|
||||
if (Status[i][0] < 1){
|
||||
|
||||
//Add one to the number of tries for this item
|
||||
Status[i][1]++;
|
||||
|
||||
//Get a pointer to the drop-down
|
||||
Select = document.getElementById(Status[i][2]);
|
||||
Key = GetKeyFromSelect(Select);
|
||||
|
||||
//Check the answer
|
||||
if (Select.options[Select.selectedIndex].value == Key){
|
||||
Status[i][0] = 1;
|
||||
AnsText = Select.options[Select.selectedIndex].innerHTML;
|
||||
Parent = Select.parentNode;
|
||||
Parent.removeChild(Select);
|
||||
Parent.innerHTML = AnsText;
|
||||
Parent.nextSibling.innerHTML = CorrectIndicator;
|
||||
}
|
||||
else{
|
||||
AllDone = false;
|
||||
Parent = Select.parentNode;
|
||||
Parent.nextSibling.innerHTML = IncorrectIndicator;
|
||||
}
|
||||
}
|
||||
//If it's correct, count it
|
||||
if (Status[i][0] == 1){
|
||||
TotCorrectChoices++;
|
||||
}
|
||||
}
|
||||
//Calculate the score
|
||||
Score = Math.floor(((TotCorrectChoices-Penalties)/TotalUnfixedLeftItems)*100);
|
||||
if (Score<0){Score = 0;}
|
||||
var Feedback = '';
|
||||
|
||||
//Build the feedback
|
||||
if (AllDone == true){
|
||||
Feedback = CorrectResponse + '<br />' + YourScoreIs + Score + '%.';
|
||||
}
|
||||
else{
|
||||
Feedback = IncorrectResponse + '<br />' + YourScoreIs + Score + '%.';
|
||||
//Penalty for incorrect check
|
||||
Penalties++;
|
||||
}
|
||||
|
||||
//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);
|
||||
}
|
||||
|
||||
//Show the feedback
|
||||
ShowMessage(Feedback);
|
||||
}
|
||||
|
||||
[inclTimer]
|
||||
function TimesUp() {
|
||||
document.getElementById('Timer').innerHTML = '[strTimesUp]';
|
||||
[inclPreloadImages]
|
||||
RefreshImages();
|
||||
[/inclPreloadImages]
|
||||
TimeOver = true;
|
||||
Finished = true;
|
||||
CheckAnswers();
|
||||
Locked = true;
|
||||
}
|
||||
[/inclTimer]
|
||||
|
||||
|
||||
+151
-151
@@ -1,151 +1,151 @@
|
||||
<?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]
|
||||
|
||||
[strJSJMix6]
|
||||
|
||||
[inclTimer]
|
||||
[strJSTimer]
|
||||
[/inclTimer]
|
||||
|
||||
[inclSendResults]
|
||||
[strJSSendResults]
|
||||
[/inclSendResults]
|
||||
|
||||
//-->
|
||||
|
||||
//]]>
|
||||
|
||||
</script>
|
||||
|
||||
|
||||
</head>
|
||||
|
||||
<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]
|
||||
[inclTimer]
|
||||
<div id="Timer"><span id="TimerText"> </span></div>
|
||||
[/inclTimer]
|
||||
|
||||
</div>
|
||||
|
||||
<div id="InstructionsDiv" class="StdDiv">
|
||||
<p id="Instructions">[strInstructions]</p>
|
||||
</div>
|
||||
|
||||
[inclReading]
|
||||
<div class="LeftContainer">
|
||||
|
||||
<div id="Reading" class="StdDiv">
|
||||
|
||||
<div id="ReadingDiv">
|
||||
[strReadingText]
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<div class="RightContainer">
|
||||
[/inclReading]
|
||||
|
||||
<div id="GuessDiv" class="StdDiv">
|
||||
|
||||
</div>
|
||||
|
||||
<div id="MainDiv" class="StdDiv">
|
||||
|
||||
<button id="CheckButton1" class="FuncButton" onmouseover="FuncBtnOver(this)" onfocus="FuncBtnOver(this)" onmouseout="FuncBtnOut(this)" onblur="FuncBtnOut(this)" onmousedown="FuncBtnDown(this)" onmouseup="FuncBtnOut(this)" onclick="CheckAnswer(0)"> [strCheckCaption] </button>
|
||||
|
||||
[inclUndo]
|
||||
<button class="FuncButton" onmouseover="FuncBtnOver(this)" onfocus="FuncBtnOver(this)" onmouseout="FuncBtnOut(this)" onblur="FuncBtnOut(this)" onmousedown="FuncBtnDown(this)" onmouseup="FuncBtnOut(this)" onclick="Undo()"> [strUndoCaption] </button>
|
||||
[/inclUndo]
|
||||
|
||||
[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()"> [strRestartCaption] </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="CheckAnswer(1)"> [strHintCaption] </button>
|
||||
[/inclHint]
|
||||
|
||||
<div id="SegmentDiv">
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
[inclReading]
|
||||
</div>
|
||||
[/inclReading]
|
||||
|
||||
<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;"> [strOKCaption] </button>
|
||||
</div>
|
||||
|
||||
<!-- BeginBottomNavButtons -->
|
||||
|
||||
[inclNavButtons]
|
||||
[strBottomNavBar]
|
||||
[/inclNavButtons]
|
||||
|
||||
<!-- EndBottomNavButtons -->
|
||||
|
||||
<!-- BeginSubmissionForm -->
|
||||
|
||||
<!-- EndSubmissionForm -->
|
||||
|
||||
</body>
|
||||
|
||||
</html>
|
||||
<?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]
|
||||
|
||||
[strJSJMix6]
|
||||
|
||||
[inclTimer]
|
||||
[strJSTimer]
|
||||
[/inclTimer]
|
||||
|
||||
[inclSendResults]
|
||||
[strJSSendResults]
|
||||
[/inclSendResults]
|
||||
|
||||
//-->
|
||||
|
||||
//]]>
|
||||
|
||||
</script>
|
||||
|
||||
|
||||
</head>
|
||||
|
||||
<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]
|
||||
[inclTimer]
|
||||
<div id="Timer"><span id="TimerText"> </span></div>
|
||||
[/inclTimer]
|
||||
|
||||
</div>
|
||||
|
||||
<div id="InstructionsDiv" class="StdDiv">
|
||||
<p id="Instructions">[strInstructions]</p>
|
||||
</div>
|
||||
|
||||
[inclReading]
|
||||
<div class="LeftContainer">
|
||||
|
||||
<div id="Reading" class="StdDiv">
|
||||
|
||||
<div id="ReadingDiv">
|
||||
[strReadingText]
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<div class="RightContainer">
|
||||
[/inclReading]
|
||||
|
||||
<div id="GuessDiv" class="StdDiv">
|
||||
|
||||
</div>
|
||||
|
||||
<div id="MainDiv" class="StdDiv">
|
||||
|
||||
<button id="CheckButton1" class="FuncButton" onmouseover="FuncBtnOver(this)" onfocus="FuncBtnOver(this)" onmouseout="FuncBtnOut(this)" onblur="FuncBtnOut(this)" onmousedown="FuncBtnDown(this)" onmouseup="FuncBtnOut(this)" onclick="CheckAnswer(0)"> [strCheckCaption] </button>
|
||||
|
||||
[inclUndo]
|
||||
<button class="FuncButton" onmouseover="FuncBtnOver(this)" onfocus="FuncBtnOver(this)" onmouseout="FuncBtnOut(this)" onblur="FuncBtnOut(this)" onmousedown="FuncBtnDown(this)" onmouseup="FuncBtnOut(this)" onclick="Undo()"> [strUndoCaption] </button>
|
||||
[/inclUndo]
|
||||
|
||||
[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()"> [strRestartCaption] </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="CheckAnswer(1)"> [strHintCaption] </button>
|
||||
[/inclHint]
|
||||
|
||||
<div id="SegmentDiv">
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
[inclReading]
|
||||
</div>
|
||||
[/inclReading]
|
||||
|
||||
<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;"> [strOKCaption] </button>
|
||||
</div>
|
||||
|
||||
<!-- BeginBottomNavButtons -->
|
||||
|
||||
[inclNavButtons]
|
||||
[strBottomNavBar]
|
||||
[/inclNavButtons]
|
||||
|
||||
<!-- EndBottomNavButtons -->
|
||||
|
||||
<!-- BeginSubmissionForm -->
|
||||
|
||||
<!-- EndSubmissionForm -->
|
||||
|
||||
</body>
|
||||
|
||||
</html>
|
||||
|
||||
+356
-356
@@ -1,357 +1,357 @@
|
||||
//JMIX STANDARD OUTPUT FORMAT CODE
|
||||
|
||||
|
||||
var CorrectResponse = '[strGuessCorrect]';
|
||||
var IncorrectResponse = '[strGuessIncorrect]';
|
||||
var TheseAnswersToo = '[strTheseAnswersToo]';
|
||||
var ThisMuchCorrect = '[strThisMuch]';
|
||||
var NextCorrect = '[strNextCorrect]';
|
||||
var YourScoreIs = '[strYourScoreIs]';
|
||||
var CapitalizeFirst = [boolCapitalizeFirst];
|
||||
var Penalties = 0;
|
||||
var Finished = false;
|
||||
var TimeOver = false;
|
||||
var Score = 0;
|
||||
var strInstructions = '';
|
||||
|
||||
|
||||
var SegmentTemplate = ' <a class="ExSegment" href="javascript:void(0)" onclick="AddSegment([SegmentNumber])" title="[strClickToAdd]">[CurrentSegment]</a> ';
|
||||
|
||||
var Exercise = '';
|
||||
|
||||
var Punctuation = '[strPunctuation]';
|
||||
|
||||
var Openers = '[strOpenPunctuation]';
|
||||
|
||||
var Guesses = new Array();
|
||||
var Remaining = new Array();
|
||||
var CorrectParts = new Array();
|
||||
|
||||
var ClosestMatch = 0;
|
||||
|
||||
var LowerString='';
|
||||
var UpperString='';
|
||||
|
||||
var Output = '';
|
||||
|
||||
var Segments = new Array();
|
||||
[SegmentArray]
|
||||
|
||||
var GuessSequence = new Array();
|
||||
|
||||
var Answers = new Array();
|
||||
[AnswerArray]
|
||||
|
||||
function WriteToGuess(Feedback) {
|
||||
document.getElementById('GuessDiv').innerHTML = Feedback;
|
||||
[inclPreloadImages]
|
||||
RefreshImages();
|
||||
[/inclPreloadImages]
|
||||
}
|
||||
|
||||
function Undo(){
|
||||
if (GuessSequence.length < 1){
|
||||
return;
|
||||
}
|
||||
GuessSequence.length = GuessSequence.length - 1;
|
||||
BuildCurrGuess();
|
||||
BuildExercise();
|
||||
DisplayExercise(Exercise);
|
||||
//Following line modified for 6.0.4.44 -- "remaining words" message removed, no longer needed
|
||||
WriteToGuess('<span class="Answer">' + Output + '</span>');
|
||||
}
|
||||
|
||||
function AddSegment(SegNum){
|
||||
[inclTimer]
|
||||
if (TimeOver == true){return;}
|
||||
[/inclTimer]
|
||||
GuessSequence[GuessSequence.length] = SegNum;
|
||||
BuildCurrGuess();
|
||||
WriteToGuess('<span class="Answer">' + Output + '</span>');
|
||||
BuildExercise();
|
||||
DisplayExercise(Exercise);
|
||||
}
|
||||
|
||||
function BuildCurrGuess(){
|
||||
|
||||
var i = 0;
|
||||
var j = 0;
|
||||
var NewSeg = '';
|
||||
|
||||
//first, create arrays of all the segments guessed so far and those not yet used
|
||||
GuessSegs = new Array();
|
||||
GuessSegs.length = 0;
|
||||
|
||||
//set the "used" markers all to 0
|
||||
for (i=0; i<Segments.length; i++){
|
||||
Segments[i][2] = 0;
|
||||
}
|
||||
|
||||
for (i=0; i<GuessSequence.length; i++){
|
||||
for (j=0; j<Segments.length; j++){
|
||||
if ((Segments[j][1] == GuessSequence[i])&&(Segments[j][2] == 0)){
|
||||
GuessSegs[GuessSegs.length] = Segments[j][0];
|
||||
Segments[j][2] = 1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//Create the list of unused segments
|
||||
RemainingList = '';
|
||||
for (i=0; i<Segments.length; i++){
|
||||
if (Segments[i][2] == 0){
|
||||
RemainingList += Segments[i][0] + ' ';
|
||||
}
|
||||
}
|
||||
|
||||
//now concatenate the segments, adding spaces where appropriate;
|
||||
Output = CompileString(GuessSequence);
|
||||
}
|
||||
|
||||
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){
|
||||
i = 0;
|
||||
if ((Openers.indexOf(OutString.charAt(i))>-1)||(OutString.charAt(i) == ' ')){
|
||||
i++;
|
||||
}
|
||||
if ((Openers.indexOf(OutString.charAt(i))>-1)||(OutString.charAt(i) == ' ')){
|
||||
i++;
|
||||
}
|
||||
var Temp = OutString.charAt(i);
|
||||
Temp = Temp.toUpperCase();
|
||||
OutString = OutString.substring(0, i) + Temp + OutString.substring(i+1, OutString.length);
|
||||
}
|
||||
return OutString;
|
||||
}
|
||||
function CheckAnswer(CheckType){
|
||||
|
||||
if (GuessSequence.length < 1){
|
||||
if (CheckType == 1){
|
||||
ShowMessage(NextCorrect + '<br /><span class="Answer">' + FindSegment(Answers[0][0]) + '</span>');
|
||||
Penalties++;
|
||||
}
|
||||
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="Answer">' + Output + '</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="Answer">' + OtherAnswers + '</span>';
|
||||
}
|
||||
[/inclAlsoCorrect]
|
||||
|
||||
WriteToGuess(WellDone);
|
||||
ShowMessage(WellDone);
|
||||
}
|
||||
|
||||
else{
|
||||
TryAgain = '<span class="Answer">' + CompileString(GuessSequence) + '</span><br /><br />';
|
||||
if (CheckType == 0){
|
||||
TryAgain += IncorrectResponse + '<br />';
|
||||
}
|
||||
|
||||
if (LongestCorrect.length > 0){
|
||||
|
||||
LongestCorrectBit = CompileString(LongestCorrect);
|
||||
GuessSequence.length = LongestCorrect.length;
|
||||
TryAgain += ThisMuchCorrect + '<br /><span class="Answer">' + LongestCorrectBit + '</span><br />';
|
||||
|
||||
//These lines added for 6.0.3.44
|
||||
WriteToGuess('<span class="Answer">' + LongestCorrectBit + '</span>');
|
||||
}
|
||||
else{
|
||||
GuessSequence.length = 0;
|
||||
WriteToGuess('');
|
||||
}
|
||||
|
||||
if (CheckType == 1){
|
||||
TryAgain += NextCorrect + '<br /><span class="Answer">' + FindSegment(HintToReturn) + '</span>';
|
||||
}
|
||||
|
||||
BuildCurrGuess();
|
||||
BuildExercise();
|
||||
DisplayExercise(Exercise);
|
||||
ShowMessage(TryAgain);
|
||||
Penalties++; //Penalty for inaccurate check
|
||||
|
||||
[inclTimer]
|
||||
if (TimeOver == true){
|
||||
Score = Math.floor(((LongestCorrect.length-Penalties) * 100)/Segments.length);
|
||||
if (Score < 0){Score = 0;}
|
||||
ShowMessage(YourScoreIs + ' ' + Score + '%.<br />');
|
||||
}
|
||||
[/inclTimer]
|
||||
|
||||
}
|
||||
//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 + '%.');
|
||||
}
|
||||
}
|
||||
|
||||
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 StartUp(){
|
||||
RemoveBottomNavBarForIE();
|
||||
|
||||
//Stash the instructions so they can be redisplayed
|
||||
strInstructions = document.getElementById('InstructionsDiv').innerHTML;
|
||||
|
||||
[inclSendResults]
|
||||
GetUserName();
|
||||
[/inclSendResults]
|
||||
|
||||
[inclPreloadImages]
|
||||
PreloadImages([PreloadImageList]);
|
||||
[/inclPreloadImages]
|
||||
|
||||
Segments = Shuffle(Segments);
|
||||
|
||||
//Build and show the exercise
|
||||
BuildExercise();
|
||||
DisplayExercise(Exercise);
|
||||
|
||||
[inclTimer]
|
||||
StartTimer();
|
||||
[/inclTimer]
|
||||
}
|
||||
|
||||
|
||||
function BuildExercise(){
|
||||
Exercise = '';
|
||||
|
||||
var SegRow = '';
|
||||
var TempRow = '';
|
||||
|
||||
for (var i=0; i<Segments.length; i++){
|
||||
//if the segment hasn't been used yet
|
||||
if (Segments[i][2] == 0){
|
||||
TempRow = SegmentTemplate;
|
||||
TempRow = TempRow.replace(/\[SegmentNumber\]/g, Segments[i][1]);
|
||||
TempRow = TempRow.replace(/\[CurrentSegment\]/g, Segments[i][0]);
|
||||
SegRow += TempRow;
|
||||
}
|
||||
}
|
||||
|
||||
//Make it into a table
|
||||
Exercise = SegRow;
|
||||
}
|
||||
|
||||
function DisplayExercise(StuffToDisplay){
|
||||
document.getElementById('SegmentDiv').innerHTML = StuffToDisplay;
|
||||
FocusAButton();
|
||||
[inclPreloadImages]
|
||||
RefreshImages();
|
||||
[/inclPreloadImages]
|
||||
}
|
||||
|
||||
[inclTimer]
|
||||
function TimesUp() {
|
||||
document.getElementById('Timer').innerHTML = '[strTimesUp]';
|
||||
[inclPreloadImages]
|
||||
RefreshImages();
|
||||
[/inclPreloadImages]
|
||||
TimeOver = true;
|
||||
Finished = true;
|
||||
CheckAnswer(0);
|
||||
Locked = true;
|
||||
}
|
||||
//JMIX STANDARD OUTPUT FORMAT CODE
|
||||
|
||||
|
||||
var CorrectResponse = '[strGuessCorrect]';
|
||||
var IncorrectResponse = '[strGuessIncorrect]';
|
||||
var TheseAnswersToo = '[strTheseAnswersToo]';
|
||||
var ThisMuchCorrect = '[strThisMuch]';
|
||||
var NextCorrect = '[strNextCorrect]';
|
||||
var YourScoreIs = '[strYourScoreIs]';
|
||||
var CapitalizeFirst = [boolCapitalizeFirst];
|
||||
var Penalties = 0;
|
||||
var Finished = false;
|
||||
var TimeOver = false;
|
||||
var Score = 0;
|
||||
var strInstructions = '';
|
||||
|
||||
|
||||
var SegmentTemplate = ' <a class="ExSegment" href="javascript:void(0)" onclick="AddSegment([SegmentNumber])" title="[strClickToAdd]">[CurrentSegment]</a> ';
|
||||
|
||||
var Exercise = '';
|
||||
|
||||
var Punctuation = '[strPunctuation]';
|
||||
|
||||
var Openers = '[strOpenPunctuation]';
|
||||
|
||||
var Guesses = new Array();
|
||||
var Remaining = new Array();
|
||||
var CorrectParts = new Array();
|
||||
|
||||
var ClosestMatch = 0;
|
||||
|
||||
var LowerString='';
|
||||
var UpperString='';
|
||||
|
||||
var Output = '';
|
||||
|
||||
var Segments = new Array();
|
||||
[SegmentArray]
|
||||
|
||||
var GuessSequence = new Array();
|
||||
|
||||
var Answers = new Array();
|
||||
[AnswerArray]
|
||||
|
||||
function WriteToGuess(Feedback) {
|
||||
document.getElementById('GuessDiv').innerHTML = Feedback;
|
||||
[inclPreloadImages]
|
||||
RefreshImages();
|
||||
[/inclPreloadImages]
|
||||
}
|
||||
|
||||
function Undo(){
|
||||
if (GuessSequence.length < 1){
|
||||
return;
|
||||
}
|
||||
GuessSequence.length = GuessSequence.length - 1;
|
||||
BuildCurrGuess();
|
||||
BuildExercise();
|
||||
DisplayExercise(Exercise);
|
||||
//Following line modified for 6.0.4.44 -- "remaining words" message removed, no longer needed
|
||||
WriteToGuess('<span class="Answer">' + Output + '</span>');
|
||||
}
|
||||
|
||||
function AddSegment(SegNum){
|
||||
[inclTimer]
|
||||
if (TimeOver == true){return;}
|
||||
[/inclTimer]
|
||||
GuessSequence[GuessSequence.length] = SegNum;
|
||||
BuildCurrGuess();
|
||||
WriteToGuess('<span class="Answer">' + Output + '</span>');
|
||||
BuildExercise();
|
||||
DisplayExercise(Exercise);
|
||||
}
|
||||
|
||||
function BuildCurrGuess(){
|
||||
|
||||
var i = 0;
|
||||
var j = 0;
|
||||
var NewSeg = '';
|
||||
|
||||
//first, create arrays of all the segments guessed so far and those not yet used
|
||||
GuessSegs = new Array();
|
||||
GuessSegs.length = 0;
|
||||
|
||||
//set the "used" markers all to 0
|
||||
for (i=0; i<Segments.length; i++){
|
||||
Segments[i][2] = 0;
|
||||
}
|
||||
|
||||
for (i=0; i<GuessSequence.length; i++){
|
||||
for (j=0; j<Segments.length; j++){
|
||||
if ((Segments[j][1] == GuessSequence[i])&&(Segments[j][2] == 0)){
|
||||
GuessSegs[GuessSegs.length] = Segments[j][0];
|
||||
Segments[j][2] = 1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//Create the list of unused segments
|
||||
RemainingList = '';
|
||||
for (i=0; i<Segments.length; i++){
|
||||
if (Segments[i][2] == 0){
|
||||
RemainingList += Segments[i][0] + ' ';
|
||||
}
|
||||
}
|
||||
|
||||
//now concatenate the segments, adding spaces where appropriate;
|
||||
Output = CompileString(GuessSequence);
|
||||
}
|
||||
|
||||
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){
|
||||
i = 0;
|
||||
if ((Openers.indexOf(OutString.charAt(i))>-1)||(OutString.charAt(i) == ' ')){
|
||||
i++;
|
||||
}
|
||||
if ((Openers.indexOf(OutString.charAt(i))>-1)||(OutString.charAt(i) == ' ')){
|
||||
i++;
|
||||
}
|
||||
var Temp = OutString.charAt(i);
|
||||
Temp = Temp.toUpperCase();
|
||||
OutString = OutString.substring(0, i) + Temp + OutString.substring(i+1, OutString.length);
|
||||
}
|
||||
return OutString;
|
||||
}
|
||||
function CheckAnswer(CheckType){
|
||||
|
||||
if (GuessSequence.length < 1){
|
||||
if (CheckType == 1){
|
||||
ShowMessage(NextCorrect + '<br /><span class="Answer">' + FindSegment(Answers[0][0]) + '</span>');
|
||||
Penalties++;
|
||||
}
|
||||
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="Answer">' + Output + '</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="Answer">' + OtherAnswers + '</span>';
|
||||
}
|
||||
[/inclAlsoCorrect]
|
||||
|
||||
WriteToGuess(WellDone);
|
||||
ShowMessage(WellDone);
|
||||
}
|
||||
|
||||
else{
|
||||
TryAgain = '<span class="Answer">' + CompileString(GuessSequence) + '</span><br /><br />';
|
||||
if (CheckType == 0){
|
||||
TryAgain += IncorrectResponse + '<br />';
|
||||
}
|
||||
|
||||
if (LongestCorrect.length > 0){
|
||||
|
||||
LongestCorrectBit = CompileString(LongestCorrect);
|
||||
GuessSequence.length = LongestCorrect.length;
|
||||
TryAgain += ThisMuchCorrect + '<br /><span class="Answer">' + LongestCorrectBit + '</span><br />';
|
||||
|
||||
//These lines added for 6.0.3.44
|
||||
WriteToGuess('<span class="Answer">' + LongestCorrectBit + '</span>');
|
||||
}
|
||||
else{
|
||||
GuessSequence.length = 0;
|
||||
WriteToGuess('');
|
||||
}
|
||||
|
||||
if (CheckType == 1){
|
||||
TryAgain += NextCorrect + '<br /><span class="Answer">' + FindSegment(HintToReturn) + '</span>';
|
||||
}
|
||||
|
||||
BuildCurrGuess();
|
||||
BuildExercise();
|
||||
DisplayExercise(Exercise);
|
||||
ShowMessage(TryAgain);
|
||||
Penalties++; //Penalty for inaccurate check
|
||||
|
||||
[inclTimer]
|
||||
if (TimeOver == true){
|
||||
Score = Math.floor(((LongestCorrect.length-Penalties) * 100)/Segments.length);
|
||||
if (Score < 0){Score = 0;}
|
||||
ShowMessage(YourScoreIs + ' ' + Score + '%.<br />');
|
||||
}
|
||||
[/inclTimer]
|
||||
|
||||
}
|
||||
//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 + '%.');
|
||||
}
|
||||
}
|
||||
|
||||
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 StartUp(){
|
||||
RemoveBottomNavBarForIE();
|
||||
|
||||
//Stash the instructions so they can be redisplayed
|
||||
strInstructions = document.getElementById('InstructionsDiv').innerHTML;
|
||||
|
||||
[inclSendResults]
|
||||
GetUserName();
|
||||
[/inclSendResults]
|
||||
|
||||
[inclPreloadImages]
|
||||
PreloadImages([PreloadImageList]);
|
||||
[/inclPreloadImages]
|
||||
|
||||
Segments = Shuffle(Segments);
|
||||
|
||||
//Build and show the exercise
|
||||
BuildExercise();
|
||||
DisplayExercise(Exercise);
|
||||
|
||||
[inclTimer]
|
||||
StartTimer();
|
||||
[/inclTimer]
|
||||
}
|
||||
|
||||
|
||||
function BuildExercise(){
|
||||
Exercise = '';
|
||||
|
||||
var SegRow = '';
|
||||
var TempRow = '';
|
||||
|
||||
for (var i=0; i<Segments.length; i++){
|
||||
//if the segment hasn't been used yet
|
||||
if (Segments[i][2] == 0){
|
||||
TempRow = SegmentTemplate;
|
||||
TempRow = TempRow.replace(/\[SegmentNumber\]/g, Segments[i][1]);
|
||||
TempRow = TempRow.replace(/\[CurrentSegment\]/g, Segments[i][0]);
|
||||
SegRow += TempRow;
|
||||
}
|
||||
}
|
||||
|
||||
//Make it into a table
|
||||
Exercise = SegRow;
|
||||
}
|
||||
|
||||
function DisplayExercise(StuffToDisplay){
|
||||
document.getElementById('SegmentDiv').innerHTML = StuffToDisplay;
|
||||
FocusAButton();
|
||||
[inclPreloadImages]
|
||||
RefreshImages();
|
||||
[/inclPreloadImages]
|
||||
}
|
||||
|
||||
[inclTimer]
|
||||
function TimesUp() {
|
||||
document.getElementById('Timer').innerHTML = '[strTimesUp]';
|
||||
[inclPreloadImages]
|
||||
RefreshImages();
|
||||
[/inclPreloadImages]
|
||||
TimeOver = true;
|
||||
Finished = true;
|
||||
CheckAnswer(0);
|
||||
Locked = true;
|
||||
}
|
||||
[/inclTimer]
|
||||
+159
-159
@@ -1,159 +1,159 @@
|
||||
<?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]
|
||||
|
||||
[strJSJQuiz6]
|
||||
|
||||
[inclShortAnswer]
|
||||
[strJSCheckShortAnswer]
|
||||
[/inclShortAnswer]
|
||||
|
||||
[inclTimer]
|
||||
[strJSTimer]
|
||||
[/inclTimer]
|
||||
|
||||
[inclSendResults]
|
||||
[strJSSendResults]
|
||||
[/inclSendResults]
|
||||
|
||||
//-->
|
||||
|
||||
//]]>
|
||||
|
||||
</script>
|
||||
|
||||
|
||||
</head>
|
||||
|
||||
<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]
|
||||
[inclTimer]
|
||||
<div id="Timer"><span id="TimerText"> </span></div>
|
||||
[/inclTimer]
|
||||
|
||||
</div>
|
||||
|
||||
<div id="InstructionsDiv" class="StdDiv">
|
||||
<p id="Instructions">[strInstructions]</p>
|
||||
</div>
|
||||
|
||||
[inclReading]
|
||||
<div class="LeftContainer">
|
||||
|
||||
<div id="Reading" class="StdDiv">
|
||||
|
||||
<div id="ReadingDiv">
|
||||
[strReadingText]
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<div class="RightContainer">
|
||||
[/inclReading]
|
||||
|
||||
|
||||
<div id="MainDiv" class="StdDiv">
|
||||
|
||||
<div id="QNav" class="QuestionNavigation">
|
||||
|
||||
<p style="text-align: right;">
|
||||
<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;">[strShowAllQuestionsCaption]</button>
|
||||
</p>
|
||||
|
||||
<div id="OneByOneReadout">
|
||||
<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;">[strLastQCaption]</button>
|
||||
|
||||
<span id="QNumReadout" class="QNum"> </span>
|
||||
|
||||
<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;">[strNextQCaption]</button>
|
||||
<br />
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
[strQuestionOutput]
|
||||
|
||||
[inclKeypad]
|
||||
<div id="CharacterKeypad" class="Keypad">
|
||||
[strKeypad]
|
||||
</div>
|
||||
[/inclKeypad]
|
||||
|
||||
</div>
|
||||
|
||||
[inclReading]
|
||||
</div>
|
||||
[/inclReading]
|
||||
|
||||
<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;"> [strOKCaption] </button>
|
||||
</div>
|
||||
|
||||
<!-- BeginBottomNavButtons -->
|
||||
|
||||
[inclNavButtons]
|
||||
[strBottomNavBar]
|
||||
[/inclNavButtons]
|
||||
|
||||
<!-- EndBottomNavButtons -->
|
||||
|
||||
<!-- BeginSubmissionForm -->
|
||||
|
||||
<!-- EndSubmissionForm -->
|
||||
|
||||
</body>
|
||||
|
||||
</html>
|
||||
<?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]
|
||||
|
||||
[strJSJQuiz6]
|
||||
|
||||
[inclShortAnswer]
|
||||
[strJSCheckShortAnswer]
|
||||
[/inclShortAnswer]
|
||||
|
||||
[inclTimer]
|
||||
[strJSTimer]
|
||||
[/inclTimer]
|
||||
|
||||
[inclSendResults]
|
||||
[strJSSendResults]
|
||||
[/inclSendResults]
|
||||
|
||||
//-->
|
||||
|
||||
//]]>
|
||||
|
||||
</script>
|
||||
|
||||
|
||||
</head>
|
||||
|
||||
<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]
|
||||
[inclTimer]
|
||||
<div id="Timer"><span id="TimerText"> </span></div>
|
||||
[/inclTimer]
|
||||
|
||||
</div>
|
||||
|
||||
<div id="InstructionsDiv" class="StdDiv">
|
||||
<p id="Instructions">[strInstructions]</p>
|
||||
</div>
|
||||
|
||||
[inclReading]
|
||||
<div class="LeftContainer">
|
||||
|
||||
<div id="Reading" class="StdDiv">
|
||||
|
||||
<div id="ReadingDiv">
|
||||
[strReadingText]
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<div class="RightContainer">
|
||||
[/inclReading]
|
||||
|
||||
|
||||
<div id="MainDiv" class="StdDiv">
|
||||
|
||||
<div id="QNav" class="QuestionNavigation">
|
||||
|
||||
<p style="text-align: right;">
|
||||
<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;">[strShowAllQuestionsCaption]</button>
|
||||
</p>
|
||||
|
||||
<div id="OneByOneReadout">
|
||||
<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;">[strLastQCaption]</button>
|
||||
|
||||
<span id="QNumReadout" class="QNum"> </span>
|
||||
|
||||
<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;">[strNextQCaption]</button>
|
||||
<br />
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
[strQuestionOutput]
|
||||
|
||||
[inclKeypad]
|
||||
<div id="CharacterKeypad" class="Keypad">
|
||||
[strKeypad]
|
||||
</div>
|
||||
[/inclKeypad]
|
||||
|
||||
</div>
|
||||
|
||||
[inclReading]
|
||||
</div>
|
||||
[/inclReading]
|
||||
|
||||
<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;"> [strOKCaption] </button>
|
||||
</div>
|
||||
|
||||
<!-- BeginBottomNavButtons -->
|
||||
|
||||
[inclNavButtons]
|
||||
[strBottomNavBar]
|
||||
[/inclNavButtons]
|
||||
|
||||
<!-- EndBottomNavButtons -->
|
||||
|
||||
<!-- BeginSubmissionForm -->
|
||||
|
||||
<!-- EndSubmissionForm -->
|
||||
|
||||
</body>
|
||||
|
||||
</html>
|
||||
|
||||
+606
-606
File diff suppressed because it is too large
Load Diff
@@ -1,90 +1,90 @@
|
||||
<?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>
|
||||
[strPlainIndexTitle]
|
||||
</title>
|
||||
|
||||
<!-- Made with executable version [strFullVersionInfo] -->
|
||||
|
||||
<style type="text/css">
|
||||
|
||||
body{
|
||||
font-family: [strFontFace];
|
||||
[inclPageBGColor] background-color: [strPageBGColor];[/inclPageBGColor]
|
||||
color: [strTextColor];
|
||||
[inclGraphicURL] background-image: url([strGraphicURL]);[/inclGraphicURL]
|
||||
padding-left: 5%;
|
||||
padding-right: 5%;
|
||||
font-size: [strFontSize];
|
||||
}
|
||||
|
||||
div.Titles{
|
||||
padding: 0.5em;;
|
||||
text-align: center;
|
||||
color: [strTitleColor];
|
||||
}
|
||||
|
||||
.ExerciseTitle{
|
||||
font-size: 140%;
|
||||
color: [strTitleColor];
|
||||
}
|
||||
|
||||
.ExerciseSubtitle{
|
||||
font-size: 120%;
|
||||
color: [strTitleColor];
|
||||
}
|
||||
|
||||
div.IndexDiv{
|
||||
margin-left: auto;
|
||||
margin-right: auto;
|
||||
padding: 2em;
|
||||
border-style: solid;
|
||||
border-width: 1px;
|
||||
text-align: center;
|
||||
width: 40%;
|
||||
background-color: [strExBGColor];
|
||||
color: [strTextColor];
|
||||
font-size: 100%;
|
||||
}
|
||||
|
||||
.Index{
|
||||
text-align: left;
|
||||
font-size: 100%;
|
||||
}
|
||||
|
||||
a{
|
||||
color: [strLinkColor];
|
||||
}
|
||||
|
||||
a:visited{
|
||||
color: [strVLinkColor];
|
||||
}
|
||||
|
||||
a:hover{
|
||||
color: [strLinkColor];
|
||||
}
|
||||
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<div class="Titles">
|
||||
<h2 class="ExerciseTitle">[strIndexTitle]</h2>
|
||||
</div>
|
||||
|
||||
<div style="text-align: center;">
|
||||
<div class="IndexDiv">
|
||||
<ul class="Index">
|
||||
|
||||
[BeginIndexItem]<li><a href="[strIndexItemURL]">[strIndexItemTitle]</a> </li>[EndIndexItem]
|
||||
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?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>
|
||||
[strPlainIndexTitle]
|
||||
</title>
|
||||
|
||||
<!-- Made with executable version [strFullVersionInfo] -->
|
||||
|
||||
<style type="text/css">
|
||||
|
||||
body{
|
||||
font-family: [strFontFace];
|
||||
[inclPageBGColor] background-color: [strPageBGColor];[/inclPageBGColor]
|
||||
color: [strTextColor];
|
||||
[inclGraphicURL] background-image: url([strGraphicURL]);[/inclGraphicURL]
|
||||
padding-left: 5%;
|
||||
padding-right: 5%;
|
||||
font-size: [strFontSize];
|
||||
}
|
||||
|
||||
div.Titles{
|
||||
padding: 0.5em;;
|
||||
text-align: center;
|
||||
color: [strTitleColor];
|
||||
}
|
||||
|
||||
.ExerciseTitle{
|
||||
font-size: 140%;
|
||||
color: [strTitleColor];
|
||||
}
|
||||
|
||||
.ExerciseSubtitle{
|
||||
font-size: 120%;
|
||||
color: [strTitleColor];
|
||||
}
|
||||
|
||||
div.IndexDiv{
|
||||
margin-left: auto;
|
||||
margin-right: auto;
|
||||
padding: 2em;
|
||||
border-style: solid;
|
||||
border-width: 1px;
|
||||
text-align: center;
|
||||
width: 40%;
|
||||
background-color: [strExBGColor];
|
||||
color: [strTextColor];
|
||||
font-size: 100%;
|
||||
}
|
||||
|
||||
.Index{
|
||||
text-align: left;
|
||||
font-size: 100%;
|
||||
}
|
||||
|
||||
a{
|
||||
color: [strLinkColor];
|
||||
}
|
||||
|
||||
a:visited{
|
||||
color: [strVLinkColor];
|
||||
}
|
||||
|
||||
a:hover{
|
||||
color: [strLinkColor];
|
||||
}
|
||||
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<div class="Titles">
|
||||
<h2 class="ExerciseTitle">[strIndexTitle]</h2>
|
||||
</div>
|
||||
|
||||
<div style="text-align: center;">
|
||||
<div class="IndexDiv">
|
||||
<ul class="Index">
|
||||
|
||||
[BeginIndexItem]<li><a href="[strIndexItemURL]">[strIndexItemTitle]</a> </li>[EndIndexItem]
|
||||
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</body></html>
|
||||
@@ -1,29 +1,29 @@
|
||||
|
||||
<!-- BeginMasherV6NavBar -->
|
||||
|
||||
<!-- BeginNavBarHeaderCodeInsertedByMasher -->
|
||||
<style type="text/css">
|
||||
|
||||
[strNavBarStyle]
|
||||
|
||||
</style>
|
||||
|
||||
<script type="text/javascript">
|
||||
//<![CDATA[
|
||||
<!--
|
||||
|
||||
[strNavBarJS]
|
||||
|
||||
//-->
|
||||
//]]>
|
||||
</script>
|
||||
<!-- EndNavBarHeaderCodeInsertedByMasher -->
|
||||
|
||||
<!-- BeginNavBarInsertedByMasher -->
|
||||
|
||||
<!-- BeginRepeatCode -->
|
||||
[strTopNavBar]
|
||||
<!-- EndRepeatCode -->
|
||||
|
||||
<!-- EndNavBarInsertedByMasher -->
|
||||
|
||||
<!-- BeginMasherV6NavBar -->
|
||||
|
||||
<!-- BeginNavBarHeaderCodeInsertedByMasher -->
|
||||
<style type="text/css">
|
||||
|
||||
[strNavBarStyle]
|
||||
|
||||
</style>
|
||||
|
||||
<script type="text/javascript">
|
||||
//<![CDATA[
|
||||
<!--
|
||||
|
||||
[strNavBarJS]
|
||||
|
||||
//-->
|
||||
//]]>
|
||||
</script>
|
||||
<!-- EndNavBarHeaderCodeInsertedByMasher -->
|
||||
|
||||
<!-- BeginNavBarInsertedByMasher -->
|
||||
|
||||
<!-- BeginRepeatCode -->
|
||||
[strTopNavBar]
|
||||
<!-- EndRepeatCode -->
|
||||
|
||||
<!-- EndNavBarInsertedByMasher -->
|
||||
<!-- EndMasherV6NavBar -->
|
||||
@@ -1,35 +1,35 @@
|
||||
<!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>
|
||||
Testing browser check code
|
||||
</title>
|
||||
<style type="text/css">
|
||||
|
||||
</style>
|
||||
|
||||
<script type="text/javascript" src="hp6browsercheck.js_"></script>
|
||||
|
||||
<base href="http://web.uvic.ca/hrd/hotpot/" />
|
||||
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
<script type="text/javascript">
|
||||
<!--
|
||||
for (var i in C){
|
||||
document.write('C.' + i + '=' + C[i].toString() + '<br />');
|
||||
}
|
||||
//var BH = document.getElementsByTagName('base')[0].getAttribute('href');
|
||||
//alert(BH);
|
||||
//-->
|
||||
</script>
|
||||
|
||||
<a href="index.htm">Go</a>
|
||||
|
||||
</body>
|
||||
<!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>
|
||||
Testing browser check code
|
||||
</title>
|
||||
<style type="text/css">
|
||||
|
||||
</style>
|
||||
|
||||
<script type="text/javascript" src="hp6browsercheck.js_"></script>
|
||||
|
||||
<base href="http://web.uvic.ca/hrd/hotpot/" />
|
||||
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
<script type="text/javascript">
|
||||
<!--
|
||||
for (var i in C){
|
||||
document.write('C.' + i + '=' + C[i].toString() + '<br />');
|
||||
}
|
||||
//var BH = document.getElementsByTagName('base')[0].getAttribute('href');
|
||||
//alert(BH);
|
||||
//-->
|
||||
</script>
|
||||
|
||||
<a href="index.htm">Go</a>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user