2506회 정기 채점결과

This commit is contained in:
2025-07-04 17:40:41 +09:00
parent 5afde84372
commit e5ca82f368
26 changed files with 1195 additions and 52 deletions

View File

@@ -742,33 +742,35 @@ class XMLScorer:
xpath = xpath.replace('{char1}', ch1)
xpath2 = xpath2.replace('{char2}', ch2)
xpath3 = xpath3.replace('{char3}', ch3)
char1_ele = root.xpath(xpath)
char2_ele = root.xpath(xpath2)
char3_ele = root.xpath(xpath3)
ch1_str = root.xpath(xpath)
ch2_str = root.xpath(xpath2)
ch3_str = root.xpath(xpath3)
sum_char = 0
# char1 요소에서 특수문자 갯수 세기 (최대 2점)
for item in char1_ele or []:
count_char1 = item.text.count(ch1)
sum_char += count_char1
for text in ch1_str or []:
ch1_count = text.count(ch1)
sum_char += ch1_count
if sum_char >= 2:
sum_char = 2
break
# char2 요소에서 특수문자 갯수 세기 (최대 1점)
# char1과 char2가 다른 경우 (예: ▶ 행사안내 ◀)
if (ch1 != ch2) and char2_ele:
count_char2 = char2_ele[0].text.count(ch2)
if count_char2 > 1:
count_char2 = 1
sum_char += count_char2
if (ch1 != ch2) and ch2_str:
for text in ch2_str or []:
ch2_count = text.count(ch2)
if ch2_count > 1:
ch2_count = 1
sum_char += ch2_count
# char2 요소에서 특수문자 갯수 세기 (최대 1점)
if char3_ele:
count_char3 = char3_ele[0].text.count(ch3)
if count_char3 > 1:
count_char3 = 1
sum_char += count_char3
# char3 요소에서 특수문자 갯수 세기 (최대 1점)
if ch3_str:
for text in ch3_str or []:
ch3_count = text.count(ch3)
if ch3_count > 1:
ch3_count = 1
sum_char += ch3_count
user_answer = sum_char
@@ -1224,7 +1226,7 @@ def main():
# 시험회차 및 유형
exam_round = '2506'
# exam_round = '2506_3'
# exam_round = '2506_5'
# 채점하고자 하는 유형은 주석 해제
exam_types = [