2506회 정기 채점기준표 업데이트

This commit is contained in:
2025-07-02 17:02:50 +09:00
parent a0de6cf10b
commit b6a2d1af88
18 changed files with 17998 additions and 406 deletions

View File

@@ -38,10 +38,16 @@ class XMLScorer:
# mm to pt
def convert_mm_to_pt(self, mm):
one_mm_per_pt = 2.83465
hwp_internal_conversion_method = 100
pt = math.trunc(mm * one_mm_per_pt * hwp_internal_conversion_method)
hwp_scale = 100
pt = math.trunc(mm * one_mm_per_pt * hwp_scale)
return pt
def convert_pt_to_mm(self, pt):
one_mm_per_pt = 2.83465
hwp_scale = 100
mm = round(pt / (one_mm_per_pt * hwp_scale), 1)
return mm
# 유사한 텍스트 찾기
def find_similar_text(self, root, target_text, xml_type, threshold=0.7):
"""
@@ -172,7 +178,7 @@ class XMLScorer:
# XML문서 페이지 파싱 전처리
pages = parse_pages_by_bookmark(root)
print("🚩Pages : ", pages)
# print("🚩Pages : ", pages)
# 네임스페이스 정의
namespaces = {
@@ -397,21 +403,27 @@ class XMLScorer:
self.evaluate_answer(scoring, user_answer, right_answer, points)
if scoring['points'] > 0:
break
# [2-6] 테두리 이중실선 1.00mm
elif (category or "") == "LineShape":
line_shapes = root.xpath(xpath) if xpath else []
# 정답이 두개인 경우
elif (category or "") == "DoubleAnswer":
items1 = root.xpath(xpath) if xpath else []
items2 = root.xpath(xpath2) if xpath2 else []
user_answer = {
'Style': None,
'Width': None
}
user_answer = []
for item1, item2 in zip(items1, items2):
user_answer.append(item1)
user_answer.append(item2)
for line_shape in line_shapes:
style = line_shape.get("Style")
width = line_shape.get("Width")
user_answer['Style'] = style
user_answer['Width'] = width
self.evaluate_answer(scoring, user_answer, right_answer, points)
if scoring['points'] > 0:
break
# 사용자 입력값이 mm단위인 경우
elif (category or "") == "mmSize":
items = root.xpath(xpath)
@@ -526,8 +538,10 @@ class XMLScorer:
all_match = False
continue
user_answer = font_name[0].replace(" ", "") # 공백 제거
# 공백 제거
user_answer = font_name[0].replace(" ", "")
right_answer = right_answer.replace(" ","")
# 접두어 제거
if right_answer in ["견고딕", "중고딕"]:
user_answer = user_answer.replace("한양", "")
@@ -1217,7 +1231,7 @@ def main():
'A',
'B',
'C',
# 'D',
'D',
]
test_mode = False