Ejemplo n.º 1
0
 def decryptEval(self, encryptedEval):
     rank = self.decrypt(encryptedEval.rank)
     token = self.decrypt(encryptedEval.token)
     adjective = self.decrypt(encryptedEval.adjective)
     description = self.decrypt(encryptedEval.description)
     eval = Evaluation()
     eval.parse(encryptedEval)
     eval.rank = int(rank)
     eval.token = int(token)
     eval.adjective = adjective
     eval.description = description
     return eval
Ejemplo n.º 2
0
 def convert(self):
     evaluation = Evaluation()
     evaluation.evaler_id = self.EVALER_ID
     evaluation.evalee_id = self.EVALEE_ID
     evaluation.week = self.WEEK
     evaluation.rank = self.RANK
     evaluation.token = self.TOKEN
     evaluation.description = self.DESCRIPTION
     evaluation.submission_time = self.SUBMISSION_TIME
     evaluation.adjective = self.ADJ
     enrollment = session.query(Enrollment).filter_by(student_id=self.EVALER_ID).first()
     if enrollment == None:
         enrollment_tmp = session.query(Enrollment).filter_by(student_id=self.EVALER_ID).all()
         if enrollment_tmp == None:
             print 'No record found in enrollment table.'
         else:    
             for element in enrollment_tmp:
                 print element.student_id, element.semester_id
         print self.EVALER_ID, self.EVALEE_ID, self.WEEK, self.RANK, self.TOKEN, self.DESCRIPTION
     evaluation.semester_id = enrollment.semester_id
     evaluation.semester = enrollment.semester
     evaluation.evaler = session.query(Student).filter_by(user_name=self.EVALER_ID).first()
     evaluation.evalee = session.query(Student).filter_by(user_name=self.EVALEE_ID).first()
     return evalCipher.encryptEval(evaluation)