'.$s.'');} function tdc($c,$s){echo('
'.$s.'
');} function std($s){return(''.$s.'');} function stdc($c,$s){return('
'.$s.'
');} function writequestion($n,$a) { echo(''); tdc('qnum',$n.'.'); tdc('qquest',$a[0]); echo(''); echo(''); for($t=0;$t'); tdc('qbutt',''); tdc('qans',$a[1][$t]); echo('');} echo('
'); echo('
'); } function showquestions($q) { echo('
'); echo(''); echo('
'.QUIZNAME.'
'); echo(''); for($t=1;$t'); echo('
'); echo('
'); } function writeanswer($n,$a,$ans) { $s=""; $s.='
'; $s.=''; $s.=stdc('qnum',$n.'.'); $s.=stdc('qquest',$a[0]); $s.=''; $s.=''; $r=0; for($t=0;$t' .$a[1][$t].' (wrong)';} else {$r=1;$ss=''.$a[1][$t].' (correct)';}} else {if($t!=$a[2]){$ss=''.$a[1][$t].'';} else {$ss=''.$a[1][$t].'';}} $s.=std($ss); $s.='';} $s.='
'; $s.='
'.$a[3].'
'; $ar[0]=$r; $ar[1]=$s; return $ar; } function showanswers($q) { echo('
'); echo(''); echo('
'.QUIZNAME.'
'); echo(''); $r=0;$ans=""; for($t=1;$t'); echo($ans); echo('
You achieved '.$r.' correct answers ('.round($r*100/(count($q)-1)).'%) of '.(count($q)-1).' questions.
'); echo('
'); } if(getvar("CMDSUBMIT"))showanswers($QUIZARRAY); else showquestions($QUIZARRAY); include("_footer.php"); ?>