\n");
}
function GetVoto(mark)
{
var tipo;
var str="";
tipo = GetTypeOfSubstitution(mark);
if (tipo == 2) {
return GetRemFromMark(voto);
}
else {
if (markPercentage==0) {
str += ""+voto+"/"+maxvoto;
}
else {
str += ""+voto+"/"+maxvoto+" ( "+Math.floor(voto*100/maxvoto)+"% )";
}
if (tipo == 1) {
str += " - "+GetRemFromMark(voto);
}
return str;
}
}
function getRispostaSelezionata(n,m)
{
return getHTMLResultBox(checkIcon,"Selected answer","#000080","",m);
}
function getHTMLResultBox(nomeIco,title,titleColor,bodyMsg,n)
{
if (resultBoxKind==0)
return getHTMLResultEmbed(nomeIco,title,titleColor,bodyMsg,n);
else
return getHTMLResultWin(nomeIco,title,titleColor,bodyMsg);
}
function getHTMLResultEmbed(nomeIco,title,titleColor,bodyMsg,n)
{
var msg;
var icoImage;
icoImage = mediaDir+"/"+nomeIco;
msg = "
";
msg += " | ";
msg += title + " |
";
if (bodyMsg!="")
msg += "" + bodyMsg + "
";
msg += "";
return msg;
}
function getHTMLResultWin(nomeIco,title,titleColor,bodyMsg)
{
var msg;
var icoImage;
icoImage = mediaDir+"/"+nomeIco;
msg = "";
msg += " | ";
msg += title + " |
";
if (bodyMsg!="")
msg += "" + bodyMsg + "
";
msg += "";
return msg;
}
function getBooleanAnswer(n,m)
{
var nomeIcona,title,msg="";
if (nScore[n]==getNumAns(n))
nomeIcona = okIcon;
else if (nScore[n]==0)
nomeIcona = koIcon;
else
nomeIcona = warnIcon;
title = "Right Answers " + nScore[n] + " / " + getNumAns(n);
if (nScore[n]";
}
}
return getHTMLResultBox(okIcon,"Good ! Right answer","#000080",msg,m);
}
function getWrongAnswer(n,m,explan)
{
var i,title,msg="";
title = "Wrong!
The correct answer was " + getListOfRightAns(n);
for (i=0;i";
}
}
return getHTMLResultBox(koIcon,title,"#A52A2A",msg,m);
}
function getQuestionScore(n,m)
{
var i,title,msg="";
var nomeIcona;
if (maxScore[n]==maxvoto)
nomeIcona = okIcon;
else if (maxScore[n]==minvoto)
nomeIcona = koIcon;
else
nomeIcona = warnIcon;
title = "Score " + nScore[n];
if (groups[n]==0)
title += " / MARK " + maxScore[n];
if (getGuessAns(n)1)&&(questSlide==0)) {
layer = frames.quiz_main.document.all.hideTxt[m];
table = frames.quiz_main.document.all.hideAns[m];
}
else {
layer = frames.quiz_main.document.all.hideTxt;
table = frames.quiz_main.document.all.hideAns;
}
if (silent==1) {
if (questSlide==0) {
ShowResultBox(getRispostaSelezionata(n,m),layer,table);
}
}
else {
if (valid[n]==1) {
ShowResultBox(getRightAnswer(n,m,explan),layer,table);
PlaySoundFile(okSound);
}
else {
ShowResultBox(getWrongAnswer(n,m,explan),layer,table);
PlaySoundFile(errSound);
}
}
end_test = CountAnswers();
PrintStatusBar();
PrintBottomFrame();
if (end_test==1) {
window.status = "";
window.alert("You have answered all of the questions");
EndQuiz();
}
return end_test;
}
function PrintOpenAnswer(n) {
end_test = CountAnswers();
PrintStatusBar();
PrintBottomFrame();
if (end_test==1) {
window.status = "";
window.alert("You have answered all of the questions");
EndQuiz();
}
return end_test;
}
function PrintBooleanAnswer(n,m)
{
var i,count;
var layer;
var table;
if ((questions-invisibleQuests>1)&&(questSlide==0)) {
layer = frames.quiz_main.document.all.hideTxt[m];
table = frames.quiz_main.document.all.hideAns[m];
}
else {
layer = frames.quiz_main.document.all.hideTxt;
table = frames.quiz_main.document.all.hideAns;
}
if (silent==0) {
ShowResultBox(getBooleanAnswer(n,m),layer,table);
PlaySoundBooleanAns(n);
}
else {
if (questSlide==0) {
ShowResultBox(getRispostaSelezionata(n,m),layer,table);
}
}
end_test = CountAnswers();
PrintStatusBar();
PrintBottomFrame();
if (end_test==1) {
window.status = "";
window.alert("You have answered all of the questions");
EndQuiz();
}
return end_test;
}
function PrintQuestionScore(n,m)
{
var i,count;
var layer;
var table;
if ((questions-invisibleQuests>1)&&(questSlide==0)) {
layer = frames.quiz_main.document.all.hideTxt[m];
table = frames.quiz_main.document.all.hideAns[m];
}
else {
layer = frames.quiz_main.document.all.hideTxt;
table = frames.quiz_main.document.all.hideAns;
}
if (silent==0) {
ShowResultBox(getQuestionScore(n,m),layer,table);
PlaySoundWithScore(maxScore[n]);
}
else {
if (questSlide==0) {
ShowResultBox(getRispostaSelezionata(n,m),layer,table);
}
}
end_test = CountAnswers();
PrintStatusBar();
PrintBottomFrame();
if (end_test==1) {
window.status = "";
window.alert("You have answered all of the questions");
EndQuiz();
}
return end_test;
}
function ShowResultBox (htmlTag,layer,table)
{
if (resultBoxKind==0) {
layer.innerHTML = htmlTag;
table.className = 'cardShow';
}
else {
if (silent==0) {
resultWin = window.open('mio.htm','resWin','scrollbars=yes,menubar=no,status=no,location=no,toolbar=no,width=432,height=150');
resultWin.document.all.hideTxt.innerHTML = htmlTag;
}
}
}
function hideWindow(n) {
if ((questions-invisibleQuests>1)&&(questSlide==0)) {
frames.quiz_main.document.all.check[n].className='checkShow';
frames.quiz_main.document.all.hideAns[n].className='cardHide';
}
else {
frames.quiz_main.document.all.check.className='checkShow';
frames.quiz_main.document.all.hideAns.className='cardHide';
}
}
function PrintBottomFrame()
{
if (silent==0) {
frames.quiz_status.document.all.nRight.innerText = nc;
frames.quiz_status.document.all.nWrong.innerText = ns;
}
frames.quiz_status.document.all.nToDo.innerText = nr;
}
function PrintWrongKeyword()
{
frames.quiz_main.document.clear();
frames.quiz_main.document.open();
PrintOpenHTML(frames.quiz_main.document,"",1);
frames.quiz_main.document.writeln (bodyTagFrame1);
frames.quiz_main.document.writeln("Watch out!
");
frames.quiz_main.document.writeln ("The keyword isn't correct
");
frames.quiz_main.document.writeln ("Unable to continue the quiz
");
frames.quiz_main.document.writeln ("For information, contact the quiz's author
");
frames.quiz_main.document.writeln("");
frames.quiz_main.document.writeln("
");
frames.quiz_main.document.writeln ("