コード例 #1
0
 def put(self):
     message = json.loads(self.request.body)
     student_no = message['student_no']
     exam_no = message['exam_no']
     content = message['content']
     if StudentToExam.is_exists(student_no=student_no, exam_no=exam_no):
         result = StudentToExam.temp_save(student_no=student_no,
                                          exam_no=exam_no,
                                          content=content)
         if result:
             self.finish(Result.success(message="提交成功!"))
         else:
             self.finish(Result.params_error(message="提交错误,请重试!"))
コード例 #2
0
 def get(self):
     exam_no = self.get_argument("exam_no")
     student_no = self.get_argument("student_no")
     if StudentToExam.is_exists(student_no, exam_no):
         result = StudentToExam.get_content(student_no, exam_no)
         if result:
             self.finish(Result.success(message=result))
         else:
             self.finish(Result.params_error(message="您不能参加本次考试!"))
     else:
         result = StudentToExam.add_content(student_no, exam_no)
         if result:
             self.finish(Result.success(message=str([*result])))
         else:
             self.finish(Result.params_error(message="数据错误,请重试!"))
コード例 #3
0
 def get(self):
     exam_no = self.get_argument("exam_no")
     result = StudentToExam.get_rank(exam_no)
     if result:
         self.finish(Result.success(message=str([*result])))
     else:
         self.finish(Result.not_this_message(message="还没人参加考试哦!"))
コード例 #4
0
 def get(self):
     exam_no = self.get_argument("exam_no")
     result = StudentToExam.get_attended_exam(exam_no)
     if result:
         self.finish(Result.success(message=str(*result)))
     else:
         self.finish(Result.not_this_message(message="数据错误!"))
コード例 #5
0
 def get(self):
     student_no = self.get_argument("student_no")
     result = StudentToExam.get_attend_exam(student_no)
     if result:
         self.finish(Result.success(message=str(*result)))
     else:
         self.finish(Result.params_error(message="获取失败!"))
コード例 #6
0
 def post(self):
     exam_no = self.get_argument("exam_no")
     student_no = self.get_argument("student_no")
     score = self.get_argument("score")
     result = StudentToExam.get_score(exam_no, student_no, score)
     if result:
         self.finish(Result.success(message="成功@A@"))
     else:
         self.finish(Result.not_this_message(message="信息传输失败QAQ!"))
コード例 #7
0
 def get(self):
     exam_no = self.get_argument("exam_no")
     student_no = self.get_argument("student_no")
     result = StudentToExam.evaluate_exam(exam_no=exam_no,
                                          student_no=student_no)
     if result:
         self.finish(Result.success(message=result))
     else:
         self.finish(Result.not_this_message(message="信息获取错误!"))