Skip to content

Commit c26d4a5

Browse files
committed
Lab assignments page
1 parent c4529e7 commit c26d4a5

File tree

4 files changed

+142
-0
lines changed

4 files changed

+142
-0
lines changed

.DS_Store

0 Bytes
Binary file not shown.

js/lab_assignments.js

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
/* File: admissions.js
2+
* -------------------
3+
* Distribute lab assignments to students.
4+
*
5+
* Revision History:
6+
* @coopermj 1-14-2020 Created the file.
7+
*/
8+
9+
$(document).ready(function() {
10+
var codes = {
11+
'coopermj': 'Parth',
12+
'cmoffitt': 'Alex',
13+
'anhtle': 'Andrew',
14+
'ftarke': 'Andrew',
15+
'helenav': 'Andrew',
16+
'iogalle': 'Andrew',
17+
'jmgeller': 'Andrew',
18+
'monaavr': 'Andrew',
19+
'nathgoh': 'Andrew',
20+
'aaseev': 'Antonio',
21+
'avidesh': 'Antonio',
22+
'elizfitz': 'Antonio',
23+
'erickha': 'Antonio',
24+
'gsheen': 'Antonio',
25+
'mateoae': 'Antonio',
26+
'rubensan': 'Antonio',
27+
'cperez8': 'Antonio',
28+
'emarx1': 'Sam',
29+
'k99397': 'Sam',
30+
'emily2h': 'Sam',
31+
'jinal': 'Sam',
32+
'josencf': 'Sam',
33+
'joshuaoj': 'Sam',
34+
'leilimor': 'Sam',
35+
'ajarno': 'Sam',
36+
'snhoward': 'Sam',
37+
'jcorbin': 'Theo',
38+
'jgilb': 'Theo',
39+
'lindseye': 'Theo',
40+
'mdqin': 'Theo',
41+
'mpike27': 'Theo',
42+
'yaronks': 'Theo',
43+
'dylanly9': 'Theo',
44+
'nicole01': 'Theo',
45+
'danielmq': 'Zheng',
46+
'dannydu': 'Zheng',
47+
'deirdre3': 'Zheng',
48+
'echoe720': 'Zheng',
49+
'lilyjune': 'Zheng',
50+
'rose2': 'Zheng',
51+
'nbuday': 'Zheng',
52+
}
53+
54+
$("#search-form").submit(function(event) {
55+
var $output = $("#code")
56+
$output.text("Searching...");
57+
58+
var $input = $("#sunet");
59+
var sunet = $input.val();
60+
if (!sunet) {
61+
$output.text("Please enter your SUNet ID...");
62+
} else {
63+
var code = codes[sunet];
64+
if (code === undefined) {
65+
$output.text("No assigned TA found for SUNet ID '" + sunet + "'. Please send Michael or Parth an email or make a priavte Piazza post.");
66+
} else {
67+
$output.text("Hello " + sunet + "! Your assigned lab TA is " + code + "! Have a blast in lab!");
68+
}
69+
}
70+
71+
// Stop the real form from submitting
72+
event.preventDefault();
73+
});
74+
});

lab_assignments.html

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
<!--
2+
File: admissions.html
3+
4+
Distribute enrollment codes to students
5+
6+
Revision History:
7+
@sredmond removed splash page
8+
@sredmond updated for spr16 (3-27-2016)
9+
@skleung created (aut 15)
10+
-->
11+
<!DOCTYPE html>
12+
<html lang="en">
13+
<head>
14+
<meta charset="utf-8">
15+
<!-- Global site tag (gtag.js) - Google Analytics -->
16+
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-54146031-2"></script>
17+
<script>
18+
window.dataLayer = window.dataLayer || [];
19+
function gtag(){dataLayer.push(arguments);}
20+
gtag('js', new Date());
21+
22+
gtag('config', 'UA-54146031-2');
23+
</script>
24+
<!-- End Global site tag -->
25+
<title>CS41 - The Python Programming Language</title>
26+
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
27+
28+
<!-- Begin Favicon -->
29+
<link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png?v=M4ol3E40gd">
30+
<link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png?v=M4ol3E40gd">
31+
<link rel="icon" type="image/png" sizes="16x16" href="/favicon-16x16.png?v=M4ol3E40gd">
32+
<link rel="manifest" href="/manifest.json?v=M4ol3E40gd">
33+
<link rel="mask-icon" href="/safari-pinned-tab.svg?v=M4ol3E40gd" color="#5bbad5">
34+
<link rel="shortcut icon" href="/favicon.ico?v=M4ol3E40gd">
35+
<meta name="theme-color" content="#ffffff">
36+
<!-- End Favicon -->
37+
38+
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css" media="screen">
39+
<link rel="stylesheet" href="css/bootswatch/paper.css">
40+
<link rel="stylesheet" href="css/styles.css">
41+
<!-- HTML5 shim? -->
42+
</head>
43+
<body>
44+
<ul class="pages">
45+
<li class="page">
46+
<div class="container">
47+
<div class="row">
48+
<h2>CS 41 Section Assignments!</h2>
49+
50+
<form id="search-form">
51+
<div class="form-group">
52+
<label for="sunet">Enter your SUNet ID</label>
53+
<input type="text" class="form-control" id="sunet" name="sunetid" type="text" size="12" maxlength="8" autofocus="autofocus" pattern="^[a-zA-Z0-9_.-]{2,14}$" placeholder="e.g. coopermj">
54+
</div>
55+
<button type="" class="btn btn-default" id="submit">Submit</button>
56+
</form>
57+
<br>
58+
<span id="code"></span>
59+
</div>
60+
</div>
61+
</li>
62+
</ul>
63+
<!-- Scripts placed at the bottom of the page for faster loading -->
64+
<script type="text/javascript" src="https://code.jquery.com/jquery-1.12.1.min.js"></script>
65+
<script type="text/javascript" src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js"></script>
66+
<script type="text/javascript" src="js/lab_assignments.js"></script>
67+
</body>
68+
</html>

res/.DS_Store

0 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)