Exemple #1
0
    def get(self):
        if not self.request_bool("map", default=False):
            return self.redirect("/#browse")

        user_data = models.UserData.current() or models.UserData.pre_phantom()
        user_exercise_graph = models.UserExerciseGraph.get(user_data)

        show_review_drawer = (not user_exercise_graph.has_completed_review())

        template_values = {
            'graph_dict_data': exercise_graph_dict_json(user_data),
            'user_data': user_data,
            'expanded_all_exercises': user_data.expanded_all_exercises,
            'map_coords': json.dumps(knowledgemap.deserializeMapCoords(user_data.map_coords)),
            'selected_nav_link': 'practice',
            'show_review_drawer': show_review_drawer,
        }

        if show_review_drawer:
            template_values['review_statement'] = u"לשלוט בחומר"
            template_values['review_call_to_action'] = u"לך על זה"

        bingo('suggested_activity_exercises_landing')

        self.render_jinja2_template('viewexercises.html', template_values)
Exemple #2
0
    def get(self):
        user_data = UserData.current()

        from exercises import exercise_graph_dict_json

        context = {
            'graph_dict_data': exercise_graph_dict_json(user_data),
            'user_data': user_data,
            'expanded_all_exercises': user_data.expanded_all_exercises,
            'map_coords': json.dumps(deserializeMapCoords(user_data.map_coords)),

            # Get pregenerated library content from our in-memory/memcache
            # two-layer cache
            'library_content': library_content_html(),
        }
        self.render_jinja2_template("goals/creategoal.html", context)
Exemple #3
0
    def get(self):
        user_data = UserData.current()

        from exercises import exercise_graph_dict_json

        context = {
            'graph_dict_data': exercise_graph_dict_json(user_data),
            'user_data': user_data,
            'expanded_all_exercises': user_data.expanded_all_exercises,
            'map_coords': deserializeMapCoords(user_data.map_coords),

            # Get pregenerated library content from our in-memory/memcache
            # two-layer cache
            'library_content': library_content_html(),
        }
        self.render_jinja2_template("goals/creategoal.html", context)
Exemple #4
0
    def get(self):
        user_data = models.UserData.current() or models.UserData.pre_phantom()
        user_exercise_graph = models.UserExerciseGraph.get(user_data)

        sees_new_review = ab_test('Review Mode UI',
            conversion_name=ViewExercise._review_conversion_names,
            conversion_type=ViewExercise._review_conversion_types)
        show_review_drawer = (sees_new_review and not
                user_exercise_graph.has_completed_review())

        template_values = {
            'graph_dict_data': exercise_graph_dict_json(user_data),
            'user_data': user_data,
            'expanded_all_exercises': user_data.expanded_all_exercises,
            'map_coords': knowledgemap.deserializeMapCoords(user_data.map_coords),
            'selected_nav_link': 'practice',
            'show_review_drawer': show_review_drawer,
        }

        if show_review_drawer:

            template_values['review_statement'] = ab_test(
                'review_statement_of_fact', [
                    'Fortify your knowledge',
                    'Attain mastery',
                    'Review exercises',
                    'Reinforce your learning',
                    'Consolidate what you know',
                    "Master what you've learned",
                    'How much can you recall?',
                    "Let's review",
                    'Refresh your memory',
                ]
            )

            template_values['review_call_to_action'] = ab_test(
                'review_call_to_action', [
                    'Start Reviews',
                    'Start now',
                    'Go go go!',
                    "Let's go!",
                    "I'll do it",
                    "Let's do this!",
                ]
            )

        self.render_jinja2_template('viewexercises.html', template_values)
Exemple #5
0
    def get(self):
        user_data = models.UserData.current() or models.UserData.pre_phantom()
        user_exercise_graph = models.UserExerciseGraph.get(user_data)

        sees_new_review = ab_test(
            'Review Mode UI',
            conversion_name=ViewExercise._review_conversion_names,
            conversion_type=ViewExercise._review_conversion_types)
        show_review_drawer = (sees_new_review and
                              not user_exercise_graph.has_completed_review())

        template_values = {
            'graph_dict_data': exercise_graph_dict_json(user_data),
            'user_data': user_data,
            'expanded_all_exercises': user_data.expanded_all_exercises,
            'map_coords':
            knowledgemap.deserializeMapCoords(user_data.map_coords),
            'selected_nav_link': 'practice',
            'show_review_drawer': show_review_drawer,
        }

        if show_review_drawer:

            template_values['review_statement'] = ab_test(
                'review_statement_of_fact', [
                    'Fortify your knowledge',
                    'Attain mastery',
                    'Review exercises',
                    'Reinforce your learning',
                    'Consolidate what you know',
                    "Master what you've learned",
                    'How much can you recall?',
                    "Let's review",
                    'Refresh your memory',
                ])

            template_values['review_call_to_action'] = ab_test(
                'review_call_to_action', [
                    'Start Reviews',
                    'Start now',
                    'Go go go!',
                    "Let's go!",
                    "I'll do it",
                    "Let's do this!",
                ])

        self.render_jinja2_template('viewexercises.html', template_values)
Exemple #6
0
    def get(self):
        user_data = models.UserData.current()
        user_exercise_graph = models.UserExerciseGraph.current()

        if user_data.reassess_from_graph(user_exercise_graph):
            user_data.put()

        graph_dicts = user_exercise_graph.graph_dicts()
        for graph_dict in graph_dicts:
            exercise = models.Exercise.get_by_name(graph_dict["name"])
            graph_dict["live"] = exercise and exercise.live

        template_values = {
            'graph_dict_data': exercise_graph_dict_json(user_data, admin=True),
            'map_coords': knowledgemap.deserializeMapCoords(),
            }

        self.render_jinja2_template('exerciseadmin.html', template_values)
Exemple #7
0
    def get(self):
        user_data = models.UserData.current() or models.UserData.pre_phantom()

        user_exercise_graph = models.UserExerciseGraph.get(user_data)
        if user_data.reassess_from_graph(user_exercise_graph):
            user_data.put()

        graph_dicts = user_exercise_graph.graph_dicts()
        suggested_graph_dicts = user_exercise_graph.suggested_graph_dicts()
        proficient_graph_dicts = user_exercise_graph.proficient_graph_dicts()
        recent_graph_dicts = user_exercise_graph.recent_graph_dicts()
        review_graph_dicts = user_exercise_graph.review_graph_dicts()

        for graph_dict in suggested_graph_dicts:
            graph_dict["status"] = "Suggested"

        for graph_dict in proficient_graph_dicts:
            graph_dict["status"] = "Proficient"

        for graph_dict in review_graph_dicts:
            graph_dict["status"] = "Review"

            try:
                suggested_graph_dicts.remove(graph_dict)
            except ValueError:
                pass

        template_values = {
            'graph_dicts': graph_dicts,
            'suggested_graph_dicts': suggested_graph_dicts,
            'recent_graph_dicts': recent_graph_dicts,
            'review_graph_dicts': review_graph_dicts,
            'user_data': user_data,
            'expanded_all_exercises': user_data.expanded_all_exercises,
            'map_coords':
            knowledgemap.deserializeMapCoords(user_data.map_coords),
            'selected_nav_link': 'practice',
        }

        self.render_jinja2_template('viewexercises.html', template_values)
Exemple #8
0
    def get(self):
        user_data = models.UserData.current() or models.UserData.pre_phantom()

        user_exercise_graph = models.UserExerciseGraph.get(user_data)
        if user_data.reassess_from_graph(user_exercise_graph):
            user_data.put()

        graph_dicts = user_exercise_graph.graph_dicts()
        suggested_graph_dicts = user_exercise_graph.suggested_graph_dicts()
        proficient_graph_dicts = user_exercise_graph.proficient_graph_dicts()
        recent_graph_dicts = user_exercise_graph.recent_graph_dicts()
        review_graph_dicts = user_exercise_graph.review_graph_dicts()

        for graph_dict in suggested_graph_dicts:
            graph_dict["status"] = "Suggested"

        for graph_dict in proficient_graph_dicts:
            graph_dict["status"] = "Proficient"

        for graph_dict in review_graph_dicts:
            graph_dict["status"] = "Review"

            try:
                suggested_graph_dicts.remove(graph_dict)
            except ValueError:
                pass

        template_values = {
            'graph_dicts': graph_dicts,
            'suggested_graph_dicts': suggested_graph_dicts,
            'recent_graph_dicts': recent_graph_dicts,
            'review_graph_dicts': review_graph_dicts,
            'user_data': user_data,
            'expanded_all_exercises': user_data.expanded_all_exercises,
            'map_coords': knowledgemap.deserializeMapCoords(user_data.map_coords),
            'selected_nav_link': 'practice',
            }

        self.render_jinja2_template('viewexercises.html', template_values)