예제 #1
0
파일: test.py 프로젝트: dazbur/languagebot
    def post(self):
        pos =  self.words_iterator["pos"] - 1
        word = self.words_iterator["words"][pos]

        test_result = TestResults()
        test_result.word = word.word
        test_result.added = word.added
        test_result.testresult= int(self.request.get("level"))
        test_result.put()
        self.show_next_word()
예제 #2
0
파일: test.py 프로젝트: dazbur/languagebot
    def get(self):
        results = TestResults.all().order("added")
        res_dict = {}
        sorted_dates = []
        for res in results:
            date_str = str(res.added.year)+'-'+str(res.added.month)+'-'+str(res.added.day)
            if not date_str in sorted_dates:
                sorted_dates.append(date_str)
            if res_dict.has_key(date_str):
                res_dict[date_str].append(res.testresult)
            else:
                res_dict[date_str] = [res.testresult]

        for i in  sorted_dates:
            a = sum(res_dict[i]) / len(res_dict[i])
            print "sss"
            print "%s : %s" % (i, res_dict[i])