File size: 8,938 Bytes
815fe05
 
 
 
 
 
 
 
 
 
 
 
 
3a6ef23
815fe05
 
 
 
 
 
 
 
879327a
 
 
 
 
 
 
 
 
 
 
 
 
 
 
815fe05
 
3a6ef23
815fe05
 
 
 
 
879327a
815fe05
 
 
 
 
 
 
 
 
3a6ef23
815fe05
 
 
 
 
 
 
 
 
 
3a6ef23
815fe05
 
3a6ef23
815fe05
 
3a6ef23
815fe05
 
 
 
 
3a6ef23
 
815fe05
 
 
 
 
 
 
 
3a6ef23
815fe05
 
 
 
 
 
 
 
 
3a6ef23
 
 
815fe05
 
3a6ef23
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
879327a
621e533
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
879327a
621e533
 
 
 
 
 
 
 
 
 
 
879327a
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
815fe05
 
 
 
 
 
 
621e533
 
879327a
 
6a857bc
 
 
 
 
815fe05
 
3a6ef23
 
 
 
815fe05
3a6ef23
 
 
 
815fe05
3a6ef23
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
815fe05
3a6ef23
 
c328f49
3a6ef23
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
815fe05
879327a
6a857bc
c328f49
6a857bc
 
815fe05
879327a
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
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Professional Question Paper Generator</title>
    <link href="https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;500;700&display=swap" rel="stylesheet">
    <style>
        :root {
            --primary-color: #3498db;
            --secondary-color: #2c3e50;
            --background-color: #f5f6fa;
            --text-color: #333;
            --card-background: #fff;
        }
        body {
            font-family: 'Roboto', sans-serif;
            background-color: var(--background-color);
            color: var(--text-color);
            line-height: 1.6;
            margin: 0;
            padding: 0;
            min-height: 100vh;
            display: flex;
            flex-direction: column;
            justify-content: center;
            align-items: center;
            position: relative;
        }
        .background-video {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            object-fit: cover;
            z-index: -1;
        }
        .container {
            max-width: 800px;
            margin: 40px auto;
            padding: 30px;
            background: var(--card-background);
            border-radius: 15px;
            box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
            z-index: 1;
        }
        h1 {
            color: var(--primary-color);
            text-align: center;
            margin-bottom: 30px;
            font-size: 2.5em;
        }
        form {
            display: grid;
            gap: 20px;
        }
        label {
            font-weight: 500;
            display: block;
            margin-bottom: 5px;
        }
        input[type="number"],
        input[type="text"],
        input[type="file"] {
            width: 100%;
            padding: 10px;
            border: 1px solid #ddd;
            border-radius: 5px;
            font-size: 16px;
        }
        input[type="file"] {
            padding: 10px 0;
        }
        button {
            background-color: var(--primary-color);
            color: white;
            border: none;
            padding: 12px 20px;
            font-size: 18px;
            border-radius: 5px;
            cursor: pointer;
            transition: background-color 0.3s ease;
        }
        button:hover {
            background-color: #2980b9;
        }
        .generated-paper {
            margin-top: 40px;
            padding: 20px;
            background-color: #f9f9f9;
            border-radius: 10px;
            border: 1px solid #e0e0e0;
        }
        .generated-paper h2 {
            color: var(--secondary-color);
            margin-bottom: 20px;
        }
        @media (max-width: 600px) {
            .container {
                padding: 20px;
            }
        }
        .loading {
            display: none;
            text-align: center;
            margin-top: 20px;
        }
        .loading-icon {
            border: 5px solid #f3f3f3;
            border-top: 5px solid var(--primary-color);
            border-radius: 50%;
            width: 50px;
            height: 50px;
            animation: spin 1s linear infinite;
            margin: 0 auto;
        }
        @keyframes spin {
            0% { transform: rotate(0deg); }
            100% { transform: rotate(360deg); }
        }
        .part {
            margin-bottom: 20px;
        }
        .part h3 {
            margin-bottom: 10px;
            color: var(--primary-color);
        }
        .question {
            margin-left: 20px;
            margin-bottom: 10px;
        }
        .back-button {
            position: fixed;
            top: 20px;
            left: 20px;
            background-color: #3498db;
            color: white;
            border: none;
            border-radius: 50%;
            width: 50px;
            height: 50px;
            font-size: 24px;
            cursor: pointer;
            transition: all 0.3s ease;
            box-shadow: 0 2px 5px rgba(0,0,0,0.2);
            display: flex;
            justify-content: center;
            align-items: center;
            text-decoration: none;
            z-index: 2;
        }
        .back-button:hover {
            background-color: #2980b9;
            transform: scale(1.1);
        }
        .back-button i {
            transition: transform 0.3s ease;
        }
        .back-button:hover i {
            transform: translateX(-5px);
        }
        .info-drive-box {
            background-color: rgba(255, 255, 255, 0.8);
            padding: 20px;
            border-radius: 10px;
            margin-bottom: 20px;
            z-index: 1;
        }
        .drive-button {
            background-color: #4CAF50;
            color: white;
            padding: 10px 20px;
            border: none;
            border-radius: 5px;
            cursor: pointer;
            font-size: 16px;
            transition: background-color 0.3s;
        }
        .drive-button:hover {
            background-color: #45a049;
        }
    </style>
</head>
<body>
    <video class="background-video" autoplay muted loop>
        <source src="../static/paper.mp4" type="video/mp4">
        Your browser does not support the video tag.
    </video>
    <a href="teacher" class="back-button" title="Back to Home">Back
        <i class="fas fa-arrow-left"></i>
    </a>
    <div class="info-drive-box">
        <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>
        <button class="drive-button" onclick="openDriveLink()">
            <i class="fas fa-cloud-upload-alt"></i> Open in Drive
        </button>
    </div>
    <div class="container">
        <h1>Question Paper Generator</h1>
        <form action="/generate-paper" method="post" enctype="multipart/form-data">
            <div>
                <label for="no_of_questions">Number of questions:</label>
                <input type="number" id="no_of_questions" name="no_of_questions" required>
            </div>

            <div>
                <label for="total_marks">Total marks:</label>
                <input type="number" id="total_marks" name="total_marks" required>
            </div>

            <div>
                <label for="no_of_parts">Number of parts:</label>
                <input type="number" id="no_of_parts" name="no_of_parts" required>
            </div>

            <div>
                <label for="marks_per_part">Marks per part:</label>
                <input type="number" id="marks_per_part" name="marks_per_part" required>
            </div>

            <div>
                <label for="test_duration">Test duration:</label>
                <input type="text" id="test_duration" name="test_duration" placeholder="e.g., 2 hours" required>
            </div>

            <div>
                <label for="pdf_file">Curriculum PDF:</label>
                <input type="file" id="pdf_file" name="pdf_file" accept="application/pdf" required>
            </div>

            <button type="submit">Generate Question Paper</button>
        </form>

        {% if questions %}
        <div class="generated-paper" id="generated-paper">
            <h2>Generated Question Paper</h2>
        </div>
        <script>
            document.addEventListener("DOMContentLoaded", function() {
                const questionsText = `{{ questions|tojson }}`;
                const parts = questionsText.split("Part ");
                const generatedPaper = document.getElementById("generated-paper");
                parts.forEach((partText, index) => {
                    if (index > 0) {
                        const partDiv = document.createElement("div");
                        partDiv.className = "part";
                        const partHeader = document.createElement("h3");
                        partHeader.textContent = "Part " + index;
                        partDiv.appendChild(partHeader);
                        const questions = partText.split(/[0-9]+\./).slice(1);
                        questions.forEach((question, qIndex) => {
                            const questionDiv = document.createElement("div");
                            questionDiv.className = "question";
                            questionDiv.textContent = (qIndex + 1) + ". " + question.trim();
                            partDiv.appendChild(questionDiv);
                        });
                        generatedPaper.appendChild(partDiv);
                    }
                });
            });
        </script>
        {% endif %}
    </div>
    <script>
        function openDriveLink() {
            window.open('https://drive.google.com/drive/folders/example-link', '_blank');
        }
    </script>
</body>
</html>