Skip to content

Commit 0cf9c57

Browse files
authored
Merge pull request #797 from adityacp/fix_video_issues
Fix video issues
2 parents 11a6ffb + 7ccebf2 commit 0cf9c57

File tree

6 files changed

+39
-20
lines changed

6 files changed

+39
-20
lines changed
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Generated by Django 3.0.7 on 2020-11-12 12:11
2+
3+
from django.db import migrations, models
4+
5+
6+
class Migration(migrations.Migration):
7+
8+
dependencies = [
9+
('stats', '0001_initial'),
10+
]
11+
12+
operations = [
13+
migrations.AddField(
14+
model_name='lessonlog',
15+
name='current_time',
16+
field=models.CharField(default='00:00:00', max_length=20),
17+
),
18+
migrations.AddField(
19+
model_name='tracklesson',
20+
name='watched',
21+
field=models.BooleanField(default=False),
22+
),
23+
]

yaksh/static/yaksh/js/show_toc.js

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -118,11 +118,8 @@ function unlock_screen() {
118118
}
119119

120120
function show_question(data) {
121-
$("#dialog").html(data);
122-
$("#dialog").dialog({
123-
width: 800,
124-
height: 500,
125-
});
121+
$("#myModal").modal({backdrop: 'static', keyboard: false});
122+
$("#lesson_quiz_question").html(data)
126123
$("#submit-quiz-form").submit(function(e) {
127124
e.preventDefault();
128125
lock_screen();
@@ -135,7 +132,7 @@ function show_question(data) {
135132
function select_toc(element) {
136133
var toc_id = element.getAttribute("data-toc");
137134
var content_type = element.getAttribute("data-toc-type");
138-
var toc_time = $("#toc_time_"+toc_id).val();
135+
var toc_time = $("#toc_time_"+toc_id).html().trim();
139136
player.currentTime = get_time_in_seconds(toc_time);
140137
if (content_type == 1) {
141138
show_topic($("#toc_desc_"+toc_id).val(), true);
@@ -199,8 +196,8 @@ function ajax_call(url, method, data, csrf, screen_lock=true) {
199196
show_question(msg.data);
200197
}
201198
if (msg.message) {
199+
$("#myModal").modal('hide');
202200
if (msg.success) {
203-
$("#dialog").dialog("close");
204201
show_message(msg.message, "success");
205202
}
206203
else {

yaksh/templates/base.html

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@
4747
</script>
4848
<script type="text/javascript" src="{% static 'yaksh/js/toastr.min.js' %}">
4949
</script>
50-
5150
<!-- The loading of KaTeX is deferred to speed up page rendering -->
5251
<script defer src="https://cdn.jsdelivr.net/npm/katex@0.12.0/dist/katex.min.js" integrity="sha384-g7c+Jr9ZivxKLnZTDUhnkOnsh30B4H0rpLUpJ4jAIKs4fnJI+sEnkvrMWph2EDg4" crossorigin="anonymous"></script>
5352

yaksh/templates/yaksh/course_modules.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<div class="card">
88
<div class="card-header">
99
{{ course.name }}
10-
<a href="{% url "yaksh:course_forum" course.id %}" class="btn btn-info pull-right">Discussion Forum</a>
10+
<a href="{% url 'yaksh:course_forum' course.id %}" class="btn btn-info pull-right">Discussion Forum</a>
1111
</div>
1212
<div class="card-body">
1313
{% if course.view_grade %}

yaksh/templates/yaksh/show_lesson_quiz.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ <h2>{{ question.summary }}</h2>
7171
<input name="answer" type="radio" value="{{ test_case.id }}" checked />
7272
{{ test_case.options|safe }} <br/>
7373
{% else %}
74-
<input name="answer" type="radio" value="{{ test_case.id }}" />
74+
<input name="answer" type="radio" value="{{ test_case.id }}" required="" />
7575
{{ test_case.options|safe }} <br/>
7676
{% endif %}
7777
{% endfor %}
@@ -80,21 +80,21 @@ <h2>{{ question.summary }}</h2>
8080
{% if question.type == "integer" %}
8181
<!-- Integer type Question -->
8282
Enter Integer:<br/>
83-
<input autofocus class="form-control" name="answer" type="number" id="integer" value="{{ last_attempt|to_integer }}" />
83+
<input autofocus class="form-control" name="answer" type="number" id="integer" value="{{ last_attempt|to_integer }}" required=""/>
8484
<br><br>
8585
{% endif %}
8686

8787
{% if question.type == "string" %}
8888
<!-- String type question -->
8989
Enter Text:<br/>
90-
<textarea autofocus name="answer" id="string" class="form-control" style="width: 100%">{{ last_attempt|to_str }}</textarea>
90+
<textarea autofocus name="answer" id="string" class="form-control" style="width: 100%" required="">{{ last_attempt|to_str }}</textarea>
9191
<br/><br/>
9292
{% endif %}
9393

9494
{% if question.type == "float" %}
9595
<!-- Float type question -->
9696
Enter Decimal Value :<br/>
97-
<input autofocus class="form-control" name="answer" type="number" step="any" id="float" value="{{ last_attempt|to_float }}" />
97+
<input autofocus class="form-control" name="answer" type="number" step="any" id="float" value="{{ last_attempt|to_float }}" required=""/>
9898
<br/><br/>
9999
{% endif %}
100100

yaksh/templates/yaksh/show_video.html

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,17 +10,11 @@
1010
var loc = 0;
1111
var video_time = [];
1212
</script>
13-
<script type="text/javascript" src="{% static 'yaksh/js/jquery-ui.js' %}"></script>
1413
<script type="text/javascript" src="{% static 'yaksh/js/show_toc.js' %}">
1514
</script>
1615
<script src="{% static 'yaksh/js/jquery-sortable.js' %}"></script>
17-
<script type="text/javascript" src="{% static 'yaksh/js/mathjax/MathJax.js' %}?config=TeX-MML-AM_CHTML">
18-
</script>
1916
<script type="text/javascript" src="{% static 'yaksh/js/tinymce/js/tinymce/tinymce.min.js' %}"></script>
2017
{% endblock %}
21-
{% block css %}
22-
<link rel="stylesheet" href="{% static 'yaksh/css/jquery-ui/jquery-ui.css' %}">
23-
{% endblock %}
2418
{% block main %}
2519
<div class="wrapper">
2620
<!-- Sidebar -->
@@ -281,6 +275,12 @@
281275
{% endif %}
282276
</div>
283277
</div>
284-
<div id="dialog"></div>
278+
<div class="modal" tabindex="-1" role="dialog" id="myModal">
279+
<div class="modal-dialog" role="document">
280+
<div class="modal-content">
281+
<div class="modal-body" id="lesson_quiz_question"></div>
282+
</div>
283+
</div>
284+
</div>
285285
{% endblock %}
286286

0 commit comments

Comments
 (0)