# version 2.july232005
# post version not work at thaiall.com
#
if (isset($_GET["show"])) { show($_GET["show"],$_GET["i"]); exit;}
if (!isset($_POST["no"])) home();
if (!isset($_POST["seed"])) $_POST["seed"] = time();
if (isset($_POST["next"])) $_POST["no"]++;
### === for first
if ($_POST["no"] == 1) {
srand($_POST["seed"]);
for($a = "a"; $a <= "i"; $a++) $_POST["a".$a] = "";
$q = file("qjava10txt.zip");
$qo = $q;
for($a = "a"; $a <= "i"; $a++) {
$c = 0;
foreach ($q as $v) if (substr($v,1,1) == $a) $c++;
$s = (rand() % $c) + 1;
$i = 1;
foreach ($q as $v) {
if (substr($v,1,1) == $a) {
if ($i == $s) {
$ar = split("t",$v);
$_POST["q".$a] = $v;
}
$i++;
}
}
}
} else
### === for not first (keep answer)
for($i=1,$a="a"; $a <= "i"; $a++,$i++) {
$_POST["q".$a] = urldecode($_POST["q".$a]);
}
if (isset($_POST[$_POST["q"]]))
$_POST["a".$_POST["q"]] = $_POST[$_POST["q"]];
else {
for($i = 1; $i <= 9; $i++)
if (isset($_POST[$_POST["q"].$i])) {
if (strlen($_POST["a".$_POST["q"]]) > 0) $_POST["a".$_POST["q"]].=",";
$_POST["a".$_POST["q"]] = $_POST["a".$_POST["q"]] . $_POST[$_POST["q"].$i];
}
}
### === for last
if ($_POST["no"] == 10) {
$sess{'a'} = "Declarations and Access Control";
$sess{'b'} = "Flow Control, Assertions and Exception Handling";
$sess{'c'} = "Gargage Collection";
$sess{'d'} = "Language Fundamentals";
$sess{'e'} = "Operators and Assignments";
$sess{'f'} = "Overloading, Overriding, Runtime Type and Object Orientation";
$sess{'g'} = "Threads";
$sess{'h'} = "Fundamental Classes in the java.lang package";
$sess{'i'} = "The Collections Framework";
$i = 1;
$correct = 0;
echo "
";
echo "No. | Session | Correct Answer | Your Answer | Score | ";
for($a = "a"; $a <= "i"; $a++) {
$ar1 = split("n",$_POST["q".$a]);
$arn = split("r",$ar1[0]);
$ar = split("t",$arn[0]);
echo "$i | ". $sess{$a} ." | ". $ar[2] ." | ".$_POST["a".$a]." | ";
if ($ar[2] == $_POST["a".$a]) {
echo "100%";
$correct++;
} else echo "0%";
echo " | ";
$i++;
}
echo "Total Score | ". $correct / 9 * 100 ."% | ";
echo " ";
echo "You can use back and forward for this version.
Session version are not allow to use back and forward.";
echo " Click for Session version";
} else {
### === for next
for($i=1,$a="a"; $a <= "i"; $a++,$i++) {
if ($i == $_POST["no"]) show($a,$i);
} // for $a
} // if 11
?>
|
footer(); ?>
|