forked from jerieljan/Ethics-Poll
-
Notifications
You must be signed in to change notification settings - Fork 17
/
Copy pathdefault.php
41 lines (31 loc) · 978 Bytes
/
default.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
<html>
<?php
require "config.php";
require "functions.php";
$q = simplexml_load_file("data.xml");
?>
<head>
<title><?php echo $q->start->title;?></title>
<link rel="stylesheet" type="text/css" href="stylesheet.css" />
</head>
<body>
<!-- Intro -->
<h1><?php echo $q->start->title;?></h1>
<p><?php echo $q->start->subtext;?></p>
<hr>
<form method="POST" action="results.php">
<p><?php if ($getPersonalInfo == true) askPersonalInfo(); echo "<hr>"?>
<!-- Present Questions -->
<?php for ($i = 0; $i < sizeof($q->scenario); $i++) { ?>
<div id="<?php echo "item" . $i; ?>" class="question">
<h2>Question # <?php echo ($i+1) . " : " . $q->scenario[$i]->title;?></h1>
<p><?php echo $q->scenario[$i]->text;?></p>
<?php for ($j = 0; $j < count($questions); $j++) {
echo "<p>"; ask($q->scenario[$i]->action, $i, $questions[$j]);
} ?>
</div>
<?php } ?>
<input type="submit"/>
</form>
</body>
</html>