Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -27,12 +27,23 @@ def evaluate_code(exercise, user_code):
|
|
| 27 |
"""Evaluate the user's code submission."""
|
| 28 |
prompt = f"""
|
| 29 |
Exercise: {exercise}
|
| 30 |
-
|
| 31 |
User's code:
|
| 32 |
{user_code}
|
| 33 |
-
|
| 34 |
-
|
| 35 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 36 |
"""
|
| 37 |
try:
|
| 38 |
response = model.generate_content(prompt)
|
|
|
|
| 27 |
"""Evaluate the user's code submission."""
|
| 28 |
prompt = f"""
|
| 29 |
Exercise: {exercise}
|
| 30 |
+
|
| 31 |
User's code:
|
| 32 |
{user_code}
|
| 33 |
+
|
| 34 |
+
Perform a concise code review addressing the following points:
|
| 35 |
+
1. Correctness: Does the code solve the given problem? If not, what's missing?
|
| 36 |
+
2. Efficiency: Is the solution efficient? Suggest any optimizations if applicable.
|
| 37 |
+
3. Style and Best Practices: Comment on code style, readability, and adherence to Python best practices.
|
| 38 |
+
4. Potential Improvements: Offer 1-2 specific suggestions for improving the code.
|
| 39 |
+
|
| 40 |
+
Format your response as follows:
|
| 41 |
+
Correctness: [Your evaluation]
|
| 42 |
+
Efficiency: [Your evaluation]
|
| 43 |
+
Style: [Your evaluation]
|
| 44 |
+
Improvements: [Your suggestions]
|
| 45 |
+
|
| 46 |
+
Keep the entire response under 200 words and be specific in your feedback.
|
| 47 |
"""
|
| 48 |
try:
|
| 49 |
response = model.generate_content(prompt)
|