<%@ LANGUAGE="VBSCRIPT" %>
<%
Set Obj = Server.CreateObject("WebHW.problem")
Obj.Problem_init
%>
<html>
<head>
<title>WebHW Problem</title>
<LINK REL=STYLESHEET HREF=<%= Session("VRoot") & "styles.css" %> TYPE="text/css">

<script language="JavaScript">
function prob_motion_diag(x_of_t1,x_of_t2,x_of_t3,ghosts){
    //This problem adapted from one originally scripted by Aaron Titus.
    document.animator.setAutoRefresh(false);
    document.animator.setDefault();
    document.animator.shiftPixOrigin(-230,0);
    document.animator.setPixPerUnit(5);
    document.animator.setGridUnit(2);
    if (x_of_t1 != '') {
         id=document.animator.addObject("circle","r=10,x="+x_of_t1+",y=10");
         document.animator.setRGB(id,0,0,255);
         if (ghosts!='false'){
              document.animator.setTrail(id,400);
              document.animator.setFootPrints(id,10);
              document.animator.setGhost(id,true);
             }
         tid=document.animator.addObject("text",
         "text=x=,calc=x,x=0,y=0");
         document.animator.setFont(tid,"Hevetica",1,10);
         document.animator.setAnimationSlave(id,tid);
         document.animator.setDisplayOffset(tid,-20,15);
         document.animator.setFormat(tid,"%-+3.2f");
         document.animator.setRGB(tid,0,0,255);
    }
    if (x_of_t2 != '') {
         id2=document.animator.addObject("circle","r=10,x="+x_of_t2+",y=0");
         document.animator.setRGB(id2,255,0,0);
         if (ghosts!='false'){
             document.animator.setTrail(id2,400);
             document.animator.setFootPrints(id2,10);
             document.animator.setGhost(id2,true);
        }
        tid=document.animator.addObject("text",
        "text=x=,calc=x,x=0,y=0");
       document.animator.setFont(tid,"Hevetica",1,10);
        document.animator.setAnimationSlave(id2,tid);
        document.animator.setDisplayOffset(tid,-20,15);
        document.animator.setFormat(tid,"%-+3.2f");
        document.animator.setRGB(tid,255,0,0);
    }
    if (x_of_t3 != '') {
         id3=document.animator.addObject("circle","r=10,x="+x_of_t3+",y=-10");
         document.animator.setRGB(id3,0,0,0);
         if (ghosts!='false'){
             document.animator.setTrail(id3,400);
             document.animator.setFootPrints(id3,10);
             document.animator.setGhost(id3,true);
         }
        tid=document.animator.addObject("text",
        "text=x=,calc=x,x=0,y=0");
        document.animator.setFont(tid,"Hevetica",1,10);
        document.animator.setAnimationSlave(id3,tid);
        document.animator.setDisplayOffset(tid,-20,15);
        document.animator.setFormat(tid,"%-+3.2f");
    }
    document.animator.setOneShot(0,9,"End of Animation");
    document.animator.setAutoRefresh(true);
}
</script>

</head>

<% 'Aaron is very clever - 90/9/9*t*t = (90/81)*t*t . This is a nice way to disguise the correct answer! %>
<% 'OK Aaron - check this out! %>

<% v0 = 9 + Session("R1")/10 + Session("R2")/100 %>
<body onload="prob_motion_diag('<%= v0 %>*t','9*<%= v0 %>/9/9*t*t','2*9*<%= v0 %>/9*t-9*<%= v0 %>/9/9*t*t','true','true')" >

<% Obj.Problem_Begin %>

<center>
<applet width="550" height="250" code="animator4.Animator.class"
codebase="<%= Session("VRoot")& "Physlet_classes" %>"
archive="Animator4_.jar,STools4.jar" align="baseline"
id="animator" name="animator">
<param name="FPS" value="10">
<param name="dt" value="0.1">
<param name="showControls" value="true">
</applet>
</center>
 

<p>Play the animation and answer the following questions (position and time in SI units):
<hr>
<p>Which puck has the greatest average velocity during the animation?

<% Obj.feedback_on "M1", "N1"%>
<%
Session("whw_M1_Choice1") = "blue"
Session("whw_M1_Choice2") = "red"
Session("whw_M1_Choice3") = "black"
Session("whw_M1_Choice4") = "the average velocity of all three pucks are equal"
Session("whw_M1_Answer") = 4
%>
<% Obj.Output_mc_question(1) %>

<p>What is this average velocity?
<% Session("whw_N1_Answer") = v0 %>
<% Obj.Output_numeric_question(1) %>m/s
<% Obj.feedback_on "N2"%>

<p>What is the acceleration of the blue puck?
<% Session("whw_N2_Answer") = 0 %>
<% Obj.Output_numeric_question(2) %>m/s<sup>2</sup>
<% Obj.feedback_on "N3"%>

<p>What is the acceleration of the red puck?
<% Session("whw_N3_Answer") = 2 * v0 / 9 %>
<% Obj.Output_numeric_question(3) %>m/s<sup>2</sup>
<% Obj.feedback_on "N4"%>

<p>What is the acceleration of the black puck?
<% Session("whw_N4_Answer") = -2 * v0 / 9 %>
<% Obj.Output_numeric_question(4) %>m/s<sup>2</sup>

<% Obj.Problem_End %>
<hr>
<% Obj.Problem_status %>
</body>
</html>