Skip to content

Commit

Permalink
feat: support for multiple-correct-weighted answer key (#166)
Browse files Browse the repository at this point in the history
* feat: support for multiple-correct-weighted answer key; minor refactor evaluation schema

* fix: update validation
  • Loading branch information
Udayraj123 authored Feb 24, 2024
1 parent f9f6dc3 commit c448e0c
Show file tree
Hide file tree
Showing 18 changed files with 295 additions and 142 deletions.
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ repos:
hooks:
- id: pytest-on-commit
name: Running single sample test
entry: pytest -rfpsxEX --disable-warnings --verbose -k sample1
entry: python3 -m pytest -rfpsxEX --disable-warnings --verbose -k sample1
language: system
pass_filenames: false
always_run: true
Expand All @@ -51,7 +51,7 @@ repos:
hooks:
- id: pytest-on-push
name: Running all tests before push...
entry: pytest -rfpsxEX --disable-warnings --verbose --durations=3
entry: python3 -m pytest -rfpsxEX --disable-warnings --verbose --durations=3
language: system
pass_filenames: false
always_run: true
Expand Down
Binary file added samples/answer-key/using-csv/adrian_omr.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
q1,B
q1,C
q2,E
q3,A
q4,C
q4,B
q5,B
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"answer_key_csv_path": "answer_key.csv",
"should_explain_scoring": true
},
"marking_scheme": {
"marking_schemes": {
"DEFAULT": {
"correct": "1",
"incorrect": "0",
Expand Down
35 changes: 35 additions & 0 deletions samples/answer-key/using-csv/template.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
{
"pageDimensions": [
300,
400
],
"bubbleDimensions": [
25,
25
],
"preProcessors": [
{
"name": "CropPage",
"options": {
"morphKernel": [
10,
10
]
}
}
],
"fieldBlocks": {
"MCQ_Block_1": {
"fieldType": "QTYPE_MCQ5",
"origin": [
65,
60
],
"fieldLabels": [
"q1..5"
],
"labelsGap": 52,
"bubblesGap": 41
}
}
}
35 changes: 35 additions & 0 deletions samples/answer-key/weighted-answers/evaluation.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
{
"source_type": "custom",
"options": {
"questions_in_order": [
"q1..5"
],
"answers_in_order": [
"C",
"E",
[
"A",
"C"
],
[
[
"B",
2
],
[
"C",
"3/2"
]
],
"C"
],
"should_explain_scoring": true
},
"marking_schemes": {
"DEFAULT": {
"correct": "3",
"incorrect": "-1",
"unmarked": "0"
}
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
35 changes: 35 additions & 0 deletions samples/answer-key/weighted-answers/template.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
{
"pageDimensions": [
300,
400
],
"bubbleDimensions": [
25,
25
],
"preProcessors": [
{
"name": "CropPage",
"options": {
"morphKernel": [
10,
10
]
}
}
],
"fieldBlocks": {
"MCQ_Block_1": {
"fieldType": "QTYPE_MCQ5",
"origin": [
65,
60
],
"fieldLabels": [
"q1..5"
],
"labelsGap": 52,
"bubblesGap": 41
}
}
}
2 changes: 1 addition & 1 deletion samples/community/UPSC-mock/evaluation.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
],
"should_explain_scoring": true
},
"marking_scheme": {
"marking_schemes": {
"DEFAULT": {
"correct": "2",
"incorrect": "-2/3",
Expand Down
4 changes: 2 additions & 2 deletions samples/community/UmarFarootAPS/answer_key.csv
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ q1,C
q2,C
q3,"D,E"
q4,"A,AB"
q5,"['A', ['1', '-2/3', '0']]"
q6,"['A', ['2']]"
q5,"[['A', '1'], ['B', '2']]"
q6,"['A', 'B']"
q7,C
q8,D
q9,B
Expand Down
2 changes: 1 addition & 1 deletion samples/community/UmarFarootAPS/evaluation.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"answer_key_csv_path": "answer_key.csv",
"should_explain_scoring": true
},
"marking_scheme": {
"marking_schemes": {
"DEFAULT": {
"correct": "1",
"incorrect": "0",
Expand Down
8 changes: 6 additions & 2 deletions samples/sample4/evaluation.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,19 @@
"B",
"D",
"C",
"BC",
[
"B",
"C",
"BC"
],
"A",
"C",
"D",
"C"
],
"should_explain_scoring": true
},
"marking_scheme": {
"marking_schemes": {
"DEFAULT": {
"correct": "3",
"incorrect": "-1",
Expand Down
2 changes: 1 addition & 1 deletion samples/sample5/evaluation.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
],
"should_explain_scoring": true
},
"marking_scheme": {
"marking_schemes": {
"DEFAULT": {
"correct": "1",
"incorrect": "0",
Expand Down
Loading

0 comments on commit c448e0c

Please sign in to comment.