rendered paste body<?php
session_start();
$rootdir = "../";
include($rootdir."functions/rounded_number2.inc.php");
/*
Key:
SL = sum of 3, 5, 9, 11, 1*, 6*, 7*, 15*
SC = sum of 2, 4, 12, 14, 8*, 10*, 13*, 16*
*reverse-scored (6 minus score)
*/
$sl = $_SESSION['response'][7]['answer'] + $_SESSION['response'][9]['answer'] + $_SESSION['response'][13]['answer'] + $_SESSION['response'][15]['answer'];
$sc = $_SESSION['response'][6]['answer'] + $_SESSION['response'][8]['answer'] + $_SESSION['response'][16]['answer'] + $_SESSION['response'][18]['answer'];
$slreverse = (6 - $_SESSION['response'][5]['answer']) + (6 - $_SESSION['response'][10]['answer']) + (6 - $_SESSION['response'][11]['answer']) + (6 - $_SESSION['response'][19]['answer']);
$screverse = (6 - $_SESSION['response'][12]['answer']) + (6 - $_SESSION['response'][14]['answer']) + (6 - $_SESSION['response'][17]['answer']) + (6 - $_SESSION['response'][20]['answer']);
$sl = $sl + $slreverse;
$sc = $sc + $screverse;
$x = $sl;
$y = $sc;
if($sc > $sl)
{
$prediction = 1;
}else
{
$prediction = 0;
}
if($_REQUEST['chosen'] == $prediction)
{
$comparison = 1;
}else
{
$comparison = 0;
}
$resolution = 446/32;
$left1 = $resolution * $sl;
$left2 = $resolution * $sc;
$left1 = RoundedNumber($left1);
$left2 = RoundedNumber($left2);
include($rootdir."functions/mk_callback.inc.php");
include($rootdir."functions/fileimport.inc.php");
$outputfile = ($rootdir."log/data/xquest_ac_output.dat");
$output = dataimport($outputfile, 10000, 'mk_callback');
?>
<html>
<head>
<?php
// pfad zum wurzelverzeichnis
$rootdir="../";
// stylesheet
include($rootdir."/css/output_css.inc.php");
// log access --> ende
include($rootdir."log/logfile_end_func.inc.php");
// counter --> ende
if(file_exists("../log/counter_end.txt")){
$fp=fopen("../log/counter_end.txt","r+");
$count=fgets($fp,6);
$count++;
rewind($fp);
fputs($fp,$count,6);
fclose($fp);
}else{
$fp=fopen("../log/counter_end.txt","w");
$count="1";
fputs($fp,$count,6);
fclose($fp);
}
// session zerstoeren
session_destroy();
?>
<title>Freie Universität Berlin</title>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<meta name="author" content="Björn Busse">
<meta name="copyright" content="Björn Busse">
<meta name="keywords" lang="de" content="">
<meta name="generator" content="handmade bye [m[u]e]">
<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">
<meta http-equiv="content-language" content="de">
<meta http-equiv="expires" content="0">
<meta http-equiv="pragma" content="no-cache">
</head>
<body>
<script type="text/javascript" src="../js/wz_dragdrop.js">
</script>
<div class="bg">
<?php
echo "
<table class=\"indextxt\" width=\"100%\" height=\"100%\" border=\"0\" bgcolor=\"FFFFFF\">
<tr>
<td width=\"100%\" colspan=\"3\"></td>
</tr>
<tr>
<td colspan=\"3\" style=\"margin-left:20px;\" align=\"center\">
<b>".$output[0][0]."</b>
<br>";
if($x > 4)
{
echo $output[1][0];
}elseif($x > 1 and $x < 4)
{
echo $output[2][0];
}elseif($x < 1 and $x > -1)
{
echo $output[3][0];
}elseif($x > -4 and $x < -1)
{
echo $output[4][0];
}elseif($x < -4)
{
echo $output[5][0];
}
echo "
</td>
</tr>
<tr>
<td colspan=\"3\" align=\"center\">
<br><br><b>".$output[7][0]."</b>
<script type=\"text/javascript\">
<!--
SET_DHTML(\"vertikalelinie1\"+MAXOFFLEFT+".$left2."+HORIZONTAL+CURSOR_HAND);
dd.elements.vertikalelinie1.setDropFunc(dropf);
-->
</script>
<br>";
if($y > 0.3)
{
echo $output[8][0];
}elseif($y < -0.3)
{
echo $output[9][0];
}elseif($y < 0.3 and $y > -0.3)
{
echo $output[10][0];
}
echo "
</td>
</tr>
<tr>
<td width=\"100%\" colspan=\"3\" align=\"center\">
".$output[12][0]." ";
if($y > 0.3)
{
echo $output[13][0];
}elseif($y < -0.3)
{
echo $output[14][0];
}
echo "
".$output[16][0]."<br>";
if($_REQUEST['chosen'] == 0)
{
echo $output[17][0]."<br>";
}elseif($_REQUEST['chosen'] == 1)
{
echo $output[18][0];
}
if($comparison == 0)
{
echo $output[21][0];
}elseif($comparison == 1)
{
echo "<br><br><br>".$output[20][0];
}
echo "
</td>
</tr>
<tr>
<td colspan=\"3\" align=\"center\">
<font size=\"6\"><br><br>Vielen Dank für Ihre Teilnahme!</font>
<br>
<p align=\"center\"><a href=\"http://attrac.earthtomoon.net\">zurück zum Start</a></p>
</td>
</tr>
</table>
</div>
</body>
</html>";
/*
echo $left1." ".$right1."<br>";
echo $left2." ".$right2."<br>";
*/
?>