|
|
|
@ -18,6 +18,15 @@ function createElements( phrase ) |
|
|
|
|
return s; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
function createChain( phrase ) |
|
|
|
|
{ |
|
|
|
|
var arr = phrase.split(" "); |
|
|
|
|
var result = ""; |
|
|
|
|
for( var i = 0; i < arr.length; i++ )
|
|
|
|
|
result += '<div class="letterCont">' + createElements(arr[i]) + '</div>';
|
|
|
|
|
return result; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$(document).ready(function() |
|
|
|
|
{
|
|
|
|
@ -135,9 +144,8 @@ $(document).ready(function() |
|
|
|
|
|
|
|
|
|
// store the text
|
|
|
|
|
w.setData( "phrase", phrase ); |
|
|
|
|
|
|
|
|
|
// remove all dots (they are to be set during the exercise)
|
|
|
|
|
phrase = phrase.replace( / /g, '' ); |
|
|
|
|
//phrase = phrase.replace( / /g, '' );
|
|
|
|
|
|
|
|
|
|
// create the html
|
|
|
|
|
if(window.sankore && sankore.preference("ordSplPhrasesState", "") == "1" && flag){ |
|
|
|
@ -147,7 +155,7 @@ $(document).ready(function() |
|
|
|
|
flag = false; |
|
|
|
|
}
|
|
|
|
|
else |
|
|
|
|
w.setViewContent( createElements( phrase ) ); |
|
|
|
|
w.setViewContent( createChain( phrase ) ); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// the behaviour
|
|
|
|
@ -241,7 +249,7 @@ $(document).ready(function() |
|
|
|
|
if( this.className.indexOf( "fixed" ) != -1 ){ |
|
|
|
|
phrase += ' '; |
|
|
|
|
} |
|
|
|
|
else if( this.className.indexOf( "dash" ) != -1 ){ |
|
|
|
|
else if( (this.className.indexOf( "dash" ) != -1) || (this.className.indexOf( "letterCont" ) != -1) ){ |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
else{ |
|
|
|
@ -249,7 +257,6 @@ $(document).ready(function() |
|
|
|
|
phrase += ch; |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
//alert(phrase + " | " + this.getData( "phrase" ))
|
|
|
|
|
if( phrase == this.getData( "phrase" ) ){ |
|
|
|
|
this.elements.containerView.addClass( "answerRight" ); |
|
|
|
|
} |
|
|
|
|