-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsurvey.php
More file actions
58 lines (52 loc) · 1.9 KB
/
survey.php
File metadata and controls
58 lines (52 loc) · 1.9 KB
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
<?php
include_once('includes/functions.php');
$show_intro = false;
$show_outro = false;
$query = '';
if (survey_started()) {
$query = current_query();
if ($_POST['query'] and $_POST['choice']) {
log_choice(session_id(), $_POST['query'], $_POST['choice']);
// Continue survey
$query = next_query();
}
if (survey_finished()) {
$show_outro = true;
}
}
elseif ($_POST['begin']) {
load_queries();
$query = current_query();
}
else {
$show_intro = true;
}
?>
<html>
<head>
<title>Search Survey</title>
<link rel="stylesheet" type="text/css" href="main.css" />
<!--[if IE]>
<link rel="stylesheet" type="text/css" href="ie.css" />
<![endif]-->
</head>
<body>
<h1>Search Survey</h1>
<?php if ($show_intro): ?>
<p>Thank you for expressing interest in helping the University of Florida with its Web site search service. In this survey, you will be asked to compare search results for <?php echo htmlspecialchars(UFL_SEARCH_MAX_QUERIES); ?> quer<?php echo (UFL_SEARCH_MAX_QUERIES == 1 ? 'y' : 'ies'); ?> and choose the set you think is better. Please use your best judgment if you run across a query that you are not familiar with.</p>
<p>Note: Your choices are completely anonymous.</p>
<form method="post">
<input type="submit" name="begin" value="Start Survey" />
</form>
<?php elseif ($show_outro): ?>
<p>Thanks for participating! Your selections have been recorded.</p>
<p>We will be using your data in the future as we perform upgrades to the <a href="http://www.ufl.edu/">University of Florida</a> <a href="http://search.ufl.edu/">Web site search service</a>.</p>
<?php elseif ($query): ?>
<h2><?php echo htmlspecialchars(survey_progress()); ?></h2>
<h3>Query: <em><?php echo htmlspecialchars($query); ?></em></h3>
<?php display_ui($query); ?>
<?php else: ?>
<p>Error</p>
<?php endif; ?>
</body>
</html>