mou3az commited on
Commit
828adf0
·
verified ·
1 Parent(s): 09a5c47

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +34 -18
app.py CHANGED
@@ -47,7 +47,7 @@ def generate_quiz_page():
47
  if request.method == "POST":
48
  context = request.form.get("context")
49
  response = generate_quiz(context)
50
-
51
  if "error" in response:
52
  response = generate_quiz(context)
53
 
@@ -82,10 +82,22 @@ def generate_quiz_page():
82
  }}
83
  .quiz-container pre {{
84
  white-space: pre-wrap; /* Preserve line breaks in quiz response */
 
 
 
85
  }}
86
  .generate-link {{
87
- display: block; /* Make the link block-level for spacing */
88
  margin-top: 10px;
 
 
 
 
 
 
 
 
 
89
  }}
90
  a {{
91
  color: #ffc107; /* Yellow text color for links */
@@ -101,6 +113,8 @@ def generate_quiz_page():
101
  border-radius: 4px;
102
  resize: vertical; /* Allow vertical resizing of textarea */
103
  min-height: 150px; /* Minimum height for textarea */
 
 
104
  }}
105
  input[type="submit"] {{
106
  background-color: #ffc107; /* Yellow background for submit button */
@@ -119,7 +133,7 @@ def generate_quiz_page():
119
  <div class="quiz-container">
120
  <h2>Generated Quiz</h2>
121
  <pre>{response}</pre>
122
- <a href="/" class="generate-link">Generate another quiz</a>
123
  </div>
124
  </body>
125
  </html>
@@ -136,47 +150,49 @@ def generate_quiz_page():
136
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
137
  <title>Generate Quiz</title>
138
  <style>
139
- body {
140
  font-family: Arial, sans-serif;
141
  background-color: #f0f0f0; /* Light grey background */
142
  color: #333; /* Dark grey text color */
143
  margin: 20px;
144
- }
145
- h2 {
146
  background-color: #ffc107; /* Yellow background for heading */
147
  padding: 10px;
148
  border-radius: 5px;
149
- }
150
- form {
151
  background-color: #fff; /* White background for form */
152
  padding: 20px;
153
  border-radius: 5px;
154
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.1); /* Light shadow effect */
155
  margin-bottom: 20px;
156
- }
157
- label {
158
  display: block;
159
  margin-bottom: 10px;
160
- }
161
- textarea {
162
  width: 98%;
163
  padding: 10px;
164
  border: 1px solid #ccc;
165
  border-radius: 4px;
166
  resize: vertical; /* Allow vertical resizing of textarea */
167
  min-height: 150px; /* Minimum height for textarea */
168
- }
169
- input[type="submit"] {
 
 
170
  background-color: #ffc107; /* Yellow background for submit button */
171
  color: #333; /* Dark grey text color */
172
  border: none;
173
  padding: 10px 20px;
174
  cursor: pointer;
175
  border-radius: 4px;
176
- }
177
- input[type="submit"]:hover {
178
  background-color: #ffca28; /* Lighter yellow on hover */
179
- }
180
  </style>
181
  </head>
182
  <body>
@@ -193,4 +209,4 @@ def generate_quiz_page():
193
  return default_html
194
 
195
  if __name__ == "__main__":
196
- app.run(debug=True)
 
47
  if request.method == "POST":
48
  context = request.form.get("context")
49
  response = generate_quiz(context)
50
+
51
  if "error" in response:
52
  response = generate_quiz(context)
53
 
 
82
  }}
83
  .quiz-container pre {{
84
  white-space: pre-wrap; /* Preserve line breaks in quiz response */
85
+ background-color: #f0f0f0; /* Light grey background */
86
+ padding: 10px;
87
+ border-radius: 4px;
88
  }}
89
  .generate-link {{
90
+ display: inline-block; /* Make the link block-level for spacing */
91
  margin-top: 10px;
92
+ padding: 10px 20px;
93
+ background-color: #ffc107; /* Yellow background for link */
94
+ color: #333; /* Dark grey text color */
95
+ text-decoration: none;
96
+ border-radius: 5px;
97
+ font-weight: bold;
98
+ }}
99
+ .generate-link:hover {{
100
+ background-color: #ffca28; /* Lighter yellow on hover */
101
  }}
102
  a {{
103
  color: #ffc107; /* Yellow text color for links */
 
113
  border-radius: 4px;
114
  resize: vertical; /* Allow vertical resizing of textarea */
115
  min-height: 150px; /* Minimum height for textarea */
116
+ background-color: #f0f0f0; /* Light grey background */
117
+ color: #333; /* Dark grey text color */
118
  }}
119
  input[type="submit"] {{
120
  background-color: #ffc107; /* Yellow background for submit button */
 
133
  <div class="quiz-container">
134
  <h2>Generated Quiz</h2>
135
  <pre>{response}</pre>
136
+ <a href="/" class="generate-link">Back to generate another quiz</a>
137
  </div>
138
  </body>
139
  </html>
 
150
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
151
  <title>Generate Quiz</title>
152
  <style>
153
+ body {{
154
  font-family: Arial, sans-serif;
155
  background-color: #f0f0f0; /* Light grey background */
156
  color: #333; /* Dark grey text color */
157
  margin: 20px;
158
+ }}
159
+ h2 {{
160
  background-color: #ffc107; /* Yellow background for heading */
161
  padding: 10px;
162
  border-radius: 5px;
163
+ }}
164
+ form {{
165
  background-color: #fff; /* White background for form */
166
  padding: 20px;
167
  border-radius: 5px;
168
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.1); /* Light shadow effect */
169
  margin-bottom: 20px;
170
+ }}
171
+ label {{
172
  display: block;
173
  margin-bottom: 10px;
174
+ }}
175
+ textarea {{
176
  width: 98%;
177
  padding: 10px;
178
  border: 1px solid #ccc;
179
  border-radius: 4px;
180
  resize: vertical; /* Allow vertical resizing of textarea */
181
  min-height: 150px; /* Minimum height for textarea */
182
+ background-color: #f0f0f0; /* Light grey background */
183
+ color: #333; /* Dark grey text color */
184
+ }}
185
+ input[type="submit"] {{
186
  background-color: #ffc107; /* Yellow background for submit button */
187
  color: #333; /* Dark grey text color */
188
  border: none;
189
  padding: 10px 20px;
190
  cursor: pointer;
191
  border-radius: 4px;
192
+ }}
193
+ input[type="submit"]:hover {{
194
  background-color: #ffca28; /* Lighter yellow on hover */
195
+ }}
196
  </style>
197
  </head>
198
  <body>
 
209
  return default_html
210
 
211
  if __name__ == "__main__":
212
+ app.run(debug=True)