session_start();
#GLOBAL CONSTANTS
include("mysql.php"); //include all mysql constants (abstracted for ease of migration)
$nextQuestionURL = "question008.php"; //location of next question, tutorial, or end-of-test page.
$flag=0;
#ANSWER SUBMITTED -- Hanndles the case that this question has been answered.
if(!isset($_POST['certainty'])){$certainty=9;}
else {$certainty=$_POST['certainty'];}
if(isset($_POST['answer23'])){
//Connect to db
mysql_connect($mysqlURL,$mysqlUser,$mysqlPass);
mysql_select_db($mysqlDatabase);
//Question Update Database Queries -- $answerKey[questionNumber]=questionAnswer;
$answerKey=array(); //create fresh array
$answerKey[23]=$_POST['answer23'];
#MYSQL -- This checks for existing answers in the database, then adds each of the student's answers.
foreach($answerKey as $question=>$answer){
//Check the answer hasn't already been submitted.
$testQuery=mysql_query("select count(id) as c from ".$mysqlAnswerTable." where sn=".$_SESSION['sn']." and question=".$question);
if(mysql_error()){ echo "Please report this to the administrator: ".mysql_error(); die; }
if(mysql_result($testQuery,0,'c')!=0) {mysql_close();
header("location:".$nextQuestionURL);
die();
};
$query="insert into ".$mysqlAnswerTable."(sn,course,question,answer,certainty,tstamp) values('".mysql_escape_string($_SESSION['sn'])."','".mysql_escape_string($_SESSION['course'])."',".$question.",".$answer.",".$certainty.",".time().")";
mysql_query($query);
if(mysql_error()){ echo "Please report this to the administrator: ".mysql_error(); die; }
}
//Go to the next question.
mysql_close();
header("location:".$nextQuestionURL);
die();
}
else if(isset($_POST['Submit'])) $flag=1;
?>
A boy throws a steel ball straight up. Disregarding any effects of air resistance, the force(s) acting on the ball until it returns to the ground is (are):
A. Its weight vertically downward along with a steadily decreasing upward force.
B. A steadily decreasing upward force from the moment it leaves the hand until it reaches its highest point, beyond which there is a steadily increasing downward force of gravity as the object gets closer to the earth.
C. A constant downward force of gravity along with an upward force that steadily decreases until the ball reaches its highest point, after which there is only the constant downward force of gravity.
D. A constant downward force of gravity only.
E. None of the above, the ball falls back down to the earth simply because that is its natural action.