deason il y a 1 an
Parent
commit
421cb07219
1 fichiers modifiés avec 10 ajouts et 1 suppressions
  1. 10 1
      exportexamdetail/examInf.py

+ 10 - 1
exportexamdetail/examInf.py

@@ -13,6 +13,7 @@ import config
 import warnings
 
 warnings.filterwarnings("ignore")
+errCount = 0
 
 
 def calctime(m_func):
@@ -60,10 +61,13 @@ def doExport():
     else:
         querydetail(1, None)
 
+    print("执行完成,失败数:" + str(errCount))
+
 
 @calctime
 def querydetail(curpage, courseId):
     print('')
+    global errCount
 
     url = "https://" + config.domain + "/api/ecs_oe_admin/exam/record/detail/list"
     params = {"rootOrgId": config.rootOrgId, "examRecordDataId": None, "hasStranger": None, "courseId": courseId,
@@ -84,7 +88,12 @@ def querydetail(curpage, courseId):
               + " curPage=" + str(curpage) + " courseId=" + str(courseId))
 
         for content in contents:
-            solveexamRecord(content)
+            try:
+                solveexamRecord(content)
+            except Exception as e:
+                errCount += 1
+                print("网络异常,下载失败! " + content["courseCode"] + "_" + content["identityNumber"]
+                      + "_" + content["studentName"] + " 失败数:" + str(errCount))
 
         if curpage < totalPages:
             querydetail(curpage + 1, courseId)