Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -161,7 +161,29 @@ def generate_question(subject, difficulty, question_type):
|
|
161 |
logger.debug(f"Selected topic: {selected_topic}")
|
162 |
|
163 |
difficulty_params = get_difficulty_parameters(difficulty)
|
164 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
165 |
if difficulty == 5:
|
166 |
system_prompt = f"""You are an expert mathematics professor creating a graduate-level exam question.
|
167 |
STRICT REQUIREMENTS:
|
@@ -177,6 +199,7 @@ STRICT REQUIREMENTS:
|
|
177 |
|
178 |
Follow these specific constraints:
|
179 |
{chr(10).join(f' - {c}' for c in difficulty_params['constraints'])}
|
|
|
180 |
3. Style Reference:
|
181 |
Question should be {difficulty_params['example_style']}
|
182 |
4. The question MUST:
|
@@ -202,6 +225,7 @@ STRICT REQUIREMENTS:
|
|
202 |
{difficulty_params['description'].upper()}
|
203 |
Follow these specific constraints:
|
204 |
{chr(10).join(f' - {c}' for c in difficulty_params['constraints'])}
|
|
|
205 |
3. Style Reference:
|
206 |
Question should be {difficulty_params['example_style']}
|
207 |
4. For LaTeX formatting:
|
|
|
161 |
logger.debug(f"Selected topic: {selected_topic}")
|
162 |
|
163 |
difficulty_params = get_difficulty_parameters(difficulty)
|
164 |
+
|
165 |
+
if question_type == "application":
|
166 |
+
application_addition = """
|
167 |
+
The application question MUST:
|
168 |
+
- Present a real-world scenario or practical problem
|
169 |
+
- Require modeling the situation mathematically
|
170 |
+
- Connect abstract mathematical concepts to concrete situations
|
171 |
+
- Include realistic context and data
|
172 |
+
- Require students to:
|
173 |
+
1. Identify relevant mathematical concepts
|
174 |
+
2. Translate the practical problem into mathematical terms
|
175 |
+
3. Solve using appropriate mathematical techniques
|
176 |
+
4. Interpret the results in the context of the original problem
|
177 |
+
|
178 |
+
Example contexts might include:
|
179 |
+
- Physics applications (motion, forces, work)
|
180 |
+
- Engineering scenarios (optimization, rates of change)
|
181 |
+
- Economics problems (cost optimization, growth models)
|
182 |
+
- Biological systems (population growth, reaction rates)
|
183 |
+
- Business applications (profit maximization, inventory management)
|
184 |
+
- Social science applications (demographic models, social network analysis)
|
185 |
+
- Data science applications (regression, statistical analysis)
|
186 |
+
"""
|
187 |
if difficulty == 5:
|
188 |
system_prompt = f"""You are an expert mathematics professor creating a graduate-level exam question.
|
189 |
STRICT REQUIREMENTS:
|
|
|
199 |
|
200 |
Follow these specific constraints:
|
201 |
{chr(10).join(f' - {c}' for c in difficulty_params['constraints'])}
|
202 |
+
{application_addition}
|
203 |
3. Style Reference:
|
204 |
Question should be {difficulty_params['example_style']}
|
205 |
4. The question MUST:
|
|
|
225 |
{difficulty_params['description'].upper()}
|
226 |
Follow these specific constraints:
|
227 |
{chr(10).join(f' - {c}' for c in difficulty_params['constraints'])}
|
228 |
+
{application_addition}
|
229 |
3. Style Reference:
|
230 |
Question should be {difficulty_params['example_style']}
|
231 |
4. For LaTeX formatting:
|