roshnn24 commited on
Commit
9a04770
1 Parent(s): 139d2c4

Update templates/teacher_eval.html

Browse files
Files changed (1) hide show
  1. templates/teacher_eval.html +96 -53
templates/teacher_eval.html CHANGED
@@ -15,6 +15,7 @@
15
  --input-bg: #fff;
16
  --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
17
  }
 
18
  body {
19
  font-family: 'Roboto', Arial, sans-serif;
20
  line-height: 1.6;
@@ -24,6 +25,7 @@
24
  position: relative;
25
  background-color: var(--background-color);
26
  }
 
27
  .background-video {
28
  position: fixed;
29
  top: 0;
@@ -33,57 +35,33 @@
33
  object-fit: cover;
34
  z-index: -1;
35
  }
 
36
  .header {
37
  background-color: var(--secondary-color);
38
  padding: 20px 0;
39
  text-align: center;
40
  }
41
- .back-button {
42
- position: fixed;
43
- top: 20px;
44
- left: 20px;
45
- background-color: #3498db;
46
- color: white;
47
- border: none;
48
- border-radius: 50%;
49
- width: 50px;
50
- height: 50px;
51
- font-size: 24px;
52
- cursor: pointer;
53
- transition: all 0.3s ease;
54
- box-shadow: 0 2px 5px rgba(0,0,0,0.2);
55
- display: flex;
56
- justify-content: center;
57
- align-items: center;
58
- text-decoration: none;
59
- }
60
- .back-button:hover {
61
- background-color: #2980b9;
62
- transform: scale(1.1);
63
- }
64
- .back-button i {
65
- transition: transform 0.3s ease;
66
- }
67
- .back-button:hover i {
68
- transform: translateX(-5px);
69
- }
70
  .logo {
71
  display: flex;
72
  justify-content: center;
73
  align-items: center;
74
  margin-bottom: 10px;
75
  }
 
76
  .logo i {
77
  font-size: 2.5em;
78
  color: var(--primary-color);
79
  margin-right: 10px;
80
  }
 
81
  h1 {
82
  color: #fff;
83
  font-size: 2.5em;
84
  margin: 0;
85
  text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
86
  }
 
87
  .container {
88
  max-width: 800px;
89
  margin: 40px auto;
@@ -94,15 +72,18 @@
94
  position: relative;
95
  z-index: 1;
96
  }
 
97
  form {
98
  display: grid;
99
  gap: 20px;
100
  }
 
101
  label {
102
  font-weight: 500;
103
  margin-bottom: 5px;
104
  color: var(--secondary-color);
105
  }
 
106
  select, input[type="text"], textarea {
107
  width: 100%;
108
  padding: 12px;
@@ -112,11 +93,13 @@
112
  font-size: 16px;
113
  transition: border-color 0.3s, box-shadow 0.3s;
114
  }
 
115
  select:focus, input[type="text"]:focus, textarea:focus {
116
  outline: none;
117
  border-color: var(--primary-color);
118
  box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
119
  }
 
120
  input[type="submit"] {
121
  background-color: var(--primary-color);
122
  color: #fff;
@@ -128,10 +111,13 @@
128
  font-weight: 500;
129
  transition: background-color 0.3s, transform 0.1s;
130
  }
 
 
131
  input[type="submit"]:hover {
132
  background-color: #2980b9;
133
  transform: translateY(-2px);
134
  }
 
135
  .input-section {
136
  display: none;
137
  background-color: rgba(249, 249, 249, 0.8);
@@ -139,32 +125,40 @@
139
  border-radius: 4px;
140
  border: 1px solid #e0e0e0;
141
  }
 
142
  #max-marks-section {
143
  margin-top: 20px;
144
  }
 
145
  .icon-input {
146
  display: flex;
147
  align-items: center;
148
  position: relative;
149
  }
 
150
  .icon-input i {
151
  margin-right: 10px;
152
  color: var(--secondary-color);
153
  }
 
154
  .icon-input input, .icon-input select, .icon-input textarea {
155
  flex: 1;
156
  }
 
157
  .input-section .icon-input {
158
  margin-bottom: 20px;
159
  }
 
160
  .input-section label {
161
  display: block;
162
  margin-bottom: 5px;
163
  font-weight: bold;
164
  }
 
165
  .input-section input[type="file"] {
166
  height: 40px;
167
  }
 
168
  input[type="file"] {
169
  border: 1px solid #ddd;
170
  border-radius: 4px;
@@ -173,26 +167,6 @@
173
  width: 100%;
174
  box-sizing: border-box;
175
  }
176
- input[type="file"]::-webkit-file-upload-button {
177
- visibility: hidden;
178
- width: 0;
179
- }
180
- input[type="file"]::before {
181
- content: 'Choose file';
182
- display: inline-block;
183
- background: var(--primary-color);
184
- color: #fff;
185
- border-radius: 3px;
186
- padding: 5px 8px;
187
- outline: none;
188
- white-space: nowrap;
189
- cursor: pointer;
190
- font-weight: 700;
191
- font-size: 10pt;
192
- }
193
- input[type="file"]:hover::before {
194
- background-color: #2980b9;
195
- }
196
  .drive-link-container {
197
  position: fixed;
198
  top: 20px;
@@ -225,6 +199,48 @@
225
  .drive-link-button:hover {
226
  background-color: #2980b9;
227
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
228
  @media (max-width: 600px) {
229
  .container {
230
  padding: 20px;
@@ -263,6 +279,7 @@
263
  </style>
264
  </head>
265
  <body>
 
266
  <video class="background-video" autoplay loop muted playsinline>
267
  <source src="../static/Eval.mp4" type="video/mp4">
268
  <source src="../static/Eval.webm" type="video/webm">
@@ -278,19 +295,17 @@
278
  <a href="teacher" class="back-button" title="Back to Home">
279
  <i class="fas fa-arrow-left"></i>
280
  </a>
281
-
282
  <div class="drive-link-container">
283
  <p>We have used the following documents in the demo video, which are given in the drive link. You can use your own docs also.</p>
284
  <a href="https://drive.google.com/drive/folders/10NI8gwA16V1wc57a8I4AtRcXU0NG4hzD?usp=drive_link" class="drive-link-button" target="_blank">Sample documents</a>
285
  </div>
286
-
287
  <div id="loading-overlay">
288
  <div class="spinner"></div>
289
  <p class="loading-text">Evaluating answers...</p>
290
  </div>
291
 
292
  <div class="container">
293
- <form action="/eval" method="post" enctype="multipart/form-data" onsubmit="showLoading()">
294
  <div class="icon-input">
295
  <i class="fas fa-clipboard-list"></i>
296
  <select name="input_type" id="input_type" onchange="showInputForm()">
@@ -333,6 +348,14 @@
333
 
334
  <input type="submit" value="Submit and Evaluate">
335
  </form>
 
 
 
 
 
 
 
 
336
  </div>
337
 
338
  <script>
@@ -342,9 +365,29 @@
342
  document.getElementById('text-input').style.display = inputType === 'text' ? 'block' : 'none';
343
  }
344
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
345
  function showLoading() {
346
  document.getElementById('loading-overlay').style.display = 'flex';
347
  }
348
  </script>
349
  </body>
350
- </html>
 
15
  --input-bg: #fff;
16
  --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
17
  }
18
+
19
  body {
20
  font-family: 'Roboto', Arial, sans-serif;
21
  line-height: 1.6;
 
25
  position: relative;
26
  background-color: var(--background-color);
27
  }
28
+
29
  .background-video {
30
  position: fixed;
31
  top: 0;
 
35
  object-fit: cover;
36
  z-index: -1;
37
  }
38
+
39
  .header {
40
  background-color: var(--secondary-color);
41
  padding: 20px 0;
42
  text-align: center;
43
  }
44
+
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
45
  .logo {
46
  display: flex;
47
  justify-content: center;
48
  align-items: center;
49
  margin-bottom: 10px;
50
  }
51
+
52
  .logo i {
53
  font-size: 2.5em;
54
  color: var(--primary-color);
55
  margin-right: 10px;
56
  }
57
+
58
  h1 {
59
  color: #fff;
60
  font-size: 2.5em;
61
  margin: 0;
62
  text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
63
  }
64
+
65
  .container {
66
  max-width: 800px;
67
  margin: 40px auto;
 
72
  position: relative;
73
  z-index: 1;
74
  }
75
+
76
  form {
77
  display: grid;
78
  gap: 20px;
79
  }
80
+
81
  label {
82
  font-weight: 500;
83
  margin-bottom: 5px;
84
  color: var(--secondary-color);
85
  }
86
+
87
  select, input[type="text"], textarea {
88
  width: 100%;
89
  padding: 12px;
 
93
  font-size: 16px;
94
  transition: border-color 0.3s, box-shadow 0.3s;
95
  }
96
+
97
  select:focus, input[type="text"]:focus, textarea:focus {
98
  outline: none;
99
  border-color: var(--primary-color);
100
  box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
101
  }
102
+
103
  input[type="submit"] {
104
  background-color: var(--primary-color);
105
  color: #fff;
 
111
  font-weight: 500;
112
  transition: background-color 0.3s, transform 0.1s;
113
  }
114
+
115
+
116
  input[type="submit"]:hover {
117
  background-color: #2980b9;
118
  transform: translateY(-2px);
119
  }
120
+
121
  .input-section {
122
  display: none;
123
  background-color: rgba(249, 249, 249, 0.8);
 
125
  border-radius: 4px;
126
  border: 1px solid #e0e0e0;
127
  }
128
+
129
  #max-marks-section {
130
  margin-top: 20px;
131
  }
132
+
133
  .icon-input {
134
  display: flex;
135
  align-items: center;
136
  position: relative;
137
  }
138
+
139
  .icon-input i {
140
  margin-right: 10px;
141
  color: var(--secondary-color);
142
  }
143
+
144
  .icon-input input, .icon-input select, .icon-input textarea {
145
  flex: 1;
146
  }
147
+
148
  .input-section .icon-input {
149
  margin-bottom: 20px;
150
  }
151
+
152
  .input-section label {
153
  display: block;
154
  margin-bottom: 5px;
155
  font-weight: bold;
156
  }
157
+
158
  .input-section input[type="file"] {
159
  height: 40px;
160
  }
161
+
162
  input[type="file"] {
163
  border: 1px solid #ddd;
164
  border-radius: 4px;
 
167
  width: 100%;
168
  box-sizing: border-box;
169
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
170
  .drive-link-container {
171
  position: fixed;
172
  top: 20px;
 
199
  .drive-link-button:hover {
200
  background-color: #2980b9;
201
  }
202
+
203
+ input[type="file"]::-webkit-file-upload-button {
204
+ visibility: hidden;
205
+ width: 0;
206
+ }
207
+
208
+ input[type="file"]::before {
209
+ content: 'Choose file';
210
+ display: inline-block;
211
+ background: var(--primary-color);
212
+ color: #fff;
213
+ border-radius: 3px;
214
+ padding: 5px 8px;
215
+ outline: none;
216
+ white-space: nowrap;
217
+ cursor: pointer;
218
+ font-weight: 700;
219
+ font-size: 10pt;
220
+ }
221
+
222
+ input[type="file"]:hover::before {
223
+ background-color: #2980b9;
224
+ }
225
+
226
+ .result-container {
227
+ background-color: #fff;
228
+ padding: 20px;
229
+ border-radius: 8px;
230
+ box-shadow: var(--shadow);
231
+ margin-bottom: 20px;
232
+ }
233
+
234
+ pre {
235
+ white-space: pre-wrap;
236
+ word-wrap: break-word;
237
+ background-color: #f8f8f8;
238
+ border: 1px solid #ddd;
239
+ padding: 15px;
240
+ border-radius: 4px;
241
+ overflow-x: auto;
242
+ }
243
+
244
  @media (max-width: 600px) {
245
  .container {
246
  padding: 20px;
 
279
  </style>
280
  </head>
281
  <body>
282
+ <!-- Background Video -->
283
  <video class="background-video" autoplay loop muted playsinline>
284
  <source src="../static/Eval.mp4" type="video/mp4">
285
  <source src="../static/Eval.webm" type="video/webm">
 
295
  <a href="teacher" class="back-button" title="Back to Home">
296
  <i class="fas fa-arrow-left"></i>
297
  </a>
 
298
  <div class="drive-link-container">
299
  <p>We have used the following documents in the demo video, which are given in the drive link. You can use your own docs also.</p>
300
  <a href="https://drive.google.com/drive/folders/10NI8gwA16V1wc57a8I4AtRcXU0NG4hzD?usp=drive_link" class="drive-link-button" target="_blank">Sample documents</a>
301
  </div>
 
302
  <div id="loading-overlay">
303
  <div class="spinner"></div>
304
  <p class="loading-text">Evaluating answers...</p>
305
  </div>
306
 
307
  <div class="container">
308
+ <form action="{{ url_for('eval') }}" method="post" enctype="multipart/form-data">
309
  <div class="icon-input">
310
  <i class="fas fa-clipboard-list"></i>
311
  <select name="input_type" id="input_type" onchange="showInputForm()">
 
348
 
349
  <input type="submit" value="Submit and Evaluate">
350
  </form>
351
+
352
+ {% if result %}
353
+ <div class="result-container">
354
+ <pre>{{ result }}</pre>
355
+ </div>
356
+ <button onclick="assignGrade()" class="grade-button">Assign Grade</button>
357
+ <div id="grade-result"></div>
358
+ {% endif %}
359
  </div>
360
 
361
  <script>
 
365
  document.getElementById('text-input').style.display = inputType === 'text' ? 'block' : 'none';
366
  }
367
 
368
+ function assignGrade() {
369
+ fetch('/assign_grade', {
370
+ method: 'POST',
371
+ headers: {
372
+ 'Content-Type': 'application/json',
373
+ },
374
+ body: JSON.stringify({ result: document.querySelector('pre').textContent }),
375
+ })
376
+ .then(response => response.json())
377
+ .then(data => {
378
+ document.getElementById('grade-result').innerHTML = `
379
+ Total Score: ${data.total_score}/${data.max_possible_score}<br>
380
+ Percentage: ${data.percentage.toFixed(2)}%<br>
381
+ Grade: ${data.grade}
382
+ `;
383
+ })
384
+ .catch((error) => {
385
+ console.error('Error:', error);
386
+ });
387
+ }
388
  function showLoading() {
389
  document.getElementById('loading-overlay').style.display = 'flex';
390
  }
391
  </script>
392
  </body>
393
+ </html>