feat: make it possible to enable tracking for livecode execution
Tracking of livecode execution is made possible by making the page context with course, batch and lesson available in js. Added a global page_context variable in js and the data for that gets initialzied in the learn.py.
This commit is contained in:
@@ -61,6 +61,11 @@
|
|||||||
|
|
||||||
{%- block script %}
|
{%- block script %}
|
||||||
{{ super() }}
|
{{ super() }}
|
||||||
|
|
||||||
|
<script type="text/javascript">
|
||||||
|
var page_context = {{ page_context | tojson }};
|
||||||
|
</script>
|
||||||
|
|
||||||
{% for ext in page_extensions %}
|
{% for ext in page_extensions %}
|
||||||
{{ ext.render_footer() }}
|
{{ ext.render_footer() }}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
|||||||
@@ -35,6 +35,12 @@ def get_context(context):
|
|||||||
|
|
||||||
context.page_extensions = get_page_extensions()
|
context.page_extensions = get_page_extensions()
|
||||||
|
|
||||||
|
context.page_context = {
|
||||||
|
"course": context.course.name,
|
||||||
|
"batch": context.get("batch") and context.batch.name,
|
||||||
|
"lesson": context.lesson.name
|
||||||
|
}
|
||||||
|
|
||||||
def get_chapter_title(course_name, lesson_number):
|
def get_chapter_title(course_name, lesson_number):
|
||||||
if not lesson_number:
|
if not lesson_number:
|
||||||
return
|
return
|
||||||
|
|||||||
Reference in New Issue
Block a user