-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathpage3.php
97 lines (82 loc) · 2.4 KB
/
page3.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
<?php
/**
* Created by JetBrains PhpStorm.
* User: tjmonsi
* Date: 10/7/13
* Time: 3:59 PM
* To change this template use File | Settings | File Templates.
*/
if (!isset ($_COOKIE["interface"])) {
if (!empty($_POST)) {
$interface = $_POST["interface"];
setcookie("interface", $interface, time()+(3600*3));
//echo "hello";
} else {
header("Location: index.php");
/* Make sure that code below does not get executed when we redirect. */
exit;
}
} else {
$interface = $_COOKIE["interface"];
if (strcmp($interface, "acp")==0) {
$interface = "xwindow";
} else {
$interface = "acp";
}
}
if (!isset($_COOKIE["user"])){
$message = "Please use a username";
header("Location: index.php?message=".$message);
exit;
}
$user = $_COOKIE["user"];
require_once("external_files.php");
if (isset($_COOKIE["block"]) && isset($_COOKIE["max_blocks"])) {
$block_num = floatval($_COOKIE["block"]);
$block_num = $block_num+1;
$modular_num = intval($block_num);
$block_num = $block_num/2;
$block_num = round($block_num, 0, PHP_ROUND_HALF_UP);
$tasklist = $tasklist."_".$block_num;
if (($modular_num%2)==1) {
if (isset ($_COOKIE["interface"])) {
$interface = $_COOKIE["interface"];
if (strcmp($interface, "acp")==0) {
$interface = "acp";
} else {
$interface = "xwindow";
}
}
}
// echo $_COOKIE["block"]."\n";
// echo $_COOKIE["max_blocks"]."\n";
// echo intval($_COOKIE["max_blocks"])."\n";
// echo (intval($_COOKIE["max_blocks"])*2)." ";
// echo $block_num;
}
if (strcmp($interface, "acp")==0) {
$msg = "This is the instruction when using AutoComPaste Interface";
$acpflag = "true";
} else {
$msg = "This is the instruction when using XWindow Interface";
$acpflag = "false";
}
?>
<html>
<head>
<title>Experiment Run Template 1</title>
</head>
<body>
<div>
<p>
There should always be an instruction before doing the actual evaluation of the interface.
</p>
<p>
<?php echo $msg; ?>
</p>
<form action="interface1.php?user=<?php echo $user; ?>&acp=<?php echo $acpflag; ?>&data=<?php echo $data; ?>&jslist=<?php echo $jslist; ?>&tasklist=<?php echo $tasklist; ?>" method="post">
<input id="submit" type="submit" value="start">
</form>
</div>
</body>
</html>