Esempio n. 1
0
 def advance_pair(self):
     current_session = self.participant.current_session
     current_session.img_index += 1
     img_index = current_session.img_index
     label, img = exper.gen_pair()
     current_session.label = label
     current_session.img = img
     if img_index % BLOCKSIZE == 0:
         self.participant.on_break = True
     db.session.commit()
Esempio n. 2
0
 def __init__(self, participant, assignment_id, submit_to, hit_id):
     self.id = str(uuid.uuid4())
     self.created_at = datetime.datetime.now()
     self.session_participant = participant
     self.img_index = 0
     self.correct = 0
     self.incorrect = 0
     new_block = Block(self)
     self.blocks.append(new_block)
     self.current_block = new_block
     self.assignment_id = assignment_id
     self.submit_to = submit_to
     self.hit_id = hit_id
     label, img = exper.gen_pair()
     self.label = label
     self.img = img