

<!--

var Grade = "7";

var trueAns = new Array("B", "H", "C", "G", "D", "G", "C", "H", "B", "J", 

		"A", "J", "A", "H", "C", "F", "D", "J", "B", "H", 

		"A", "H", "C", "F", "D", "G", "C", "J", "A", "J", 

		"A", "F", "B", "F", "A", "G", "B", "J", "B", "H");



var SE = new Array("7.17 (C)", "7.18 (E)", "7.16 (B)", "7.16 (B)", "7.18 (C)", "7.17 (A)", "7.17 (G)", "7.16 (D)", "7.17 (C)", "7.18 (E)", 

		"7.17 (C)", "7.17 (A)", "7.18 (C)", "7.16 (C)", "7.16 (B)", "7.18 (D)", "7.17 (B)", "7.18 (E)", "7.16 (B)", "7.17 (C)", 

		"7.17 (F)", "7.17 (E)", "7.17 (G)", "7.17 (A)", "7.18 (H)", "7.18 (E)", "7.16 (B)", "7.18 (D)", "7.17 (A)", "7.18 (E)", 

		"7.18 (E)", "7.17 (C)", "7.17 (H)", "7.17 (D)", "7.17 (C)", "7.17 (B)", "7.16 (C)", "7.18 (D)", "7.16 (B)", "7.18 (C)");



var objmeasured = new Array("05", "05", "06", "06", "03", "04", "06", "06", "05", "04", 

		"05", "04", "03", "06", "06", "03", "04", "04", "06", "05", 

		"05", "04", "06", "04", "06", "05", "06", "03", "04", "04", 

		"05", "05", "05", "05", "05", "04", "06", "03", "06", "03");



var Scale = new Array("1260", "1398", "1501", "1566", "1614", "1654", "1688", "1718", "1745", "1770", 

		"1793", "1814", "1834", "1854", "1872", "1890", "1907", "1924", "1940", "1957", 

		"1973", "1988", "2004", "2020", "2035", "2051", "2067", "2083", "2100", "2117", 

		"2135", "2153", "2172", "2192", "2213", "2236", "2261", "2288", "2319", "2356", 

		"2400", "2458", "2541", "2688", "2869");



var Object3 = new Array(4, 12, 15, 27, 37, 39);

var Object4 = new Array(5, 9, 11, 16, 17, 21, 23, 28, 29, 35);

var Object5 = new Array(0, 1, 8, 10, 19, 20, 25, 30, 31, 32, 33, 34);

var Object6 = new Array(2, 3, 6, 7, 13, 14, 18, 22, 24, 26, 36, 38);



var BrowserMinVersionRequired = 4;



var userAns = new Array(trueAns.length);

var qMark = new Array(trueAns.length);

var userName;

var TotalScore;

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 "NR";

}



// 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;

     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>Your Score Card</Title>");

       scoreWindow.document.write("</head>");

       scoreWindow.document.write("<body>");

       scoreWindow.document.write("<form>");

       scoreWindow.document.write("<center><H3>Grade 7 TAKS Writing - Administered Spring 2003</H3><H3> Score report for "+userName+" </H3></center>");

       scoreWindow.document.write("<table border=0 cellspacing=0 align=\"center\"  >");

       scoreWindow.document.write("<tr><td> Item &nbsp;  </td><td> &nbsp; Objective &nbsp;</td><td>&nbsp;Student &nbsp;</td><td> &nbsp; Correct </td><td> &nbsp; Student's </td></tr>");

       scoreWindow.document.write("<tr><td> Number &nbsp;  </td><td> &nbsp; Measured  &nbsp;</td><td>&nbsp;Expectations&nbsp;</td><td> &nbsp; Answer </td><td> &nbsp; Answer </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=\"yellow\">");

             }

             scoreWindow.document.write("<td align=\"center\">"+j+"</td><td align=\"center\">");



             scoreWindow.document.write(objmeasured[j-1]+"</td><td align=\"center\">");

	     

	     scoreWindow.document.write(SE[j-1]+"</td>");	

             scoreWindow.document.write("<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>student's answer correct</td></tr>");

       scoreWindow.document.write("<tr><td>NR</td><td> = </td><td>no response, student did not answer</td></tr></table>");

       scoreWindow.document.write("<br>");

       scoreWindow.document.write("<table><tr><td colspan=4 align=left><b>Your total number of multiple-choice items correct by objective:</b>");

       scoreWindow.document.write("<tr><td valign=top>");

       scoreWindow.document.write("<b>Objective 3:</b></td><td>"); 

       scoreWindow.document.write("The student will recognize appropriate organization of ideas in written text. </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>Objective 4:</b></td><td>"); 

       scoreWindow.document.write("The student will recognize correct and effective sentence construction in written text.</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>Objective 5:</b></td><td>"); 

       scoreWindow.document.write("The student will recognize standard usage and appropriate word choice in written text. </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>Objective 6:</b></td><td>"); 

       scoreWindow.document.write("The student will proofread for correct punctuation, capitalization, and spelling in written text. </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>Total Multiple-Choice Items:</b></td><td></td><td><b>"+TotalScore+"/"+trueAns.length+"</b></td></tr>");

       scoreWindow.document.write("</table>");



       scoreWindow.document.write("<br>");       

   //  scoreWindow.document.write("Your total multiple-choice score is"+TotalScore+" out of  "+trueAns.length+" questions.");



       if(TotalScore > 0)

           scoreWindow.document.write("Your total multiple-choice score would correspond to a <A HREF=http://www.tea.state.tx.us/student.assessment/scoring/convtables/2003/index.html>Scale Score:</A> "+Scale[TotalScore]+".");

       else

           scoreWindow.document.write("Your total multiple-choice score would correspond to a <A HREF=http://www.tea.state.tx.us/student.assessment/scoring/convtables/2003/index.html>Scale Score:</A> "+Scale[0]+".");

       scoreWindow.document.write("<br>");; 

       

   //	scoreWindow.document.write("<table><tr><td><b>+</b></td><td> = </td><td>student's answer correct</td></tr>");

 

   //	scoreWindow.document.write("<tr><td>NR</td><td> = </td><td>no response, student did not answer</td></tr></table>");



       scoreWindow.document.write("<br>");

       scoreWindow.document.write("<hr>");

       scoreWindow.document.write("<table><tr><td valign=top></td><td>The total score on this test would be the ");

       scoreWindow.document.write("number of multiple-choice items correct + (composition score x 1)</td></tr></table>");

       scoreWindow.document.write("<hr>");

       scoreWindow.document.write("<table><tr><td valign=top></td><td>The score on this test is <b>NOT</b> an official TAKS ");

       scoreWindow.document.write("test score. Meeting minimum expectations on this test does <b>NOT</b> satisfy ");

       scoreWindow.document.write("the requirements set forth in Texas Education Code, Chapter 39, Subchapter B or the ");

       scoreWindow.document.write("exit level requirements for a high school diploma in Section 39.025.</td></tr></table>");

       scoreWindow.document.write("<hr>");

       scoreWindow.document.write("<table><tr><td valign=top></td><td>");

       scoreWindow.document.write("The results of the online versions of the ");

       scoreWindow.document.write("released TAKS tests are intended for personal use only. The Texas Education Agency (TEA) will ");

       scoreWindow.document.write("not collect or use the scores from the online version of the released tests for any purpose. ");

       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=\"Close Score Card\" 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 objectives.



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<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++;

              }

          }

}



//-->



