2510회 수시 채점자료 업데이트

This commit is contained in:
2025-10-21 17:12:38 +09:00
parent 4daf3da58d
commit d97502ff5c
56 changed files with 15366 additions and 18513 deletions

View File

@@ -1065,6 +1065,39 @@ class XMLScorer:
# xpath를 사용하여 차트 요소가 있는지 확인
user_answer = bool(chart_tree.xpath(chart_xpath, namespaces=namespaces))
self.evaluate_answer(scoring, user_answer, right_answer, points)
# 하이퍼링크 채점 [1-30] 문항
elif "hyperlink" in (category or ""):
# XPath에서 searchValue가 들어간 CHAR 태그 추출
url_tags = root.xpath(xpath) if xpath else []
print("hyperlink url_tags:", url_tags)
has_hyperlink = False # FIELDBEGIN/FIELDEND 둘 다 존재하는 경우만 True
for url_tag in url_tags:
if not isinstance(url_tag, etree._Element):
continue
char_text = (url_tag.text or "").strip()
# 가장 가까운 조상 P태그 찾기
p_parent = url_tag.xpath("ancestor::P[1]")
if not p_parent:
continue
p = p_parent[0]
# 같은 P 안에 FIELDBEGIN과 FIELDEND 존재 여부 확인
has_fieldbegin = bool(p.xpath(".//FIELDBEGIN"))
has_fieldend = bool(p.xpath(".//FIELDEND"))
if has_fieldbegin and has_fieldend:
has_hyperlink = True
break
# 점수 처리 (하이퍼링크가 하나라도 설정되어 있으면 오답)
if not has_hyperlink:
self.evaluate_answer(scoring, True, right_answer, points)
else:
self.evaluate_answer(scoring, False, right_answer, 0)
finally:
# 문항 채점 결과를 리스트에 입력
@@ -1418,14 +1451,14 @@ class XMLScorer:
def main():
# 시험회차 및 유형
exam_round = '2508'
exam_round = '2510'
# exam_round = '2522'
# 채점하고자 하는 유형은 주석 해제
exam_types = [
# 'A',
# 'B',
'C',
'A',
'B',
# 'C',
# 'D',
]