-
Notifications
You must be signed in to change notification settings - Fork 0
/
MathCode.php
executable file
·227 lines (200 loc) · 10.2 KB
/
MathCode.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
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
<?php
require('values.php');
require('functions.php');
session_start();
if(!isset($_SESSION['year']))
{
session_regenerate_id(true);
session_write_close();
header("Location:quarter.php");
}
if(!isset($_SESSION['ta_id']))
{
session_regenerate_id(true);
session_write_close();
header("Location:login.php");
}
if(isset($_POST['submit']) || isset($_POST['continue']))
{
$courses = $_POST['serial1'];
$times = $_POST['serial2'];
set_pref_values($_SESSION['ta_id'], $_POST['block'], $_POST['btb'], $_POST['sameday'], $_POST['ct']);
parse_courses($courses, $_SESSION['ta_id']);
parse_tods($times, $_SESSION['ta_id']);
if(isset($_POST['continue']))
{
// go to next page.
session_regenerate_id(true);
session_write_close();
header("Location:rankings.php");
exit();
}
}
if(isset($_POST['reset']))
{
reset_pref_TA($_SESSION['ta_id']);
}
?>
<!DOCTYPE html>
<html class="ui-mobile-nosupport-boxshadow ui-mobile landscape min-width-320px min-width-480px min-width-768px min-width-1024px"><head>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<meta name="viewport" content="width=device-width, minimum-scale=1, maximum-scale=1">
<title>UC Davis Mathematics :: TA Ranking</title>
<link rel="stylesheet" type="text/css" href="css/styles.css">
<link href="http://johnny.github.io/jquery-sortable/css/vendor.css" rel="stylesheet">
<link href="http://johnny.github.io/jquery-sortable/css/application.css" rel="stylesheet">
<link href="jQuery%20Sortable_files/vendor.css" rel="stylesheet">
<link href="jQuery%20Sortable_files/application.css" rel="stylesheet">
<link rel="stylesheet" href="test_files/css3menu13/style.css" type="text/css" /><style type="text/css">._css3m{display:none}</style>
<link rel="shortcut icon" href="icon.ico">
<script src="http://code.jquery.com/jquery.js"></script>
<script src="js/bootstrap.min.js"></script>
<script src="./jQuery Sortable_files/application.js"></script>
<!-- Site Header Content //-->
</head>
<?php title($_SESSION['ta_name']); ?>
<body>
<?php nav("MathCode.php");?>
<h3> <center> Please use the following form to <font color="red">rank</font> your preferences in courses and times </center></h3>
<br />
<div>
<p><b><center>Note: The following preferences are stored from previous quarters. You can reset them with the button at the bottom left of the page.</center></b> </p>
<br>
</div>
<div style="float:left;width:24%">
<h4>List of Courses <!--<i class="icon-info-sign" data-toggle="tooltip" data-title="Drag any of the following courses into the black box of preferred courses or disliked courses" id='example'></i>--></h4>
<div style="height:250px;line-height:3em;overflow:auto;padding:5px;">
<ol class="limited_drop_targets vertical">
<?php
populate_neutral_courses($_SESSION['ta_id'], $_SESSION['tadept'], $_SESSION['season'], $_SESSION['year']);
?>
</ol>
</div>
</div>
<div style="float:left;width:24%;margin-left:1%;" id="highlight">
<ol class="limited_drop_targets vertical" id="highlight"><br>
<h4>Courses you prefer to teach<br>(starting with most preferred)</h4>
<?php
populate_liked_courses($_SESSION['ta_id'], $_SESSION['tadept'], $_SESSION['season'], $_SESSION['year']);
?>
</ol> <br><br><br>
<ol style="margin-bottom: 10px" class="limited_drop_targets vertical" id="highlight">
<h4>Courses you prefer not to teach<br>(starting with least preferred)</h4>
<?php
populate_disliked_courses($_SESSION['ta_id'], $_SESSION['tadept'], $_SESSION['season'], $_SESSION['year']);
?>
</ol> <br><br><br>
</div>
<div style="float:left;width:25%;margin-left:1%;" id="highlight">
<ol class="simple_with_drop vertical" id="highlight"><br>
<h4>Times you prefer to teach<br>(starting with most preferred)</h4>
<?php
populate_liked_times($_SESSION['ta_id']);
?>
</ol> <br><br><br>
<ol class="simple_with_drop vertical" id="highlight">
<h4>Times you prefer not to teach<br>(starting with least preferred)</h4>
<?php
populate_disliked_times($_SESSION['ta_id']);
?>
</ol><br><br><br>
</div>
<div style="float:left;width:25%">
<h4>List of Times <!--<i class="icon-info-sign" data-toggle="tooltip" data-title="Drag any of the following times into the black box of preferred times or disliked times" id='example'></i>--></h4>
<div style="height:250px;line-height:3em;overflow:auto;padding:5px;">
<ol class="simple_with_drop vertical">
<?php
populate_neutral_times($_SESSION['ta_id']);
?>
</ol>
</div>
</div>
<br>
<br>
<HR style="visibility: hidden" WIDTH="100%" SIZE="3">
<HR WIDTH="100%" SIZE="3">
<!--
<p class="pos_right">Do you have an agreement or a conflict with any professors?
<a data-target="#myModal" role="button" class="btn" data-toggle="modal" style="margin: 20px">Yes</a></p>
-->
<div class="modal fade hide" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<h3 id="myModalLabel">Agreements and Conflicts</h3>
</div>
<div class="modal-body">
<th> Professor you have a prior agreement with: </th>
<select>
<?php populate_professors(); ?>
</select>
</div>
<div class="modal-body">
<th> Professor you have a conflict with: </th>
<select>
<?php populate_professors(); ?>
</select>
</div>
<div class="modal-footer">
<button class="btn btn-primary">Save changes</button>
</div>
</div>
<form name="prefs" id="prefs" action="MathCode.php" method="post">
<p class="pos_right">Which of the following best describes how you feel about teaching sections in the same course?
<!--<i class="icon-info-sign" data-toggle="tooltip" data-title="The term, 'block' is used to denote a group of sections that belong to the same course"></i>--><br>
<select id="block" name="block">
<option value="0" <?php print_pref_value("block", $_SESSION['ta_id'], "0") ?>>I am indifferent about whether my sections are of the same course or of different courses</option>
<option value="1" <?php print_pref_value("block", $_SESSION['ta_id'], "1") ?>>I prefer teaching multiple sections of the same course</option>
<option value="-1" <?php print_pref_value("block", $_SESSION['ta_id'], "-1") ?>>I would rather teach multiple sections of different courses</option>
</select> </p>
<p class="pos_right" style="display:none">Which of the following best describes how you feel about back-to-back classes?<br>
<select name="btb" id="btb" style="display:none">
<option value="0" <?php print_pref_value("back_to_back", $_SESSION['ta_id'], "0") ?>>I am indifferent about whether or not my classes are back-to-back</option>
<option value="1" <?php print_pref_value("back_to_back", $_SESSION['ta_id'], "1") ?>>I like my classes back-to-back</option>
<option value="-1" <?php print_pref_value("back_to_back", $_SESSION['ta_id'], "-1") ?>>I don't like my classes back-to-back</option>
</select> </p>
<p class="pos_right">Which of the following best describes how you feel about teaching sections on the same day?<br>
<select name="sameday" id="sameday" >
<option value="0" <?php print_pref_value("same_day",$_SESSION['ta_id'], "0") ?>>I am indifferent as to whether or not my TA assignments are on the same day</option>
<option value="1" <?php print_pref_value("same_day",$_SESSION['ta_id'], "1") ?>>I like my TA assignments on the same day</option>
<option value="-1" <?php print_pref_value("same_day",$_SESSION['ta_id'], "-1") ?>>I don't like my TA assignments on the same day</option>
</select></p>
<p class="pos_right">Which of the following best describes how you feel about your course preferences versus your time preferences?<br>
<select name="ct" id="ct" >
<option value="0"<?php print_pref_value("courses_vs_times",$_SESSION['ta_id'], "0") ?>>I am indifferent (I don't value courses over times or vice versa)</option>
<option value="2"<?php print_pref_value("courses_vs_times",$_SESSION['ta_id'], "2") ?>>I only care about courses (times will not be considered) </option>
<option value="1"<?php print_pref_value("courses_vs_times",$_SESSION['ta_id'], "1") ?>>I care about courses more than times (courses will be considered over times)</option>
<option value="-1"<?php print_pref_value("courses_vs_times",$_SESSION['ta_id'], "-1") ?>>I care about times more than courses (times will be considered over courses)</option>
<option value="-2"<?php print_pref_value("courses_vs_times",$_SESSION['ta_id'], "-2") ?>>I only care about times (courses will not be considered) </option>
</select></p>
<input id="serial1" name="serial1" type="hidden" />
<input id="serial2" name="serial2" type="hidden" />
<BR><BR>
<div>
<form id ="section" name="section" action="MathCode.php" method="post">
<input type="submit" name="reset" id="reset" class="selection_buttons" style="margin-left: 2%" value="Reset Preferences" />
</form>
<div id="buttons">
<input class="btn btn-primary btn-med btn-block" type="submit" name="submit" id="submit" value="Save" onclick="getSerialized()" />
<input class="btn btn-primary btn-med btn-block" type="submit" name="continue" id="continue" value="Continue" onclick="getSerialized()" />
</div>
</div>
</form>
<div id="serialize_output"></div>
<div id="serialize_output2"></div>
<script src="js/serialize.js"></script>
<script>
/*
$(document).ready(function() {
$('#example').tooltip();
});
}*/
function toggle(button)
{
if(document.getElementById("1").value=="OFF"){
document.getElementById("1").value="ON";}
else if(document.getElementById("1").value=="ON"){
document.getElementById("1").value="OFF";}
}
</script>
</body></html>