Ejemplo n.º 1
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!"))
Ejemplo n.º 2
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="信息获取错误!"))
Ejemplo n.º 3
0
 def post(self):
     message = json.loads(self.request.body)
     no = message['student_no']
     email = message['email']
     result = Students.add_email(no, email)
     if result:
         email_send = student_check(email, no)
         if email_send:
             self.finish(Result.success(message="信息发出成功!邮箱添加成功!"))
         else:
             self.finish(
                 Result.not_this_message(message="邮箱服务出现错误,不能提供服务,请谅解!"))
     else:
         self.finish(Result.params_error(message="邮箱已添加不必重复操作!"))
Ejemplo n.º 4
0
 def post(self):
     message = json.loads(self.request.body)
     no = message['student_no']
     username = message['student_name']
     password = message['password']
     if no and username and password:
         if Students.is_exists(student_no=no):
             self.finish(Result.already_register(message="该账号已经注册,请更换账号!"))
         else:
             Students.add_student(no, hashed(password))
             AuthInformation.initial(no, username)
             self.finish(Result.success(message="注册成功!"))
     else:
         self.finish(Result.not_this_message(message="信息输入不全面!请重新输入"))
Ejemplo n.º 5
0
 def get(self):
     result = Students.is_active(self.get_argument("student_no"))
     if result:
         self.finish(Result.success(message="邮箱激活成功!"))
     else:
         self.finish(Result.not_this_message(message="未激活"))