2512회 채점기준표 업데이트
This commit is contained in:
37
score5.py
37
score5.py
@@ -174,27 +174,27 @@ class XMLScorer:
|
||||
points = criterion['points']
|
||||
category = criterion['category']
|
||||
item = criterion['item']
|
||||
simliar_text = None
|
||||
similar_text = None
|
||||
|
||||
# chart xml 파일에서 채점하는 경우
|
||||
if "chart_xml" in category:
|
||||
if search_value is not None:
|
||||
simliar_text = self.find_similar_text(chart_tree, search_value)
|
||||
if simliar_text is None:
|
||||
similar_text = self.find_similar_text(chart_tree, search_value)
|
||||
if similar_text is None:
|
||||
xpath = xpath.replace('{searchValue}', search_value)
|
||||
else:
|
||||
xpath = xpath.replace('{searchValue}', simliar_text)
|
||||
xpath = xpath.replace('{searchValue}', similar_text)
|
||||
|
||||
result = self.chart_query_xml(chart_tree, xpath, namespaces)
|
||||
|
||||
# 그 외의 hml 파일에서 채점하는 경우
|
||||
else:
|
||||
if search_value is not None:
|
||||
simliar_text = self.find_similar_text(root, search_value)
|
||||
if simliar_text is None:
|
||||
similar_text = self.find_similar_text(root, search_value)
|
||||
if similar_text is None:
|
||||
xpath = xpath.replace('{searchValue}', search_value)
|
||||
else:
|
||||
xpath = xpath.replace('{searchValue}', simliar_text)
|
||||
xpath = xpath.replace('{searchValue}', similar_text)
|
||||
|
||||
result = self.query_xml(root, xpath, xpath2, points, category)
|
||||
|
||||
@@ -320,8 +320,8 @@ class XMLScorer:
|
||||
input_text += table_text
|
||||
|
||||
input_text_origin = root_origin.xpath('//CHAR//text()[not(ancestor::HEADER) and not(ancestor::TABLE)]')
|
||||
talbe_text_origin = root_origin.xpath('//TABLE//CHAR//text()')
|
||||
input_text_origin += talbe_text_origin
|
||||
table_text_origin = root_origin.xpath('//TABLE//CHAR//text()')
|
||||
input_text_origin += table_text_origin
|
||||
|
||||
# 각 요소에서 공백 제거
|
||||
input_text = [text.replace(' ', '') for text in input_text]
|
||||
@@ -509,22 +509,25 @@ class XMLScorer:
|
||||
|
||||
def main():
|
||||
# scoring_criteria_path = r'./scoring_criteria.json'
|
||||
# scoring_criteria_path = r'./scoring_criteria_2501A.json'
|
||||
# scoring_criteria_path = r'./scoring_criteria_2501B.json'
|
||||
scoring_criteria_path = r'./scoring_criteria_2501C.json'
|
||||
# scoring_criteria_path = r'./scoring_criteria_2512A.json'
|
||||
# scoring_criteria_path = r'./scoring_criteria_2512B.json'
|
||||
# scoring_criteria_path = r'./scoring_criteria_2512C.json'
|
||||
scoring_criteria_path = r'./scoring_criteria_2512D.json'
|
||||
|
||||
# xml(hml)파일 디렉토리 경로
|
||||
# xml_directory = r'./output'
|
||||
xml_directory = r'./output'
|
||||
# xml_directory = r'./output/1교시'
|
||||
# xml_directory = r'./output/2교시'
|
||||
xml_directory = r'./output/3교시'
|
||||
# xml_directory = r'./output/3교시'
|
||||
|
||||
# 오탈자 체크를 위한 정답 파일 경로
|
||||
# answer_path = r'./output/정답.hml'
|
||||
# answer_path = r'./output/1교시/정답.hml'
|
||||
# answer_path = r'./output/2교시/정답.hml'
|
||||
answer_path = r'./output/3교시/정답.hml'
|
||||
# answer_path = r'./output/2512A.hml'
|
||||
# answer_path = r'./output/2512B.hml'
|
||||
# answer_path = r'./output/2512C.hml'
|
||||
answer_path = r'./output/2512D.hml'
|
||||
|
||||
|
||||
# 채점 클래스 초기화
|
||||
scorer = XMLScorer(scoring_criteria_path)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user