Neurolingua commited on
Commit
3a6ef23
1 Parent(s): da867de

Update templates/teacher_paper_gen.html

Browse files
Files changed (1) hide show
  1. templates/teacher_paper_gen.html +112 -90
templates/teacher_paper_gen.html CHANGED
@@ -11,7 +11,7 @@
11
  --secondary-color: #2c3e50;
12
  --background-color: #f5f6fa;
13
  --text-color: #333;
14
- --card-background: rgba(255, 255, 255, 0.8);
15
  }
16
 
17
  body {
@@ -21,33 +21,15 @@
21
  line-height: 1.6;
22
  margin: 0;
23
  padding: 0;
24
- min-height: 100vh;
25
- display: flex;
26
- flex-direction: column;
27
- align-items: center;
28
- }
29
-
30
- .background-video {
31
- position: fixed;
32
- right: 0;
33
- bottom: 0;
34
- min-width: 100%;
35
- min-height: 100%;
36
- z-index: -1;
37
- object-fit: cover;
38
  }
39
 
40
  .container {
41
- max-width: 1200px;
42
- width: 95%;
43
  margin: 40px auto;
44
  padding: 30px;
45
  background: var(--card-background);
46
  border-radius: 15px;
47
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
48
- backdrop-filter: blur(10px);
49
- max-height: 90vh;
50
- overflow-y: auto;
51
  }
52
 
53
  h1 {
@@ -57,22 +39,9 @@
57
  font-size: 2.5em;
58
  }
59
 
60
- .content-wrapper {
61
- display: flex;
62
- gap: 30px;
63
- }
64
-
65
- .form-container {
66
- flex: 1;
67
- }
68
-
69
- .generated-paper-container {
70
- flex: 1;
71
- }
72
-
73
  form {
74
  display: grid;
75
- gap: 15px;
76
  }
77
 
78
  label {
@@ -85,22 +54,22 @@
85
  input[type="text"],
86
  input[type="file"] {
87
  width: 100%;
88
- padding: 8px;
89
  border: 1px solid #ddd;
90
  border-radius: 5px;
91
- font-size: 14px;
92
  }
93
 
94
  input[type="file"] {
95
- padding: 8px 0;
96
  }
97
 
98
  button {
99
  background-color: var(--primary-color);
100
  color: white;
101
  border: none;
102
- padding: 10px 15px;
103
- font-size: 16px;
104
  border-radius: 5px;
105
  cursor: pointer;
106
  transition: background-color 0.3s ease;
@@ -111,13 +80,11 @@
111
  }
112
 
113
  .generated-paper {
114
- margin-top: 0;
115
  padding: 20px;
116
  background-color: #f9f9f9;
117
  border-radius: 10px;
118
  border: 1px solid #e0e0e0;
119
- height: 100%;
120
- overflow-y: auto;
121
  }
122
 
123
  .generated-paper h2 {
@@ -125,12 +92,45 @@
125
  margin-bottom: 20px;
126
  }
127
 
128
- @media (max-width: 900px) {
129
- .content-wrapper {
130
- flex-direction: column;
131
  }
132
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
133
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
134
  @media (max-width: 600px) {
135
  .container {
136
  padding: 20px;
@@ -178,55 +178,77 @@
178
  <a href="teacher" class="back-button" title="Back to Home">Back
179
  <i class="fas fa-arrow-left"></i>
180
  </a>
181
-
182
-
183
  <div class="container">
184
  <h1>Question Paper Generator</h1>
185
- <div class="content-wrapper">
186
- <div class="form-container">
187
- <form action="/generate-paper" method="post" enctype="multipart/form-data">
188
- <div>
189
- <label for="no_of_questions">Number of questions:</label>
190
- <input type="number" id="no_of_questions" name="no_of_questions" required>
191
- </div>
192
-
193
- <div>
194
- <label for="total_marks">Total marks:</label>
195
- <input type="number" id="total_marks" name="total_marks" required>
196
- </div>
197
-
198
- <div>
199
- <label for="no_of_parts">Number of parts:</label>
200
- <input type="number" id="no_of_parts" name="no_of_parts" required>
201
- </div>
202
-
203
- <div>
204
- <label for="marks_per_part">Marks per part:</label>
205
- <input type="number" id="marks_per_part" name="marks_per_part" required>
206
- </div>
207
-
208
- <div>
209
- <label for="test_duration">Test duration:</label>
210
- <input type="text" id="test_duration" name="test_duration" placeholder="e.g., 2 hours" required>
211
- </div>
212
-
213
- <div>
214
- <label for="pdf_file">Curriculum PDF:</label>
215
- <input type="file" id="pdf_file" name="pdf_file" accept="application/pdf" required>
216
- </div>
217
-
218
- <button type="submit">Generate Question Paper</button>
219
- </form>
220
  </div>
221
- <div class="generated-paper-container">
222
- {% if questions %}
223
- <div class="generated-paper">
224
- <h2>Generated Question Paper</h2>
225
- <p>{{ questions }}</p>
226
- </div>
227
- {% endif %}
228
  </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
229
  </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
230
  </div>
 
231
  </body>
232
- </html>
 
11
  --secondary-color: #2c3e50;
12
  --background-color: #f5f6fa;
13
  --text-color: #333;
14
+ --card-background: #fff;
15
  }
16
 
17
  body {
 
21
  line-height: 1.6;
22
  margin: 0;
23
  padding: 0;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
24
  }
25
 
26
  .container {
27
+ max-width: 800px;
 
28
  margin: 40px auto;
29
  padding: 30px;
30
  background: var(--card-background);
31
  border-radius: 15px;
32
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
 
 
 
33
  }
34
 
35
  h1 {
 
39
  font-size: 2.5em;
40
  }
41
 
 
 
 
 
 
 
 
 
 
 
 
 
 
42
  form {
43
  display: grid;
44
+ gap: 20px;
45
  }
46
 
47
  label {
 
54
  input[type="text"],
55
  input[type="file"] {
56
  width: 100%;
57
+ padding: 10px;
58
  border: 1px solid #ddd;
59
  border-radius: 5px;
60
+ font-size: 16px;
61
  }
62
 
63
  input[type="file"] {
64
+ padding: 10px 0;
65
  }
66
 
67
  button {
68
  background-color: var(--primary-color);
69
  color: white;
70
  border: none;
71
+ padding: 12px 20px;
72
+ font-size: 18px;
73
  border-radius: 5px;
74
  cursor: pointer;
75
  transition: background-color 0.3s ease;
 
80
  }
81
 
82
  .generated-paper {
83
+ margin-top: 40px;
84
  padding: 20px;
85
  background-color: #f9f9f9;
86
  border-radius: 10px;
87
  border: 1px solid #e0e0e0;
 
 
88
  }
89
 
90
  .generated-paper h2 {
 
92
  margin-bottom: 20px;
93
  }
94
 
95
+ @media (max-width: 600px) {
96
+ .container {
97
+ padding: 20px;
98
  }
99
  }
100
+ .loading {
101
+ display: none;
102
+ text-align: center;
103
+ margin-top: 20px;
104
+ }
105
+
106
+ .loading-icon {
107
+ border: 5px solid #f3f3f3;
108
+ border-top: 5px solid var(--primary-color);
109
+ border-radius: 50%;
110
+ width: 50px;
111
+ height: 50px;
112
+ animation: spin 1s linear infinite;
113
+ margin: 0 auto;
114
+ }
115
 
116
+ @keyframes spin {
117
+ 0% { transform: rotate(0deg); }
118
+ 100% { transform: rotate(360deg); }
119
+ }
120
+
121
+ .part {
122
+ margin-bottom: 20px;
123
+ }
124
+
125
+ .part h3 {
126
+ margin-bottom: 10px;
127
+ color: var(--primary-color);
128
+ }
129
+
130
+ .question {
131
+ margin-left: 20px;
132
+ margin-bottom: 10px;
133
+ }
134
  @media (max-width: 600px) {
135
  .container {
136
  padding: 20px;
 
178
  <a href="teacher" class="back-button" title="Back to Home">Back
179
  <i class="fas fa-arrow-left"></i>
180
  </a>
 
 
181
  <div class="container">
182
  <h1>Question Paper Generator</h1>
183
+ <form action="/generate-paper" method="post" enctype="multipart/form-data">
184
+ <div>
185
+ <label for="no_of_questions">Number of questions:</label>
186
+ <input type="number" id="no_of_questions" name="no_of_questions" required>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
187
  </div>
188
+
189
+ <div>
190
+ <label for="total_marks">Total marks:</label>
191
+ <input type="number" id="total_marks" name="total_marks" required>
 
 
 
192
  </div>
193
+
194
+ <div>
195
+ <label for="no_of_parts">Number of parts:</label>
196
+ <input type="number" id="no_of_parts" name="no_of_parts" required>
197
+ </div>
198
+
199
+ <div>
200
+ <label for="marks_per_part">Marks per part:</label>
201
+ <input type="number" id="marks_per_part" name="marks_per_part" required>
202
+ </div>
203
+
204
+ <div>
205
+ <label for="test_duration">Test duration:</label>
206
+ <input type="text" id="test_duration" name="test_duration" placeholder="e.g., 2 hours" required>
207
+ </div>
208
+
209
+ <div>
210
+ <label for="pdf_file">Curriculum PDF:</label>
211
+ <input type="file" id="pdf_file" name="pdf_file" accept="application/pdf" required>
212
+ </div>
213
+
214
+ <button type="submit">Generate Question Paper</button>
215
+ </form>
216
+
217
+ {% if questions %}
218
+ <div class="generated-paper" id="generated-paper">
219
+ <h2>Generated Question Paper</h2>
220
  </div>
221
+ <script>
222
+ document.addEventListener("DOMContentLoaded", function() {
223
+ const questionsText =` {{ questions|tojson }}`;
224
+ const parts = questionsText.split("Part ");
225
+
226
+ const generatedPaper = document.getElementById("generated-paper");
227
+
228
+ parts.forEach((partText, index) => {
229
+ if (index > 0) {
230
+ const partDiv = document.createElement("div");
231
+ partDiv.className = "part";
232
+
233
+ const partHeader = document.createElement("h3");
234
+ partHeader.textContent = "Part " + index;
235
+ partDiv.appendChild(partHeader);
236
+
237
+ const questions = partText.split(/[0-9]+\./).slice(1);
238
+ questions.forEach((question, qIndex) => {
239
+ const questionDiv = document.createElement("div");
240
+ questionDiv.className = "question";
241
+ questionDiv.textContent = (qIndex + 1) + ". " + question.trim();
242
+ partDiv.appendChild(questionDiv);
243
+ });
244
+
245
+ generatedPaper.appendChild(partDiv);
246
+ }
247
+ });
248
+ });
249
+ </script>
250
+ {% endif %}
251
  </div>
252
+
253
  </body>
254
+ </html>