diff --git a/DIW_2503A.json b/DIW_2503A.json index 771da70..1fa0dc6 100644 --- a/DIW_2503A.json +++ b/DIW_2503A.json @@ -1,4 +1,11 @@ { + "0-0": { + "path": "", + "path2": "", + "points": 0, + "category": "파일저장", + "item": "파일명 (수검번호.hwp/hwpx)" + }, "0-1": { "path": "boolean(//PAGEMARGIN[(@Bottom='5668'or @Bottom='5669') and (@Footer='2834' or @Footer='2835') and @Gutter='0' and (@Header='2834' or @Header='2835') and (@Left='5668' or @Left='5669') and (@Right='5668' or @Right='5669') and (@Top='5668' or @Top='5669')])", "path2": null, diff --git a/DIW_2503B.json b/DIW_2503B.json index 090f6bc..0a162f7 100644 --- a/DIW_2503B.json +++ b/DIW_2503B.json @@ -1,4 +1,11 @@ { + "0-0": { + "path": "", + "path2": "", + "points": 0, + "category": "파일저장", + "item": "파일명 (수검번호.hwp/hwpx)" + }, "0-1": { "path": "boolean(//PAGEMARGIN[(@Bottom='5668'or @Bottom='5669') and (@Footer='2834' or @Footer='2835') and @Gutter='0' and (@Header='2834' or @Header='2835') and (@Left='5668' or @Left='5669') and (@Right='5668' or @Right='5669') and (@Top='5668' or @Top='5669')])", "path2": null, diff --git a/DIW_2503C.json b/DIW_2503C.json index 3f4669a..08447c4 100644 --- a/DIW_2503C.json +++ b/DIW_2503C.json @@ -1,4 +1,11 @@ { + "0-0": { + "path": "", + "path2": "", + "points": 0, + "category": "파일저장", + "item": "파일명 (수검번호.hwp/hwpx)" + }, "0-1": { "path": "boolean(//PAGEMARGIN[(@Bottom='5668'or @Bottom='5669') and (@Footer='2834' or @Footer='2835') and @Gutter='0' and (@Header='2834' or @Header='2835') and (@Left='5668' or @Left='5669') and (@Right='5668' or @Right='5669') and (@Top='5668' or @Top='5669')])", "path2": null, diff --git a/score5.py b/score5.py index 62cbd34..93520f9 100644 --- a/score5.py +++ b/score5.py @@ -152,7 +152,7 @@ class XMLScorer: } print(f"File name: {results['filename']}") - + for criterion_id, criterion in self.scoring_criteria.items(): # 키값의 첫 숫자를 확인 @@ -167,11 +167,11 @@ class XMLScorer: previous_first_digit = first_digit id = criterion_id - xpath = criterion['path'] - xpath2 = criterion['path2'] - search_value = criterion['searchValue'] - right_answer = criterion['value'] - points = criterion['points'] + xpath = criterion['path'] if 'path' in criterion else None + xpath2 = criterion['path2'] if 'path2' in criterion else None + search_value = criterion['searchValue'] if 'searchValue' in criterion else None + right_answer = criterion['value'] if 'value' in criterion else None + points = criterion['points'] if 'points' in criterion else None category = criterion['category'] item = criterion['item'] similar_text = None @@ -254,7 +254,7 @@ class XMLScorer: partial_score += scoring['points'] print(f'scoring: {scoring}') - + results['total_score'] = total_score if previous_first_digit is not None: @@ -544,11 +544,11 @@ def main(): exam_round = '2503' exam_types = [ 'A', - 'B', - 'C', + # 'B', + # 'C', ] - test_mode = False - # test_mode = True + # test_mode = False + test_mode = True output_excel_paths = [] for exam_type in exam_types: @@ -577,4 +577,4 @@ def main(): print(f"채점 결과 엑셀 파일: {output_excel_paths}") if __name__ == '__main__': - main() + main()