// JavaScript Document



/*### DEFAULT TEXTS ####################################*/
notAnsweredTxt = 'Not answered'; // parts that can be translated
totQstTxt = 'Total questions: ';
correctCountTxt ='Correct answers: ';
wrongCountTxt = 'Wrong answers: ';
netScoreTxt = 'Total score: ';
printTxt= 'Print results';
refreshTxt = 'Try again';

/*### BASIC CONF ####################################*/
correctChar = 'v'; // the character that defines a correct answer


rangeArr = new Array();  // specify the ending score (from 1 to 10) of a range and the url of the page lo be loaded
rangeArr[0] = '4.99,/quizresult/spanish-level/en/tryagain.html';
rangeArr[1] = '9.99,/quizresult/spanish-level/en/basic.html';
rangeArr[2] = '10,/quizresult/spanish-level/en/basicperfect.html';




/*init variables*/
totQst = 0 ;
grossScore = 0;
netScore =0;
correctCount = 0;
correctPercent = 0;
maxScore = 0;
rangenum = 0;
arraycounter = 0;


questionsArr = new Array();
ansOk = false;

/* end init*/


/*### STRUCTURE CONFIG ###################################*/
qzBox = '#quiz'; // quiz container identifier


boxElem = 'div'; // the type of element containing the questions. Can be a list of elements separated by comma (e.g. 'div,ol,ul')
fillgaps ='.fillgaps'; //jquery style identifier for the fill in the gaps questions
singlechoice ='.singlechoice';//jquery style identifier for the single choice questions
multichoice = '.multichoice'; //jquery style identifier for the multiple choice questions



qstCount = '.qst-count';  //question counter identifier  --Sugg. you can use the pseudos :before and :after  along with content: in CSS to add elements to the counter (like dots or points)
qstDescr ='.qst-descr'; // jquery style identifier for the description text for each question
qstText ='.qst-text'; // jquery style identifier for the text of the question

sendbutt = '.sendbutt'; //jquery style identifier for thelaunch eval button



weightAttr = 'value' // name of the attribute containing the weight of the question
weightClassId =".wgt" // jquery style identifier for the weight of each question


resStrClass= 'result' //class name for the result structure
resStrCorrect ='correct' //class name for the correct result structure
resStrWrong ='wrong' //class name for the wrong result structure

rangeStrBox = 'rangebox'; //class name for the range results box


questResClass = 'qresult'; //id for the questions result box
qstResTag = 'div'; // tag name for the box containing a single question 
qstResClass = 'box'; // class name for the box containing a single question


questGeneral ='answer';
questCorrect = 'correct';
questWrong = 'wrong';
questNA = 'notanswered';

optbarClass = 'optionbar';
optionbar  ='<div class="'+optbarClass+'"><a href="javascript:window.print();" class="printthis">'+printTxt+'</a> <a href="javascript:location.reload(true)" class="reloadthis">'+refreshTxt+'</a><br class="qclear" /></div>';

function createStruct(){
// the HTML structure of the result box
resultStructure ='<ul class="'+resStrClass+'"><li>'+totQstTxt+'<em>'+totQst+'</em></li><li class="'+resStrCorrect+'">'+correctCountTxt+'<em>'+correctCount+'</em> (<em>'+correctPercent+'%</em>)</li><li class="'+resStrWrong+'">'+wrongCountTxt+'<em>'+wrongCount+'</em></li><li>'+netScoreTxt+'<em>'+netScore+'</em> /10</li></ul>';



qstBoxOpen='<div id="'+questResClass+'">'; // open and close html for the questions
qstBoxClose='</div>';

};








