deason 2 gadi atpakaļ
vecāks
revīzija
5c7e6d0335
1 mainītis faili ar 21 papildinājumiem un 1 dzēšanām
  1. 21 1
      exportexamdetail/examInf.py

+ 21 - 1
exportexamdetail/examInf.py

@@ -113,7 +113,8 @@ def getExamRecordPaperStruct(examRecordDataId):
 def getExamRecordQuestions(examRecordDataId):
     url = "https://" + config.domain + "/api/ecs_oe_admin/examRecordQuestions/getExamRecordQuestions"
     params = {
-        "examRecordDataId": examRecordDataId
+        "examRecordDataId": examRecordDataId,
+        "withScore": True,
     }
     result = requests.get(url, params=params, headers=config.header, verify=False)
     if result.status_code == 200:
@@ -217,11 +218,15 @@ def solveexamRecord(examRecorddetail):
                 soup = bs4.BeautifulSoup(body, features="html.parser")
                 # content_div.append(str(sub_number)+"、")
                 content_div.append(soup)
+
                 rightAnswer = questionUnit["rightAnswer"]
                 quesitonEntity = quesitonEntites[sub_number - 1]
                 optionorder = quesitonEntity["optionPermutation"]
                 questionScore = quesitonEntity["questionScore"]
                 studentAnswer = quesitonEntity["studentAnswer"]
+
+                studentScore = quesitonEntity["studentScore"]
+
                 questionOptionList = questionUnit["questionOptionList"]
                 score_span.string = "(" + str(questionScore) + "分)"
                 if questionOptionList:
@@ -278,6 +283,21 @@ def solveexamRecord(examRecorddetail):
                     studentAnswercontentspan.append(
                         bs4.BeautifulSoup(studentAnswer if studentAnswer else '', features="html.parser"))
 
+                student_score_div = record.new_tag("div", attrs={"data-v-3575fe23": "",
+                                                                 "style": "color: red; font-weight: bold;clear:both"})
+                answerdiv.append(student_score_div)
+
+                right_score_div_title = record.new_tag("div", attrs={"data-v-3575fe23": "", "style": "float:left"})
+                right_score_div_title.string = "得分:"
+                student_score_div.append(right_score_div_title)
+
+                student_score_content_span = record.new_tag("span", attrs={"data-v-3575fe23": ""})
+                if studentScore is None:
+                    student_score_content_span.string = "--分"
+                else:
+                    student_score_content_span.string = str(studentScore) + "分"
+                student_score_div.append(student_score_content_span)
+
                 # print(sub_number, " ", body, " ", studentAnswer, rightAnswer, questionScore)
                 sub_number = sub_number + 1