|
@@ -10,6 +10,9 @@ import requests
|
|
|
|
|
|
import common
|
|
import common
|
|
import config
|
|
import config
|
|
|
|
+import warnings
|
|
|
|
+
|
|
|
|
+warnings.filterwarnings("ignore")
|
|
|
|
|
|
|
|
|
|
def calctime(m_func):
|
|
def calctime(m_func):
|
|
@@ -29,7 +32,7 @@ def login():
|
|
data = {"rootOrgId": None, "domain": config.domain.replace("exam-cloud.cn", "ecs.qmth.com.cn"),
|
|
data = {"rootOrgId": None, "domain": config.domain.replace("exam-cloud.cn", "ecs.qmth.com.cn"),
|
|
"accountType": "COMMON_LOGIN_NAME", "accountValue": config.username, "password": config.password,
|
|
"accountType": "COMMON_LOGIN_NAME", "accountValue": config.username, "password": config.password,
|
|
"smsCode": None}
|
|
"smsCode": None}
|
|
- result = requests.post(url, json=data)
|
|
|
|
|
|
+ result = requests.post(url, json=data, verify=False)
|
|
if result.status_code == 200:
|
|
if result.status_code == 200:
|
|
config.header = {
|
|
config.header = {
|
|
"key": result.json()["key"],
|
|
"key": result.json()["key"],
|
|
@@ -60,7 +63,7 @@ def querydetail(curpage):
|
|
"startTime": None, "endTime": None, "infoCollector": None, "hasVirtual": None, "ORG_FIND_ALL": True,
|
|
"startTime": None, "endTime": None, "infoCollector": None, "hasVirtual": None, "ORG_FIND_ALL": True,
|
|
"examStageId": "", "examType": "ONLINE"}
|
|
"examStageId": "", "examType": "ONLINE"}
|
|
|
|
|
|
- result = requests.post(url, json=params, headers=config.header)
|
|
|
|
|
|
+ result = requests.post(url, json=params, headers=config.header, verify=False)
|
|
if result.status_code == 200:
|
|
if result.status_code == 200:
|
|
contents = result.json()["content"]
|
|
contents = result.json()["content"]
|
|
totalPages = result.json()["totalPages"]
|
|
totalPages = result.json()["totalPages"]
|
|
@@ -83,7 +86,7 @@ def findExamRecordDataEntity(examRecordId):
|
|
params = {
|
|
params = {
|
|
"examRecordDataId": examRecordId
|
|
"examRecordDataId": examRecordId
|
|
}
|
|
}
|
|
- result = requests.get(url, params=params, headers=config.header)
|
|
|
|
|
|
+ result = requests.get(url, params=params, headers=config.header, verify=False)
|
|
# print(result.json())
|
|
# print(result.json())
|
|
if result.status_code == 200:
|
|
if result.status_code == 200:
|
|
return result.json()
|
|
return result.json()
|
|
@@ -99,7 +102,7 @@ def getExamRecordPaperStruct(examRecordDataId):
|
|
params = {
|
|
params = {
|
|
"examRecordDataId": examRecordDataId
|
|
"examRecordDataId": examRecordDataId
|
|
}
|
|
}
|
|
- result = requests.get(url, params=params, headers=config.header)
|
|
|
|
|
|
+ result = requests.get(url, params=params, headers=config.header, verify=False)
|
|
if result.status_code == 200:
|
|
if result.status_code == 200:
|
|
return result.json()
|
|
return result.json()
|
|
else:
|
|
else:
|
|
@@ -112,7 +115,7 @@ def getExamRecordQuestions(examRecordDataId):
|
|
params = {
|
|
params = {
|
|
"examRecordDataId": examRecordDataId
|
|
"examRecordDataId": examRecordDataId
|
|
}
|
|
}
|
|
- result = requests.get(url, params=params, headers=config.header)
|
|
|
|
|
|
+ result = requests.get(url, params=params, headers=config.header, verify=False)
|
|
if result.status_code == 200:
|
|
if result.status_code == 200:
|
|
return result.json()
|
|
return result.json()
|
|
else:
|
|
else:
|
|
@@ -123,7 +126,7 @@ def getExamRecordQuestions(examRecordDataId):
|
|
def getQuesitons(courseCode, groupCode, questionId):
|
|
def getQuesitons(courseCode, groupCode, questionId):
|
|
url = "https://" + config.domain + "/api/ecs_ques/default_question/question"
|
|
url = "https://" + config.domain + "/api/ecs_ques/default_question/question"
|
|
data = {"examId": config.examId, "courseCode": courseCode, "groupCode": groupCode, "questionId": questionId}
|
|
data = {"examId": config.examId, "courseCode": courseCode, "groupCode": groupCode, "questionId": questionId}
|
|
- result = requests.post(url, json=data, headers=config.header)
|
|
|
|
|
|
+ result = requests.post(url, json=data, headers=config.header, verify=False)
|
|
if result.status_code == 200:
|
|
if result.status_code == 200:
|
|
return result.json()
|
|
return result.json()
|
|
else:
|
|
else:
|