Esempio n. 1
0
 def probe(self, request, triple):
     rating = self.parse_probe(triple)
     h = [rating,
          html.P(),
          html.Form(method='POST', action='/games/%d/probe' % self.id,
                    _=["Enter three numbers: ",
                       html.Input(name='triple'),
                       html.submit('Enter')]),
          html.Form(method='POST', action='/games/%d/quiz' % self.id,
                    _=[html.rsquotify("Or if you're sure what the rule is: "),
                       html.submit('Continue')]),
          html.P(),
          self.probe_history(),
          footer]
     request.reply(h)
Esempio n. 2
0
 def quiz(self, request, yes, no):
     if (yes or no) and len(self.tests) < len(test_triplets):
         self.tests.append(yes != '')
     if len(self.tests) == len(test_triplets):
         return self.evaluate(request)
     triplet = test_triplets[len(self.tests)]
     h = [html.rsquotify("So, you're pretty sure what the rule is now? Cool. I'm going to give you some sets of numbers, and you can tell me whether they seem awesome to you or not."),
          html.P(),
          self.quiz_history(),
          html.Form(method='POST', action='/games/%d/quiz' % self.id,
                    _=["Would you say that %s looks like an awesome triplet? " % triplet,
                       html.submit('Yes', 'yes'),
                       html.submit('No', 'no')]),
          footer]
     request.reply(h)
Esempio n. 3
0
def intro():
    h = [html.P(),
         html.rsquotify("Hi there! We're going to play a game based on a classic cognitive science experiment first performed by Peter Wason in 1960 (references at the end)."),
         html.P(),
         html.rsquotify("Here's how it works. I'm thinking of a rule which separates sequences of three numbers into "),
         html.singlequote("awesome"),
         html.rsquotify(" triplets, and not-so-awesome triplets. I'll tell you for free that 2 4 6 is an awesome triplet."),
         html.P(),
         html.rsquotify("What you need to do is to figure out which rule I'm thinking of. To help you do that, I'm going to let you experiment for a bit. Enter any three numbers, and I'll tell you whether they are awesome or not. You can do this as many times as you like, so please take your time."),
         html.P(),
         html.rsquotify("When you're sure you know what the rule is, hit "),
         html.singlequote("Continue"),
         html.rsquotify(", and I'll test you to see if you've correctly worked out what the rule is."),
         html.P(),
         html.Form(method='POST', action='/start',
                   _=["Enter three numbers: ",
                      html.Input(name='triple'),
                      html.submit('Start')])]
    return h