dalinstone commited on
Commit
f5eca3a
·
verified ·
1 Parent(s): 472c755

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +54 -232
app.py CHANGED
@@ -12,251 +12,73 @@ import time
12
  import fitz
13
 
14
  GRADING_RUBRIC = """
15
- DETAILED GRADING RUBRIC & INSTRUCTIONS
16
-
17
- You will assess the paper against the following 16 criteria. For each criterion, you will determine the student's score based on a forensic analysis of their work.
18
-
19
- I. APA Formatting (Total 60 points)
20
-
21
- 1. APA Title Page (5 pts):
22
-
23
- Check for the 9 required components of a student title page. For this task, the 9 components are defined as: (1) Page number in the header (Page 1), (2) Paper title (bolded), (3) Author's name, (4) Department name, (5) University name, (6) Course number and name, (7) Instructor's name, (8) Assignment due date, (9) All elements are centered and correctly spaced in the upper half of the page.
24
-
25
- Scoring:
26
-
27
- 5 pts: All 9 components are present and correctly formatted.
28
-
29
- 0 pts: 1 or more components are missing or incorrectly formatted.
30
-
31
- 2. APA General Guidelines - Main Body (5 pts):
32
-
33
- Check for adherence to all of the following:
34
-
35
- (1) Paper is typed.
36
-
37
- (2) 1-inch margins on all sides.
38
-
39
- (3) Font is either 11 pt Calibri or 12 pt Times New Roman (consistently).
40
-
41
- The 3 additional main body text requirements are: (4) All text is double-spaced, (5) Text is aligned to the left margin (not justified), (6) The first line of every paragraph is indented 0.5 inches.
42
-
43
- Scoring:
44
-
45
- 5 pts: All 6 guidelines are met perfectly.
46
-
47
- 2 pts: 1 guideline is not met.
48
-
49
- 0 pts: 2 or more guidelines are not met.
50
-
51
- 3. APA Text - Main Body Misc. Errors (5 pts):
52
-
53
- Scan the entire document for the following: (1) Extra spacing between paragraphs, (2) Misspellings, (3) Typographical errors.
54
-
55
- Scoring:
56
-
57
- 5 pts: 0 errors found.
58
-
59
- 4 pts: Exactly 1 error found.
60
-
61
- 0 pts: 2 or more errors found.
62
-
63
- 4. APA In-text Citations - Presence (5 pts):
64
-
65
- Analyze the text: Identify every statement of fact, statistic, or opinion that is not common knowledge and requires a citation. Count how many of these required citations are missing.
66
-
67
- Scoring:
68
-
69
- 5 pts: 0 missing in-text citations.
70
-
71
- 3.5 pts: 1 to 5 missing in-text citations.
72
-
73
- 0 pts: 6 or more missing in-text citations.
74
-
75
- 5. APA In-text Citation - Formatting (5 pts):
76
-
77
- Analyze every provided in-text citation. Check for correct APA 7th Ed. format (e.g., (Author, Year) for parenthetical; Author (Year) for narrative; et al. usage; multiple authors). Count every single formatting error.
78
-
79
- Scoring:
80
-
81
- 5 pts: 0 formatting errors.
82
-
83
- 2 pts: 1 to 2 formatting errors.
84
-
85
- 0 pts: 3 or more formatting errors.
86
-
87
- 6. APA Reference Page - General Formatting (5 pts):
88
-
89
- Check for the following: (1) The title "References" is on a new page, centered, and bolded. (2) All entries are alphabetized by the first author's last name. (3) A 0.5-inch hanging indent is applied to all entries.
90
-
91
- Scoring:
92
-
93
- 5 pts: The entire page meets all 3 general formatting expectations.
94
-
95
- 0 pts: 1 or more errors are present.
96
-
97
- 7. APA Reference Page - Line Spacing (5 pts):
98
-
99
- Check for the following: The entire reference page, including between entries, is uniformly double-spaced.
100
-
101
- Scoring:
102
-
103
- 5 pts: The entire page adheres to APA double-spacing rules.
104
-
105
- 0 pts: 1 or more line spacing errors are present (e.g., single spacing, extra space between entries).
106
-
107
- 8. APA References - Scholarly & Timely (10 pts):
108
-
109
- Analyze the reference list. A "scholarly" reference is a peer-reviewed journal article, an academic book/chapter, or a publication from a professional organization (e.g., CDC, WHO). A non-scholarly source would be a general website, blog, or news article. A timely reference is one published within the last 7 years (i.e., between July 20, 2018, and July 19, 2025).
110
-
111
- Check for two conditions: (1) Are there at least 3 scholarly references? AND (2) Are all of those references dated within the last 7 years?
112
-
113
- Scoring:
114
-
115
- 10 pts: At least 3 scholarly references are cited, AND all references are dated within the last 7 years.
116
-
117
- 0 pts: Fewer than 3 scholarly references are cited, OR one or more references are older than 7 years.
118
-
119
- 9. APA References - Author Names (5 pts):
120
-
121
- Analyze all author names on the reference page. Check for correct format: Lastname, F. M.. Also check for correct handling of sources with no author (the title or organization name moves to the author position).
122
-
123
- Scoring:
124
-
125
- 5 pts: All author names are formatted perfectly.
126
-
127
- 2 pts: There is 1 error where an author's name should have been a title/publisher, or vice versa.
128
-
129
- 0 pts: There are general, repeated formatting errors in author names.
130
-
131
- 10. APA References - Dates (5 pts):
132
-
133
- Analyze the date for each reference. Check for correct APA 7th Ed. format (e.g., (Year). for journals/books; (Year, Month Day). for web sources). Count every error.
134
-
135
- Scoring:
136
-
137
- 5 pts: 0 errors.
138
-
139
- 3 pts: Exactly 1 error.
140
-
141
- 0 pts: 2 or more errors.
142
-
143
- 11. APA References - Capitalization (5 pts):
144
-
145
- Analyze the titles in each reference. Check for correct APA 7th Ed. capitalization rules: Sentence case for article and book titles. Title case for periodical (journal) titles. Count every error.
146
-
147
- Scoring:
148
-
149
- 5 pts: 0 errors.
150
-
151
- 3 pts: Exactly 1 error.
152
-
153
- 0 pts: 2 or more errors.
154
-
155
- 12. APA References - Italics (5 pts):
156
-
157
- Analyze each reference for correct italicization. Check for APA 7th Ed. rules: Italicize journal titles and volume numbers. Italicize book titles. Count every error.
158
-
159
- Scoring:
160
-
161
- 5 pts: 0 or 1 error in italicization.
162
-
163
- 0 pts: 2 or more errors in italicization.
164
-
165
- 13. APA References - Hyperlinks (5 pts):
166
-
167
- Analyze all DOIs and URLs. The 4 guidelines are: (1) All DOIs are presented as a full, active hyperlink (e.g., https://doi.org/...). (2) The phrase "Retrieved from" is NOT used before a URL or DOI. (3) There is no period after the DOI or URL. (4) URLs that are not DOIs are included.
168
-
169
- Scoring:
170
-
171
- 5 pts: All 4 guidelines are followed for all relevant references.
172
-
173
- 2 pts: 1 of the 4 guidelines is not followed.
174
-
175
- 0 pts: 2 or more of the 4 guidelines are not followed.
176
-
177
- II. Content (Total 40 points)
178
-
179
- 14. Skin Lesion: Introduction (10 pts):
180
-
181
- Analyze the introduction. Check that it: (1) Is one or two paragraphs long. (2) Clearly introduces the topic of skin lesions and states the issue to be examined. (3) Is not more than one page long. (4) Is free of spelling/typographical errors.
182
-
183
- Scoring:
184
-
185
- 10 pts: Meets all requirements with 0 spelling/typo errors.
186
-
187
- 5 pts: Meets length/content requirements but has 1-2 spelling/typo errors.
188
-
189
- 0 pts: Does not include an introduction, OR the introduction is more than 1 page long, OR it has 3 or more spelling/typographical errors.
190
-
191
- 15. Skin Lesion: Common Causes (10 pts):
192
-
193
- Analyze the body of the essay. Check if the paper discusses at least one common cause of skin lesions (e.g., infection, trauma, allergic reactions, systemic disease).
194
-
195
- Scoring:
196
-
197
- 10 pts: Discusses at least 1 common cause.
198
-
199
- 0 pts: Does not discuss any common causes.
200
-
201
- 16. Skin Lesion: Nursing Considerations (10 pts):
202
-
203
- Analyze the body of the essay. Check if the paper discusses at least one specific nursing consideration or intervention for patients with skin lesions (e.g., wound care, patient education, assessment techniques like ABCDE for melanoma, comfort measures).
204
-
205
- Scoring:
206
-
207
- 10 pts: Discusses at least 1 nursing intervention/consideration.
208
-
209
- 0 pts: Does not discuss any nursing interventions/considerations.
210
 
211
  REQUIRED OUTPUT FORMAT
212
-
213
  You must present your final evaluation in the following structured format. Do not deviate from this format.
214
 
215
  Grading Evaluation: NURS 305 Essay - Skin Lesions
216
-
217
  Student Submission Analysis
218
-
219
  Final Score: [Total Points] / 100
220
 
221
  Part I: APA Formatting (Score: [Points] / 60)
222
-
223
- 1. APA Title Page: [Score]/5. Justification: [State precisely why the score was given. E.g., "Met all 9 requirements." or "0 points awarded. The title page was missing the course number and instructor's name."]
224
-
225
- 2. APA General Guidelines: [Score]/5. Justification: [E.g., "5 points awarded. The document used 12 pt Times New Roman, 1-inch margins, double-spacing, left alignment, and paragraph indents." or "2 points awarded. The left and right margins were set to 1.25 inches instead of the required 1 inch."]
226
-
227
- 3. APA Text - Misc. Errors: [Score]/5. Justification: [E.g., "4 points awarded. One typographical error ('hte' instead of 'the') was noted in paragraph 3."]
228
-
229
- 4. APA In-text Citations - Presence: [Score]/5. Justification: [E.g., "3.5 points awarded. Analysis identified 4 statements requiring a citation that were not cited."]
230
-
231
- 5. APA In-text Citation - Formatting: [Score]/5. Justification: [E.g., "2 points awarded. Two citations used an ampersand in the narrative format (e.g., 'Smith & Jones (2022) found...') which is incorrect."]
232
-
233
- 6. APA Reference Page - General Formatting: [Score]/5. Justification: [E.g., "0 points awarded. The title 'References' was not bolded, and a hanging indent was not used."]
234
-
235
- 7. APA Reference Page - Line Spacing: [Score]/5. Justification: [E.g., "0 points awarded. An extra space was added between each reference entry."]
236
-
237
- 8. APA References - Scholarly & Timely: [Score]/10. Justification: [E.g., "10 points awarded. The paper cited 4 peer-reviewed journal articles, all published between 2020 and 2024." or "0 points awarded. Only two scholarly sources were used, and one reference was from 2016."]
238
-
239
- 9. APA References - Author Names: [Score]/5. Justification: [E.g., "5 points awarded. All author names were formatted correctly."]
240
-
241
- 10. APA References - Dates: [Score]/5. Justification: [E.g., "3 points awarded. One reference was missing the period after the year: (2021) instead of (2021)."]
242
-
243
- 11. APA References - Capitalization: [Score]/5. Justification: [E.g., "0 points awarded. The titles of two journal articles were written in title case instead of sentence case."]
244
-
245
- 12. APA References - Italics: [Score]/5. Justification: [E.g., "5 points awarded. One error noted where a journal volume number was not italicized. This falls within the 0-1 error threshold for full points."]
246
-
247
- 13. APA References - Hyperlinks: [Score]/5. Justification: [E.g., "2 points awarded. The phrase 'Retrieved from' was incorrectly used before a URL."]
248
 
249
  Part II: Content (Score: [Points] / 40)
250
-
251
- 14. Introduction: [Score]/10. Justification: [E.g., "10 points awarded. The introduction was a single, concise paragraph that clearly stated the paper's focus. No errors noted."]
252
-
253
- 15. Common Causes: [Score]/10. Justification: [E.g., "10 points awarded. The paper successfully discussed infectious agents as a common cause of skin lesions."]
254
-
255
- 16. Nursing Considerations: [Score]/10. Justification: [E.g., "0 points awarded. The paper failed to discuss any nursing interventions or specific considerations for patients with skin lesions."]
256
 
257
  Professor's Summary:
258
-
259
- [Provide a 2-3 sentence summary in the persona of Dr. Vance. E.g., "While the content discussing the cause of lesions was adequate, the submission demonstrated significant and widespread deficiencies in adhering to APA 7th Edition standards. These formatting and citation skills are non-negotiable in academic and professional nursing. Careful review of the APA manual is required before the next submission."]
260
 
261
  """
262
 
 
12
  import fitz
13
 
14
  GRADING_RUBRIC = """
15
+ GRADING RUBRIC (Total 100 points)
16
+
17
+ I. APA Formatting (60 pts)
18
+ 1. APA Title Page (5 pts): Requires 9 components: (1) Page number (1), (2) Title (bold), (3) Author, (4) Department, (5) University, (6) Course, (7) Instructor, (8) Due Date, (9) Centered/spaced correctly.
19
+ - Scoring: 5 pts: All 9 correct. 0 pts: 1+ error.
20
+ 2. APA General Guidelines (5 pts): Requires (1) Typed, (2) 1" margins, (3) 11pt Calibri or 12pt TNR, (4) Double-spaced, (5) Left-aligned, (6) Paragraphs indented 0.5".
21
+ - Scoring: 5 pts: All 6 met. 2 pts: 1 missing. 0 pts: 2+ missing.
22
+ 3. APA Text - Misc. Errors (5 pts): Check for: (1) Extra paragraph spacing, (2) Misspellings, (3) Typos.
23
+ - Scoring: 5 pts: 0 errors. 4 pts: 1 error. 0 pts: 2+ errors.
24
+ 4. APA In-text Citations - Presence (5 pts): Count missing citations for all non-common knowledge facts/opinions.
25
+ - Scoring: 5 pts: 0 missing. 3.5 pts: 1-5 missing. 0 pts: 6+ missing.
26
+ 5. APA In-text Citation - Formatting (5 pts): Check all in-text citations for correct APA 7 format.
27
+ - Scoring: 5 pts: 0 errors. 2 pts: 1-2 errors. 0 pts: 3+ errors.
28
+ 6. Ref Page - General Formatting (5 pts): Requires (1) "References" title (bold, centered, new page), (2) Alphabetical order, (3) 0.5" hanging indent.
29
+ - Scoring: 5 pts: All 3 correct. 0 pts: 1+ error.
30
+ 7. Ref Page - Line Spacing (5 pts): Entire page must be uniformly double-spaced.
31
+ - Scoring: 5 pts: Correct. 0 pts: Any error.
32
+ 8. References - Scholarly & Timely (10 pts): Must have >=3 scholarly sources, all dated within 7 years (after July 19, 2018).
33
+ - Scoring: 10 pts: Both conditions met. 0 pts: Fails one or both.
34
+ 9. References - Author Names (5 pts): Check all author names for correct APA 7 format (e.g., Lastname, F. M.) and correct handling of no-author sources.
35
+ - Scoring: 5 pts: 0 errors. 2 pts: 1 error of author vs. title/publisher. 0 pts: General format errors.
36
+ 10. References - Dates (5 pts): Check reference dates for correct APA 7 format.
37
+ - Scoring: 5 pts: 0 errors. 3 pts: 1 error. 0 pts: 2+ errors.
38
+ 11. References - Capitalization (5 pts): Check reference titles for APA 7 capitalization (sentence case for articles/books; title case for journals).
39
+ - Scoring: 5 pts: 0 errors. 3 pts: 1 error. 0 pts: 2+ errors.
40
+ 12. References - Italics (5 pts): Check references for correct APA 7 italics (journal titles/volumes, book titles).
41
+ - Scoring: 5 pts: 0-1 error. 0 pts: 2+ errors.
42
+ 13. References - Hyperlinks (5 pts): Requires (1) DOIs as active hyperlinks, (2) No "Retrieved from", (3) No period after URL/DOI, (4) Non-DOI URLs included.
43
+ - Scoring: 5 pts: All 4 rules met. 2 pts: 1 rule fails. 0 pts: 2+ rules fail.
44
+
45
+ II. Content (40 pts)
46
+ 14. Introduction (10 pts): Must be 1-2 paragraphs, introduce the topic, be <=1 page long.
47
+ - Scoring: 10 pts: Meets reqs, 0 typos. 5 pts: Meets reqs, 1-2 typos. 0 pts: Fails reqs OR 3+ typos.
48
+ 15. Common Causes (10 pts): Discusses at least one common cause of skin lesions.
49
+ - Scoring: 10 pts: Yes. 0 pts: No.
50
+ 16. Nursing Considerations (10 pts): Discusses at least one nursing intervention/consideration.
51
+ - Scoring: 10 pts: Yes. 0 pts: No.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
52
 
53
  REQUIRED OUTPUT FORMAT
 
54
  You must present your final evaluation in the following structured format. Do not deviate from this format.
55
 
56
  Grading Evaluation: NURS 305 Essay - Skin Lesions
 
57
  Student Submission Analysis
 
58
  Final Score: [Total Points] / 100
59
 
60
  Part I: APA Formatting (Score: [Points] / 60)
61
+ 1. APA Title Page: [Score]/5. Justification: [Provide specific justification for the score.]
62
+ 2. APA General Guidelines: [Score]/5. Justification: [Provide specific justification for the score.]
63
+ 3. APA Text - Misc. Errors: [Score]/5. Justification: [Provide specific justification for the score.]
64
+ 4. APA In-text Citations - Presence: [Score]/5. Justification: [Provide specific justification for the score.]
65
+ 5. APA In-text Citation - Formatting: [Score]/5. Justification: [Provide specific justification for the score.]
66
+ 6. APA Reference Page - General Formatting: [Score]/5. Justification: [Provide specific justification for the score.]
67
+ 7. APA Reference Page - Line Spacing: [Score]/5. Justification: [Provide specific justification for the score.]
68
+ 8. APA References - Scholarly & Timely: [Score]/10. Justification: [Provide specific justification for the score.]
69
+ 9. APA References - Author Names: [Score]/5. Justification: [Provide specific justification for the score.]
70
+ 10. APA References - Dates: [Score]/5. Justification: [Provide specific justification for the score.]
71
+ 11. APA References - Capitalization: [Score]/5. Justification: [Provide specific justification for the score.]
72
+ 12. APA References - Italics: [Score]/5. Justification: [Provide specific justification for the score.]
73
+ 13. APA References - Hyperlinks: [Score]/5. Justification: [Provide specific justification for the score.]
 
 
 
 
 
 
 
 
 
 
 
 
 
74
 
75
  Part II: Content (Score: [Points] / 40)
76
+ 14. Introduction: [Score]/10. Justification: [Provide specific justification for the score.]
77
+ 15. Common Causes: [Score]/10. Justification: [Provide specific justification for the score.]
78
+ 16. Nursing Considerations: [Score]/10. Justification: [Provide specific justification for the score.]
 
 
 
79
 
80
  Professor's Summary:
81
+ [Provide a 2-3 sentence summary in the persona of Dr. Vance, focusing on overall performance and key areas for improvement.]
 
82
 
83
  """
84