Skip to content

Commit

Permalink
Merge pull request #797 from adityacp/fix_video_issues
Browse files Browse the repository at this point in the history
Fix video issues
  • Loading branch information
adityacp authored Nov 12, 2020
2 parents 11a6ffb + 7ccebf2 commit 0cf9c57
Show file tree
Hide file tree
Showing 6 changed files with 39 additions and 20 deletions.
23 changes: 23 additions & 0 deletions stats/migrations/0002_release_0_29_1.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Generated by Django 3.0.7 on 2020-11-12 12:11

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('stats', '0001_initial'),
]

operations = [
migrations.AddField(
model_name='lessonlog',
name='current_time',
field=models.CharField(default='00:00:00', max_length=20),
),
migrations.AddField(
model_name='tracklesson',
name='watched',
field=models.BooleanField(default=False),
),
]
11 changes: 4 additions & 7 deletions yaksh/static/yaksh/js/show_toc.js
Original file line number Diff line number Diff line change
Expand Up @@ -118,11 +118,8 @@ function unlock_screen() {
}

function show_question(data) {
$("#dialog").html(data);
$("#dialog").dialog({
width: 800,
height: 500,
});
$("#myModal").modal({backdrop: 'static', keyboard: false});
$("#lesson_quiz_question").html(data)
$("#submit-quiz-form").submit(function(e) {
e.preventDefault();
lock_screen();
Expand All @@ -135,7 +132,7 @@ function show_question(data) {
function select_toc(element) {
var toc_id = element.getAttribute("data-toc");
var content_type = element.getAttribute("data-toc-type");
var toc_time = $("#toc_time_"+toc_id).val();
var toc_time = $("#toc_time_"+toc_id).html().trim();
player.currentTime = get_time_in_seconds(toc_time);
if (content_type == 1) {
show_topic($("#toc_desc_"+toc_id).val(), true);
Expand Down Expand Up @@ -199,8 +196,8 @@ function ajax_call(url, method, data, csrf, screen_lock=true) {
show_question(msg.data);
}
if (msg.message) {
$("#myModal").modal('hide');
if (msg.success) {
$("#dialog").dialog("close");
show_message(msg.message, "success");
}
else {
Expand Down
1 change: 0 additions & 1 deletion yaksh/templates/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@
</script>
<script type="text/javascript" src="{% static 'yaksh/js/toastr.min.js' %}">
</script>

<!-- The loading of KaTeX is deferred to speed up page rendering -->
<script defer src="https://cdn.jsdelivr.net/npm/katex@0.12.0/dist/katex.min.js" integrity="sha384-g7c+Jr9ZivxKLnZTDUhnkOnsh30B4H0rpLUpJ4jAIKs4fnJI+sEnkvrMWph2EDg4" crossorigin="anonymous"></script>

Expand Down
2 changes: 1 addition & 1 deletion yaksh/templates/yaksh/course_modules.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<div class="card">
<div class="card-header">
{{ course.name }}
<a href="{% url "yaksh:course_forum" course.id %}" class="btn btn-info pull-right">Discussion Forum</a>
<a href="{% url 'yaksh:course_forum' course.id %}" class="btn btn-info pull-right">Discussion Forum</a>
</div>
<div class="card-body">
{% if course.view_grade %}
Expand Down
8 changes: 4 additions & 4 deletions yaksh/templates/yaksh/show_lesson_quiz.html
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ <h2>{{ question.summary }}</h2>
<input name="answer" type="radio" value="{{ test_case.id }}" checked />
{{ test_case.options|safe }} <br/>
{% else %}
<input name="answer" type="radio" value="{{ test_case.id }}" />
<input name="answer" type="radio" value="{{ test_case.id }}" required="" />
{{ test_case.options|safe }} <br/>
{% endif %}
{% endfor %}
Expand All @@ -80,21 +80,21 @@ <h2>{{ question.summary }}</h2>
{% if question.type == "integer" %}
<!-- Integer type Question -->
Enter Integer:<br/>
<input autofocus class="form-control" name="answer" type="number" id="integer" value="{{ last_attempt|to_integer }}" />
<input autofocus class="form-control" name="answer" type="number" id="integer" value="{{ last_attempt|to_integer }}" required=""/>
<br><br>
{% endif %}

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

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

Expand Down
14 changes: 7 additions & 7 deletions yaksh/templates/yaksh/show_video.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,11 @@
var loc = 0;
var video_time = [];
</script>
<script type="text/javascript" src="{% static 'yaksh/js/jquery-ui.js' %}"></script>
<script type="text/javascript" src="{% static 'yaksh/js/show_toc.js' %}">
</script>
<script src="{% static 'yaksh/js/jquery-sortable.js' %}"></script>
<script type="text/javascript" src="{% static 'yaksh/js/mathjax/MathJax.js' %}?config=TeX-MML-AM_CHTML">
</script>
<script type="text/javascript" src="{% static 'yaksh/js/tinymce/js/tinymce/tinymce.min.js' %}"></script>
{% endblock %}
{% block css %}
<link rel="stylesheet" href="{% static 'yaksh/css/jquery-ui/jquery-ui.css' %}">
{% endblock %}
{% block main %}
<div class="wrapper">
<!-- Sidebar -->
Expand Down Expand Up @@ -281,6 +275,12 @@
{% endif %}
</div>
</div>
<div id="dialog"></div>
<div class="modal" tabindex="-1" role="dialog" id="myModal">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-body" id="lesson_quiz_question"></div>
</div>
</div>
</div>
{% endblock %}

0 comments on commit 0cf9c57

Please sign in to comment.