summaryrefslogtreecommitdiff
path: root/yaksh/templates
diff options
context:
space:
mode:
Diffstat (limited to 'yaksh/templates')
-rw-r--r--yaksh/templates/base.html5
-rw-r--r--yaksh/templates/yaksh/show_lesson_quiz.html131
-rw-r--r--yaksh/templates/yaksh/show_video.html88
3 files changed, 178 insertions, 46 deletions
diff --git a/yaksh/templates/base.html b/yaksh/templates/base.html
index 7ce653d..53edbee 100644
--- a/yaksh/templates/base.html
+++ b/yaksh/templates/base.html
@@ -55,9 +55,8 @@
<div id="ontop">
<div id="state">
Checking...<img src="{% static 'yaksh/images/check_answer.gif' %}"/>
- </div></div>
-
-
+ </div>
+ </div>
{% block nav %}
{% endblock %}
diff --git a/yaksh/templates/yaksh/show_lesson_quiz.html b/yaksh/templates/yaksh/show_lesson_quiz.html
new file mode 100644
index 0000000..2d5184e
--- /dev/null
+++ b/yaksh/templates/yaksh/show_lesson_quiz.html
@@ -0,0 +1,131 @@
+{% load custom_filters %}
+<script type="text/javascript">
+ function user_arranged_options() {
+ var temp_array = []
+ var add_array = document.getElementById("arrange_order");
+ var ans_array = order_array.children().get()
+ var answer_is = $.each(ans_array, function(index, value) {
+ temp_array.push(value.id);
+ });
+ add_array.value = temp_array
+ }
+</script>
+<form id="submit-quiz-form" method="POST" action="{% url 'yaksh:submit_marker_quiz' course_id toc.id %}">
+ {% csrf_token %}
+ <div class="card">
+ <div class="card-header">
+ <div>
+ <div>
+ <h2>{{ question.summary }}</h2>
+ </div>
+ <div>
+ {% if question.language == "other" %}
+ <small class="text text-muted"><strong>Topic:</strong> <span class="badge badge-primary">{{question.topic}}</small></span>
+ {% else %}
+ <small class="textx text-muted"><strong>Language:</strong> <span class="badge badge-primary">{{question.language}}</span></small>
+ {% endif %}
+ {% if question.type == "mcq" %}
+ <small class="text text-muted"><strong>Type:</strong> <span class="badge badge-primary">SINGLE CORRECT CHOICE</span></small>
+ {% elif question.type == "mcc" %}
+ <small class="text text-muted"><strong>Type:</strong> <span class="badge badge-primary">MULTIPLE CORRECT CHOICES</span></small>
+ {% elif question.type == "integer" %}
+ <small class="text text-muted"><strong>Type:</strong> <span class="badge badge-primary">FILL IN THE BLANKS WITH INTEGER ANSWER</span></small>
+ {% elif question.type == "string" %}
+ <small class="text text-muted"><strong>Type:</strong> <span class="badge badge-primary">FILL IN THE BLANKS WITH STRING ANSWER</span></small>
+ {% if testcase.string_check == "lower" %}
+ <br>(CASE INSENSITIVE)
+ {% else %}
+ <br>(CASE SENSITIVE)
+ {% endif %}
+ {% elif question.type == "float" %}
+ <small class="text text-muted"><strong>Type:</strong> <span class="badge badge-primary">FILL IN THE BLANKS WITH FLOAT ANSWER</span></small>
+ {% elif question.type == "arrange" %}
+ <small class="text text-muted"><strong>Type:</strong> <span class="badge badge-primary">ARRANGE THE OPTIONS IN CORRECT ORDER</span></small>
+ {% endif %}
+ <span class="badge badge-info pull-right">
+ <small><strong>Marks: {{ question.points }}</strong></small>
+ </span>
+ </div>
+ </div>
+ </div>
+ <div class="card-body">
+ <div>
+ {{ question.description|safe }}
+ </div>
+ <br>
+ {% if question.type == "mcq" %}
+ <!-- Single correct choice type Question -->
+ {% for test_case in test_cases %}
+ {% if last_attempt and last_attempt|to_int == test_case.id %}
+ <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 }}" />
+ {{ test_case.options|safe }} <br/>
+ {% endif %}
+ {% endfor %}
+ {% endif %}
+
+ {% 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 }}" />
+ <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>
+ <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 }}" />
+ <br/><br/>
+ {% endif %}
+
+ {% if question.type == "mcc" %}
+ <!-- MCC type question -->
+ {% for test_case in test_cases %}
+ {% if last_attempt and test_case.id|safe in last_attempt|safe %}
+ <input name="answer" type="checkbox" value="{{ test_case.id }}" checked/>
+ {{ test_case.options| safe }}
+ <br>
+ {% else %}
+ <input name="answer" type="checkbox" value="{{ test_case.id }}">
+ {{ test_case.options| safe }}
+ <br>
+ {% endif %}
+ {% endfor %}
+ {% endif %}
+
+ {% if question.type == "arrange" %}
+ <!-- Arrange options type question -->
+ {% if last_attempt %}
+ {% get_answer_for_arrange_options last_attempt question as test_cases %}
+ {% endif %}
+ <input name="answer" type="hidden" id='arrange_order'/>
+ <div class="list-group">
+ <ol class="arrange">
+ {% for test_case in test_cases %}
+ <li class="list-group-item" id={{test_case.id}}>
+ {{test_case.options| safe }}</li> {% endfor %}
+ </ol>
+ </div>
+ <script type="text/javascript">
+ var arrange = $("ol.arrange");
+ var order_array = $(arrange).sortable(['serialize']);
+ </script>
+ {% endif %}
+ {% if question.type == "mcq" or question.type == "mcc" or question.type == "integer" or question.type == "float" or question.type == "string" %}
+ <br><button class="btn btn-success" type="submit" name="check" id="check">Submit
+ </button>
+ {% elif question.type == "arrange" %}
+ <br><button class="btn btn-success" type="submit" name="check" id="check" onClick="return user_arranged_options();">Submit</button>
+ {% endif %}
+ </div>
+ </div>
+</form> \ No newline at end of file
diff --git a/yaksh/templates/yaksh/show_video.html b/yaksh/templates/yaksh/show_video.html
index 4c54518..8f8bbb2 100644
--- a/yaksh/templates/yaksh/show_video.html
+++ b/yaksh/templates/yaksh/show_video.html
@@ -4,11 +4,22 @@
{% block title %} {{ learning_module.name }} {% endblock %}
{% block script %}
-<script type="text/javascript" src="{% static 'yaksh/js/lesson.js' %}">
+<script type="text/javascript">
+ var player;
+ var contents_by_time = JSON.parse('{{ contents_by_time|safe }}');
+ 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>
{% endblock %}
+{% block css %}
+<link rel="stylesheet" href="{% static 'yaksh/css/jquery-ui/jquery-ui.css' %}">
+{% endblock %}
{% block main %}
<div class="wrapper">
<!-- Sidebar -->
@@ -143,10 +154,6 @@
<div id="player" data-plyr-provider="{{video.1}}" data-plyr-embed-id="{{video.0}}"></div>
{% endif %}
{% endwith %}
- <br>
- <a href="{% url 'yaksh:next_unit' course.id learning_module.id current_unit.id %}" class="btn btn-info btn-lg" >
- Next&nbsp;<i class="fa fa-step-forward"></i>
- </a>
{% endif %}
</div>
</div>
@@ -164,14 +171,17 @@
{% with content.get_toc_text as toc_name %}
<tr>
<td>
- {{ toc_name }}
+ <a href="#" onclick="select_toc(this);" data-toc="{{content.id}}" data-content-type="{{content.content}}">{{ toc_name }}</a>
</td>
<td>
{{content.get_content_display}}
</td>
- <td>
+ <td id="toc_time_{{content.id}}">
{{content.time}}
</td>
+ <td>
+ <input type="hidden" id="toc_{{content.id}}" value="{% url 'yaksh:get_marker_quiz' course.id content.id %}" data-content="{{content.content}}"/>
+ </td>
</tr>
{% endwith %}
{% empty %}
@@ -185,48 +195,40 @@
</div>
</div>
<div class="col-md-8">
- <hr>
- <h3><strong>Lesson Description</strong></h3>
- <hr>
- <div class="col" style="width: 100%">
- {{lesson.html_data|safe}}
- </div>
- <br>
- {% if not lesson.video_path %}
- <a href="{% url 'yaksh:next_unit' course.id learning_module.id current_unit.id %}" class="btn btn-info btn-lg" >
- Next&nbsp;<i class="fa fa-step-forward"></i>
- </a>
- <br>
- {% endif %}
- <div class="col-md-7">
- {% with lesson.get_files as lesson_files %}
- {% if lesson_files %}
- <div class="card">
- <div class="card-header">
- Files for this lesson
- </div>
- <div class="card-body">
- {% for f in lesson_files %}
- <a href="{{f.file.url}}" class="list-group-item">
- {{forloop.counter}}.{{ f.file.name|file_title }}
- </a>
- {% endfor %}
+ <div class="card-body">
+ <a href="{% url 'yaksh:next_unit' course.id learning_module.id current_unit.id %}" class="btn btn-info btn-lg" >
+ Next&nbsp;<i class="fa fa-step-forward"></i>
+ </a>
+ <hr>
+ <h3><strong>Lesson Description</strong></h3>
+ <hr>
+ <div class="col" style="width: 100%">
+ {{lesson.html_data|safe}}
+ </div>
+ <div class="col-md-7">
+ {% with lesson.get_files as lesson_files %}
+ {% if lesson_files %}
+ <div class="card">
+ <div class="card-header">
+ Files for this lesson
+ </div>
+ <div class="card-body">
+ {% for f in lesson_files %}
+ <a href="{{f.file.url}}" class="list-group-item">
+ {{forloop.counter}}.{{ f.file.name|file_title }}
+ </a>
+ {% endfor %}
+ </div>
</div>
- </div>
- {% endif %}
- {% endwith %}
+ {% endif %}
+ {% endwith %}
+ </div>
</div>
</div>
</div>
{% endif %}
</div>
</div>
-<script type="text/javascript">
- $(document).ready(function () {
- $('#sidebarCollapse').on('click', function () {
- $('#sidebar').toggleClass('active');
- });
- });
-</script>
+<div id="dialog"></div>
{% endblock %}