Ejemplo n.º 1
0
 def get_ratings(self):
     ratings_dict = {
         'clarity': self.clarity.to_dict(),
         'easiness': self.easiness.to_dict(),
         'passion': self.passion.to_dict(),
     }
     ratings_dict['overall'] = _rating.get_overall_rating(
         ratings_dict.values()).to_dict()
     return util.dict_to_list(ratings_dict)
Ejemplo n.º 2
0
 def get_ratings(self):
     ratings_dict = {
         'clarity': self.clarity.to_dict(),
         'easiness': self.easiness.to_dict(),
         'passion': self.passion.to_dict(),
     }
     ratings_dict['overall'] = _rating.get_overall_rating(
             ratings_dict.values()).to_dict()
     return util.dict_to_list(ratings_dict)
Ejemplo n.º 3
0
    def get_ratings_for_course(self, course_id):
        rating_dict = {}
        for name in ['clarity', 'easiness', 'passion']:
            agg_rating = self.get_course_rating_from_redis(course_id, name)
            if agg_rating:
                rating_dict[name] = agg_rating.to_dict()

        rating_dict['overall'] = _rating.get_overall_rating(
            rating_dict.values()).to_dict()

        return util.dict_to_list(rating_dict)
Ejemplo n.º 4
0
    def get_ratings_for_course(self, course_id):
        rating_dict = {}
        for name in ['clarity', 'easiness', 'passion']:
            agg_rating = self.get_course_rating_from_redis(course_id, name)
            if agg_rating:
                rating_dict[name] = agg_rating.to_dict()

        rating_dict['overall'] = _rating.get_overall_rating(
                rating_dict.values()).to_dict()

        return util.dict_to_list(rating_dict)