한글채점 개선버전 1-13문항까지 적용

This commit is contained in:
2025-04-24 18:02:32 +09:00
parent 82fe47a2ff
commit 5d3ff211ea
3 changed files with 180 additions and 4 deletions

View File

@@ -313,14 +313,26 @@ class XMLScorer:
charshape_id = root.xpath(xpath)
if not charshape_id:
charshape_id = None
user_answer = None
else:
font_id = root.xpath(f"//CHARSHAPE[@Id='{charshape_id[0]}']/FONTID/@Hangul")
font_name = root.xpath(f"//FONTFACE[@Lang='Hangul']/FONT[@Id='{font_id[0]}']/@Name")
user_answer = font_name[0]
user_answer = font_name[0]
self.evaluate_answer(scoring, user_answer, right_answer, points, method="equal")
elif "FontAttribute" in (category or ""):
charshape = root.xpath(xpath)
if not charshape:
charshape = None
user_answer = None
else:
font_attribute = charshape[0].find(right_answer)
if font_attribute is not None:
user_answer = font_attribute.tag
self.evaluate_answer(scoring, user_answer, right_answer, points, method="equal")
onePersonResult['score_results'].append(scoring)
print(f'scoring: {scoring}')
onePersonResult['partial_scores'].append({
@@ -609,7 +621,7 @@ class XMLScorer:
def main():
# 시험회차 및 유형
exam_round = '2503'
exam_round = '2504'
exam_types = [
'A',
# 'B',