예제 #1
0
    def finished_round(self, rating=None):
        ses = cherrypy.session
        if condition_get('choice_set') == 'relative_to_past':
            if ses['round'] > 1:
                # save relative ratings
                if rating == 'prefer_current':
                    record_transaction(ses, "5", amount=ses['amount'])
                    record_transaction(ses, "1", amount=ses['last_amount'])
                elif rating == 'prefer_last':
                    record_transaction(ses, "1", amount=ses['amount'])
                    record_transaction(ses, "5", amount=ses['last_amount'])
        else:
            record_transaction(ses, rating)

        ses['round'] += 1

        if ses['round'] > ses['experiment'].num_rounds_per_subject:
            # all done, back to mturk now
            return redirect('finished_experiment', internal=False)
        else:
            # lets start another round!
            return redirect('offer', internal=False)
예제 #2
0
  def finished_round(self, rating=None):
    ses = cherrypy.session
    if condition_get('choice_set') == 'relative_to_past': 
      if ses['round'] > 1:
        # save relative ratings
        if rating == 'prefer_current':
          record_transaction(ses, "5", amount=ses['amount']) 
          record_transaction(ses, "1", amount=ses['last_amount']) 
        elif rating == 'prefer_last':
          record_transaction(ses, "1", amount=ses['amount']) 
          record_transaction(ses, "5", amount=ses['last_amount']) 
    else:
      record_transaction(ses, rating) 

    ses['round'] += 1

    if ses['round'] > ses['experiment'].num_rounds_per_subject:
      # all done, back to mturk now
      return redirect('finished_experiment', internal=False)
    else:
    # lets start another round!
      return redirect('offer', internal=False)
예제 #3
0
  def offer(self):
    ses = cherrypy.session
    if not 'round' in cherrypy.session:
      ses['round'] = 1

    experiment = ses['experiment']

    if ses['round'] > experiment.num_rounds_per_subject:
      # all done, back to mturk now
      return redirect('finished_experiment', internal=False)
    else:
      #TODO - ask experiment to configure this randomness 
      amount = random.randint(0,10)
      ses['last_amount'] = ses.get('amount')
      ses['amount'] = amount
      ses['start_time'] = datetime.datetime.now()
      return render_for_experiment('offer.html', experiment, amount=amount)
예제 #4
0
    def offer(self):
        ses = cherrypy.session
        if not 'round' in cherrypy.session:
            ses['round'] = 1

        experiment = ses['experiment']

        if ses['round'] > experiment.num_rounds_per_subject:
            # all done, back to mturk now
            return redirect('finished_experiment', internal=False)
        else:
            #TODO - ask experiment to configure this randomness
            amount = random.randint(0, 10)
            ses['last_amount'] = ses.get('amount')
            ses['amount'] = amount
            ses['start_time'] = datetime.datetime.now()
            return render_for_experiment('offer.html',
                                         experiment,
                                         amount=amount)
예제 #5
0
 def index(self):
     return redirect('intro', internal=False)
예제 #6
0
 def index(self):
   return redirect('intro', internal=False)