|
@@ -3,13 +3,13 @@
|
|
时间:2020/03/17
|
|
时间:2020/03/17
|
|
author:pengchen
|
|
author:pengchen
|
|
"""
|
|
"""
|
|
|
|
+import csv
|
|
|
|
+import os
|
|
|
|
+
|
|
import cloudservice
|
|
import cloudservice
|
|
import config
|
|
import config
|
|
-import os
|
|
|
|
-import json
|
|
|
|
-import logger
|
|
|
|
import htmlhandler
|
|
import htmlhandler
|
|
-import csv
|
|
|
|
|
|
+import logger
|
|
|
|
|
|
questionlist = []
|
|
questionlist = []
|
|
solvelist = []
|
|
solvelist = []
|
|
@@ -53,8 +53,15 @@ def handleRecordData(courseId, next):
|
|
examRecordForMarkingBeanList = result["examRecordForMarkingBeanList"]
|
|
examRecordForMarkingBeanList = result["examRecordForMarkingBeanList"]
|
|
if len(examRecordForMarkingBeanList) > 0:
|
|
if len(examRecordForMarkingBeanList) > 0:
|
|
for examRecordForMarking in examRecordForMarkingBeanList:
|
|
for examRecordForMarking in examRecordForMarkingBeanList:
|
|
|
|
+
|
|
|
|
+ # examRecordDataId = str(examRecordForMarking["examRecordDataId"]);
|
|
|
|
+ # if examRecordDataId != "39881554" and examRecordDataId != "39879641":
|
|
|
|
+ # # logger.info("不用处理,跳过!examRecordDataId = %s" % examRecordDataId)
|
|
|
|
+ # continue
|
|
|
|
+
|
|
|
|
+ print("开始处理 examRecordDataId = %s" % str(examRecordForMarking["examRecordDataId"]))
|
|
|
|
+
|
|
# 取试卷题目
|
|
# 取试卷题目
|
|
- logger.info("examRecordId %s handle start" % (str(examRecordForMarking["examRecordDataId"])))
|
|
|
|
course = cloudservice.getCourse(examRecordForMarking['courseId'])["courseList"][0]
|
|
course = cloudservice.getCourse(examRecordForMarking['courseId'])["courseList"][0]
|
|
examstudent = cloudservice.queryExamStudent(examRecordForMarking["examStudentId"])
|
|
examstudent = cloudservice.queryExamStudent(examRecordForMarking["examStudentId"])
|
|
mediaimportlist.append(
|
|
mediaimportlist.append(
|
|
@@ -62,21 +69,24 @@ def handleRecordData(courseId, next):
|
|
examstudentlist.append([examstudent["courseCode"], examstudent["courseName"],
|
|
examstudentlist.append([examstudent["courseCode"], examstudent["courseName"],
|
|
examRecordForMarking["examRecordDataId"], examstudent["identityNumber"],
|
|
examRecordForMarking["examRecordDataId"], examstudent["identityNumber"],
|
|
examstudent["studentName"]])
|
|
examstudent["studentName"]])
|
|
|
|
+
|
|
output = config.outputpath + "/" + str(config.examId) + "/" + str(course["code"]) + "-" + \
|
|
output = config.outputpath + "/" + str(config.examId) + "/" + str(course["code"]) + "-" + \
|
|
examRecordForMarking["paperType"]
|
|
examRecordForMarking["paperType"]
|
|
if not os.path.exists(output):
|
|
if not os.path.exists(output):
|
|
os.makedirs(output)
|
|
os.makedirs(output)
|
|
savepath = output + "/" + str(examRecordForMarking["examRecordDataId"]) + ".json"
|
|
savepath = output + "/" + str(examRecordForMarking["examRecordDataId"]) + ".json"
|
|
|
|
+
|
|
if course["code"] in solvelist:
|
|
if course["code"] in solvelist:
|
|
- logger.info("已包含%s" % (course["code"]))
|
|
|
|
|
|
+ logger.info("已包含课程代码:%s" % (course["code"]))
|
|
else:
|
|
else:
|
|
- logger.info("开始处理" + str(course["code"]))
|
|
|
|
|
|
+ print("开始处理课程代码:" + str(course["code"]))
|
|
solvelist.append(course["code"])
|
|
solvelist.append(course["code"])
|
|
handlePaperStruct(course["code"], examRecordForMarking["paperType"],
|
|
handlePaperStruct(course["code"], examRecordForMarking["paperType"],
|
|
examRecordForMarking["basePaperId"], course["name"])
|
|
examRecordForMarking["basePaperId"], course["name"])
|
|
if os.path.exists(savepath):
|
|
if os.path.exists(savepath):
|
|
- logger.info("已有%s记录不再次进行处理" % str(examRecordForMarking["examRecordDataId"]))
|
|
|
|
|
|
+ logger.info("已处理,跳过!examRecordDataId = %s" % str(examRecordForMarking["examRecordDataId"]))
|
|
continue
|
|
continue
|
|
|
|
+
|
|
# #取每个人试卷的内容
|
|
# #取每个人试卷的内容
|
|
# subjectdetail = cloudservice.querySubjectInfo(examRecordForMarking["examRecordDataId"])
|
|
# subjectdetail = cloudservice.querySubjectInfo(examRecordForMarking["examRecordDataId"])
|
|
# questionbeanlist=handleStudentPaperDetail(examRecordForMarking["examRecordDataId"],subjectdetail,course["code"],examRecordForMarking["paperType"])
|
|
# questionbeanlist=handleStudentPaperDetail(examRecordForMarking["examRecordDataId"],subjectdetail,course["code"],examRecordForMarking["paperType"])
|