|
@@ -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)
|