' + FindSegment(Answers[0][0]) + '');
}
return;
}
var i = 0;
var j = 0;
var k = 0;
var WellDone = '';
var WhichCorrect = -1;
var TryAgain = '';
var LongestCorrectBit = '';
TempCorrect = new Array();
LongestCorrect = new Array();
var TempHint = '';
var HintToReturn = 1;
var OtherAnswers = '';
for (i=0; i LongestCorrect.length){
LongestCorrect.length = 0;
for (k=0; k -1){
for (i=0; i' + CompileString(Answers[i]);
}
}
WellDone = '' + Output + '
';
Penalties++;
if ((CheckType == 0)||(LongestCorrect.length==0)){
TryAgain += IncorrectResponse + ' ';
}
if (LongestCorrect.length > 0){
LongestCorrectBit = CompileString(LongestCorrect);
GuessSequence.length = LongestCorrect.length;
TryAgain += ' ' + ThisMuchCorrect + ' ' + LongestCorrectBit + ' ';
}
if (CheckType == 1){
TryAgain += ' ' + NextCorrect + ' ' + FindSegment(HintToReturn);
}
WriteFeedback(TryAgain);
}
}
var Segments = new Array();
Segments[0] = new Array();
Segments[0][0] = 'gefr\u00FChst\u00FCckt';
Segments[0][1] = 3;
Segments[0][2] = 0;
Segments[1] = new Array();
Segments[1][0] = 'hat';
Segments[1][1] = 4;
Segments[1][2] = 0;
Segments[2] = new Array();
Segments[2][0] = 'ehe';
Segments[2][1] = 1;
Segments[2][2] = 0;
Segments[3] = new Array();
Segments[3][0] = 'er';
Segments[3][1] = 2;
Segments[3][2] = 0;
Segments[4] = new Array();
Segments[4][0] = '.';
Segments[4][1] = 5;
Segments[4][2] = 0;
var GuessSequence = new Array();
var Answers = new Array();
Answers[0] = new Array(1,2,3,4,5);
function doDrag(e) {
if (CurrDrag == -1) {return};
if (is.ie){var Ev = window.event}else{var Ev = e}
var difX = Ev.clientX-window.lastX;
var difY = Ev.clientY-window.lastY;
var newX = C[CurrDrag].GetL()+difX;
var newY = C[CurrDrag].GetT()+difY;
C[CurrDrag].SetL(newX);
C[CurrDrag].SetT(newY);
window.lastX = Ev.clientX;
window.lastY = Ev.clientY;
return false;
}
function beginDrag(e, DragNum) {
CurrDrag = DragNum;
if (is.ie){
var Ev = window.event;
document.onmousemove=doDrag;
document.onmouseup=endDrag;
}
else{
var Ev = e;
window.onmousemove=doDrag;
window.onmouseup=endDrag;
}
C[CurrDrag].SwapColours();
topZ++;
C[CurrDrag].css.zIndex = topZ;
window.lastX=Ev.clientX;
window.lastY=Ev.clientY;
return true;
}
function endDrag(e) {
if (CurrDrag == -1) {return};
C[CurrDrag].SwapColours();
if (is.ie){document.onmousemove=null}else{window.onmousemove=null;}
onEndDrag();
CurrDrag = -1;
return true;
}
function onEndDrag(){
//Snap to lines
var i = 0;
var SnapLine = C[CurrDrag].GetT();
var BiggestOverlap = -1;
var OverlapRect = 0;
for (i=0; i OverlapRect){
OverlapRect = C[CurrDrag].Overlap(L[i]);
BiggestOverlap = i;
}
}
if (BiggestOverlap > -1){
// SnapLine = L[BiggestOverlap].tag;
SnapLine = L[BiggestOverlap].GetB() - (C[CurrDrag].GetH() + 2);
C[CurrDrag].SetT(SnapLine);
CheckOver(-1);
}
if (CapitalizeFirst==true){
setTimeout('DoCapitalization()', 50);
}
}
function DoCapitalization(){
//Capitalize first segment if necessary
var FD = GetGuessSequence();
if ((FD == -1)&&(FirstDiv > -1)){
C[FirstDiv].elm.innerHTML = Segments[FirstDiv][0];
}
if (((FD != FirstDiv)&&(CapitalizeFirst == true))&&(FD > -1)){
if (FirstDiv > -1){
C[FirstDiv].elm.innerHTML = Segments[FirstDiv][0];
}
}
if ((FD > -1)&&(CapitalizeFirst == true)){
var Temp = CapFirst(Segments[FD][0]);
C[FD].elm.innerHTML = Temp;
FirstDiv = FD;
}
}
function CheckOver(NoMove){
//This recursive function spreads out the Cards on a line if two of them are overlapping;
//if the spread operation moves one beyond the end of a line, it wraps it to the next line.
var Temp;
for (var i=0; i 0){
if ((i==NoMove)||(C[i].GetL() < C[j].GetL())){
C[j].DockToR(C[i]);
if (C[j].GetR() > (LeftColPos + DivWidth)){
C[j].SetL(LeftColPos);
C[j].SetT(C[j].GetT() + DropHeight);
}
CheckOver(j);
}
else{
C[i].DockToR(C[j]);
if (C[i].GetR() > (LeftColPos + DivWidth)){
C[i].SetL(LeftColPos);
C[i].SetT(C[i].GetT() + DropHeight);
}
CheckOver(i);
}
}
}
}
}
}
function StartUp(){
Segments = Shuffle(Segments);
//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/10);
RightColPos = pg.W - (DragWidth + LeftColPos);
DragTop = parseInt(document.getElementById('TitleDiv').offsetHeight) + 10;
//Position the feedback div
var CurrDiv = document.getElementById('FeedbackDiv');
CurrDiv.style.top = DragTop + 5 + 'px';
CurrDiv.style.left = Math.floor((pg.W)/3) + 'px';
CurrDiv.style.width = Math.floor(pg.W/3) + 'px';
var CurrTop = DragTop + 10;
//Position the drop divs
for (var i=0; i'; //required for Navigator rendering bug with images
C[i].SetT(CurrTop);
C[i].SetL(LeftColPos);
C[i].css.cursor = 'move';
TempInt = C[i].GetH();
CurrTop = CurrTop + TempInt + 5;
C[i].css.backgroundColor = '#ffdca8';
C[i].css.color = '#000000';
topZ++;
C[i].css.zIndex = topZ;
C[i].tag = Segments[i][1];
C[i].index = i;
}
//Place them at the bottom of the page
SetInitialPositions();
}
function SetInitialPositions(){
//Places all the divs at the bottom of the page in centred rows
//First, get the vertical position of the first row
var RTop = L[L.length-1].GetB() + 10;
//Create an array to hold the numbers of Cards for each row
CRows = new Array();
CRows[0] = new Array();
Widths = new Array();
var i=0;
var r=0;
var RowWidth=0;
//Sort the Cards into rows, storing their numbers in the array
while (i ';
Output += '';
var FDiv = document.getElementById('FeedbackDiv');
FDiv.innerHTML = Output;
topZ++;
FDiv.style.zIndex = topZ;
//Add a border to the feedback div
document.getElementById('FeedbackDiv').style.borderStyle = 'solid';
FDiv.style.display='';
}
function HideFeedback(){
var FDiv = document.getElementById('FeedbackDiv');
FDiv.innerHTML = '';
FDiv.style.display='none';
}
//-->
//]]>