-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathupload-assignment.html
191 lines (170 loc) · 9.75 KB
/
upload-assignment.html
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<script src="https://kit.fontawesome.com/64d58efce2.js" crossorigin="anonymous"></script>
<link rel="apple-touch-icon" sizes="180x180" href="img/favicon/apple-touch-icon.png">
<link rel="icon" type="image/png" sizes="32x32" href="img/favicon/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="16x16" href="img/favicon/favicon-16x16.png">
<!-- CSS -->
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css"
integrity="sha384-TX8t27EcRE3e/ihU7zmQxVncDAy5uIKz4rEkgIXeMed4M0jlfIDPvg6uqKI2xXr2" crossorigin="anonymous">
<!-- Filepond stylesheet -->
<link href="https://unpkg.com/filepond/dist/filepond.css" rel="stylesheet">
<link rel="stylesheet" href="css/upload-assignment.css">
<link rel="stylesheet" href="css/loader.css">
<link href="https://cdnjs.cloudflare.com/ajax/libs/select2/4.0.13/css/select2.min.css" rel="stylesheet">
<title>DM874 - Autograder</title>
</head>
<body>
<div id="loader" class="loadingio-spinner-spinner-hqnakeojhrn">
<div class="ldio-jaf08a4nsf9">
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
</div>
</div>
<header class="bg-dark">
<div class="container">
<input type="checkbox" name="" id="check">
<div class="logo-container" style="margin-top: 5px;">
<img class="header-logo" src="img/logo.png" alt="logo" />
<h3 class="logo">Auto<span>Grader</span></h3>
</div>
<div class="nav-btn">
<div id="username">Hi</div>
<div class="log-sign" style="--i: 1.8s">
<button class="btn log-out" onclick="logout(event)"> log out </button>
<!-- <a href="index.html" class="btn solid">Sign up</a> -->
</div>
</div>
<div class="hamburger-menu-container">
<div class="hamburger-menu">
<div></div>
</div>
</div>
</div>
</header>
<main>
<section>
<div class="overlay">
<div class="container-fluid">
<div class="row">
<!-- <div class="col-md-12"> -->
<!-- <div class="row"> -->
<div class="col-md-12 justify-content-center text-center border-dark border-5"
style="background-color: lavender;">
<div class="jumbotron card card-block h-75 bg-transparent border-0 pb-2">
<h2 class="pb-4 text-left">
Upload New Assignment
</h2>
<form id="make-assignment" class="col-md-8 text-center">
<div class="form-group row">
<label for="inputEmail3" class="col-sm-2 col-form-label">Name</label>
<div class="col-sm-10">
<input type="text" class="form-control" name="title" id="title" placeholder="Assignment Name" required>
</div>
</div>
<div class="form-group row">
<label for="inputEmail3" class="col-sm-2 col-form-label">Course</label>
<div class="col-sm-10">
<div class="mb-3 mt-3">
<select id="course_id" name="course" class="form-control select2"></select>
</div>
</div>
</div>
<div class="form-group row">
<label for="inputEmail3" class="col-2 col-form-label">PDF File</label>
<div class="col-sm-10">
<input type="file" class="form-control-file" name="test" id="input-pdf-file" required>
</div>
</div>
<div class="form-group row">
<label for="inputEmail3" class="col-sm-2 col-form-label">Due date</label>
<div class="col-sm-10">
<input type="datetime-local" class="form-control" name="course" id="due-date" required>
</div>
</div>
<div class="form-group row">
<label for="inputEmail3" class="col-sm-2 col-form-label">Timeout</label>
<div class="col-sm-10">
<input type="number" class="form-control" min="0" name="timeout" id="timeout" placeholder="Time limit for solution runtime (in seconds)">
</div>
</div>
<div class="form-group row">
<label for="inputEmail3" class="pt-3 col-2 col-form-label"> Assignment Type</label>
<div class="col-sm-10">
<div class="control-group">
<div class="control_indicator"></div>
<label class="control control-radio">
Public
<input type="radio" name="radio" value="1" />
<div class="control_indicator"></div>
</label>
<label class="control control-radio">
Private
<input type="radio" name="radio" value="0"/>
<div class="control_indicator"></div>
</label>
</div>
</div>
</div>
<div class="form-group row">
<div class="col-sm-10">
<button type="submit" class="btn btn-success"><i class="fas fa-plus-circle pr-2"></i>Upload </button>
</div>
</div>
</form>
</div>
</div>
<!-- </div> -->
<!-- </div> -->
</div>
</div>
</div>
</section>
</main>
<script src="https://unpkg.com/axios/dist/axios.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/sweetalert2@10"></script>
<!-- jQuery and JS bundle w/ Popper.js -->
<script src="https://code.jquery.com/jquery-3.5.1.slim.min.js"
integrity="sha384-DfXdz2htPH0lsSSs5nCTpuj/zy4C+OGpamoFVy38MVBnE+IbbVYUew+OrCXaRkfj"
crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js"
integrity="sha384-ho+j7jyWK8fNQe+A12Hb8AhRq26LrZ/JpcUGGOn+Y7RsweNrtN/tE3MoK7ZeZDyx"
crossorigin="anonymous"></script>
<script src="https://code.jquery.com/jquery-3.2.1.min.js"></script>
<script src="js/upload-assignment.js" defer></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/select2/4.0.13/js/select2.full.min.js"></script>
<script>
config = {
method: "get",
url: `https://course.simplebar.dk/api/me`,
headers: {
Authorization: `Bearer ${sessionStorage.getItem("token")}`,
},
};
axios(config)
.then(function (response) {
let courses = [];
$.each(response['data']['courses'], function( index, course ) {
courses.push({'id': course['id'], 'text': course['title']});
});
$('#course_id').select2({
data: courses
});
});
</script>
</body>
</html>