NDOJ/templates/course/lesson.html

40 lines
1.5 KiB
HTML
Raw Permalink Normal View History

2024-02-19 23:00:44 +00:00
{% extends "course/base.html" %}
{% block two_col_media %}
<style>
</style>
{% endblock %}
{% block middle_content %}
<center><h2>{{title}} - {{profile.username}}</h2></center>
2024-02-19 23:00:44 +00:00
<h3 class="course-content-title">{{_("Content")}}</h3>
<div>
{{ lesson.content|markdown|reference|str|safe }}
</div>
<h3 class="course-content-title">{{_("Problems")}}</h3>
<ul class="course-problem-list">
{% for lesson_problem in lesson.lesson_problems.order_by('order') %}
{% set problem = lesson_problem.problem %}
2024-02-19 23:00:44 +00:00
<a href="{{url('problem_detail', problem.code)}}">
<li>
{% if problem.id in completed_problem_ids %}
<i class="solved-problem-color fa fa-check-circle"></i>
{% elif problem.id in attempted_problems %}
<i class="attempted-problem-color fa fa-minus-circle"></i>
{% else %}
<i class="unsolved-problem-color fa fa-minus-circle"></i>
{% endif %}
<span class="problem-name">{{problem.name}}</span>
{% set pp = problem_points[problem.id] %}
<span class="score">
{% if pp and pp.case_total %}
{{(pp.case_points / pp.case_total * lesson_problem.score) |floatformat(1)}} / {{lesson_problem.score|floatformat(0)}}
2024-02-19 23:00:44 +00:00
{% else %}
0 / {{lesson_problem.score|floatformat(0)}}
2024-02-19 23:00:44 +00:00
{% endif %}
</span>
</li>
</a>
{% endfor %}
</ul>
{% endblock %}