atz21 commited on
Commit
37398bc
·
verified ·
1 Parent(s): f44aff8

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +12 -17
app.py CHANGED
@@ -51,7 +51,7 @@ Generate a single Markdown document. For each (sub-)question, output a structure
51
  """
52
  },
53
 
54
- "GRADING_PROMPT": {
55
  "role": "system",
56
  "content": """Developer: You are an official examiner. Apply the following grading rules precisely.
57
 
@@ -60,17 +60,19 @@ Generate a single Markdown document. For each (sub-)question, output a structure
60
  - Award marks for correct methods (M), accurate answers (A), and clear reasoning (R) as specified.
61
  - Use Follow Through (FT) for correctly applied subsequent working that uses a previously incorrect answer.
62
  - Clearly indicate any lost marks and provide a concise reason for the deduction.
63
- - Always also explain the **correct answer or correct method** when a mistake is made, so the student learns what should have been done.
 
 
64
  - Check for alternative valid methods and award marks accordingly.
65
  - Summarize the total marks and classify the types of errors made by the student.
66
  - Ensure the final output adheres to the specified Markdown table format.
67
 
68
  ### Abbreviations:
69
- - **M**: Method mark
70
- - **A**: Accuracy mark
71
- - **R**: Reasoning mark
72
- - **AG**: Answer given in question—no marks awarded
73
- - **FT**: Follow Through (carry forward a previous mistake if method is correct)
74
 
75
  ---
76
  ## Grading Instructions
@@ -93,17 +95,12 @@ Produce a GitHub-flavored Markdown table:
93
  Rules:
94
  - Each row matches a markable step.
95
  - For blanks, write “(no answer)” and indicate the lost mark(s).
96
- - Lost marks: wrap in red with `<span style="color:red">A0</span>` (or M0, R0) and make Reason column red.
97
- The reason must say BOTH what went wrong **and** what the correct answer/method is.
98
- Example: `<span style="color:red">Incorrectly calculated (3×10⁴)³ as 3×10¹². Correct answer is 27×10¹².</span>`
99
  - Awarded marks remain plain text.
100
  - For partial awards (e.g., M1A0A1), only highlight lost marks.
 
101
 
102
- **Formatting Rule (Question Headers):**
103
- - At the start of each question or sub-question section, output a dark black bold header using:
104
- `<span style="font-weight:900; color:black">## Question 1(b)(ii)</span>`
105
-
106
- **New Rule (Per-Question Total):**
107
  - After each question (including all subparts), show marks obtained vs total in square brackets, e.g.:
108
  `[2/4]`
109
 
@@ -137,8 +134,6 @@ Optionally, if reasons are available, extend with:
137
  """
138
  }
139
 
140
- }
141
-
142
  # -------------------- CONFIG --------------------
143
  genai.configure(api_key=os.getenv("GEMINI_API_KEY"))
144
 
 
51
  """
52
  },
53
 
54
+ "GRADING_PROMPT": {
55
  "role": "system",
56
  "content": """Developer: You are an official examiner. Apply the following grading rules precisely.
57
 
 
60
  - Award marks for correct methods (M), accurate answers (A), and clear reasoning (R) as specified.
61
  - Use Follow Through (FT) for correctly applied subsequent working that uses a previously incorrect answer.
62
  - Clearly indicate any lost marks and provide a concise reason for the deduction.
63
+ - Always state both:
64
+ 1. **What was wrong** (explain the error).
65
+ 2. **What is right** (give the correct value, method, or reasoning from the markscheme).
66
  - Check for alternative valid methods and award marks accordingly.
67
  - Summarize the total marks and classify the types of errors made by the student.
68
  - Ensure the final output adheres to the specified Markdown table format.
69
 
70
  ### Abbreviations:
71
+ - **M**: Marks for demonstrating a correct Method.
72
+ - **A**: Marks for providing an accurate Answer.
73
+ - **R**: Marks for clear Reasoning.
74
+ - **AG**: Answer is given in the question—no marks awarded.
75
+ - **FT**: Follow Through; award marks when candidates continue with their own previous (possibly incorrect) answers.
76
 
77
  ---
78
  ## Grading Instructions
 
95
  Rules:
96
  - Each row matches a markable step.
97
  - For blanks, write “(no answer)” and indicate the lost mark(s).
98
+ - Lost marks: wrap in red with `<span style="color:red">A0</span>` (or M0, R0) and make Reason column red.
 
 
99
  - Awarded marks remain plain text.
100
  - For partial awards (e.g., M1A0A1), only highlight lost marks.
101
+ - **When a mark is lost, the Reason column must explain both the error AND the correct answer or method from the markscheme.**
102
 
103
+ **New Rule (Per-Question Total):**
 
 
 
 
104
  - After each question (including all subparts), show marks obtained vs total in square brackets, e.g.:
105
  `[2/4]`
106
 
 
134
  """
135
  }
136
 
 
 
137
  # -------------------- CONFIG --------------------
138
  genai.configure(api_key=os.getenv("GEMINI_API_KEY"))
139