2506_3 수시 채점기준표/채점결과 [1-30]줄간격문항 '문단첫글자장식' 기준 추가
This commit is contained in:
@@ -354,7 +354,7 @@ class XMLScorer:
|
||||
if "가로" in chart_type:
|
||||
if "catAx" in chart_xpath:
|
||||
chart_xpath = chart_xpath.replace("catAx", "valAx")
|
||||
if "valAx" in chart_xpath:
|
||||
elif "valAx" in chart_xpath:
|
||||
chart_xpath = chart_xpath.replace("valAx", "catAx")
|
||||
|
||||
chart_items = chart_tree.xpath(chart_xpath, namespaces=namespaces) if chart_xpath else []
|
||||
@@ -371,7 +371,7 @@ class XMLScorer:
|
||||
# 정답이 두개인 경우
|
||||
elif (category or "") == "DoubleAnswer":
|
||||
items1 = root.xpath(xpath) if xpath else []
|
||||
items2 = root.xpath(xpath2) if xpath else []
|
||||
items2 = root.xpath(xpath2) if xpath2 else []
|
||||
|
||||
user_answer = []
|
||||
for item1, item2 in zip(items1, items2):
|
||||
@@ -687,6 +687,17 @@ class XMLScorer:
|
||||
linespacing_match = False
|
||||
break
|
||||
|
||||
# 문단 첫 글자 크기에 따라 채점 기준 추가 (050624)
|
||||
# 1. 기본 줄간격 160% 일 때 26pt
|
||||
# 2. 해당 문제의 정답 줄간격 (180% = 28pt / 200% = 30pt )
|
||||
# 두 경우의 글자 크기가 아니라면 오답처리
|
||||
firstword = criterion.get('first_word', None)
|
||||
result = root.xpath(f"//CHARSHAPE[@Id=//TEXT[CHAR[text()='{firstword}']]/@CharShape]/@Height")
|
||||
firstword_size = result[0] if result else None
|
||||
|
||||
if (right_answer == '180' and firstword_size not in ['2600', '2800', None]) or (right_answer == '200' and firstword_size not in ['2600', '3000', None]):
|
||||
linespacing_match = False
|
||||
|
||||
if linespacing_match is True:
|
||||
self.evaluate_answer(scoring, user_answer, right_answer, points, method="equal")
|
||||
else:
|
||||
@@ -1253,7 +1264,8 @@ class XMLScorer:
|
||||
def main():
|
||||
|
||||
# 시험회차 및 유형
|
||||
exam_round = '2505'
|
||||
# exam_round = '2505'
|
||||
exam_round = '2506_3'
|
||||
|
||||
# 채점하고자 하는 유형은 주석 해제
|
||||
exam_types = [
|
||||
@@ -1287,11 +1299,14 @@ def main():
|
||||
|
||||
# 폴더 내 모든 xml 파일 채점
|
||||
results = scorer.score_directory(xml_directory, correct_answer_file)
|
||||
|
||||
if not results:
|
||||
print(f"❌ 채점 결과가 없습니다. {xml_directory} 폴더에 답안파일이 존재하는지 확인하세요.")
|
||||
continue
|
||||
# 채점 결과 엑셀로 저장
|
||||
output_excel_paths.append(scorer.export_to_excel(results, output_path))
|
||||
|
||||
print(f"채점 결과 엑셀 파일: {output_excel_paths}")
|
||||
if output_excel_paths:
|
||||
print(f"채점 결과 엑셀 파일: {output_excel_paths}")
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
|
||||
Reference in New Issue
Block a user