summaryrefslogtreecommitdiff
path: root/yaksh
diff options
context:
space:
mode:
authoradityacp2020-01-30 20:04:29 +0530
committeradityacp2020-01-30 20:04:29 +0530
commit204290f3651bfe35cb71fe6a0affccc5209d2c76 (patch)
tree047004a7108003c69d6be6c2bb7fd13ac81e7cb8 /yaksh
parent8d9b3a10e8980284bf70298e44018766ec05de79 (diff)
downloadonline_test-204290f3651bfe35cb71fe6a0affccc5209d2c76.tar.gz
online_test-204290f3651bfe35cb71fe6a0affccc5209d2c76.tar.bz2
online_test-204290f3651bfe35cb71fe6a0affccc5209d2c76.zip
Change video, answerpaper, userdata template
- show user attempts arranged properly in answerpaper and user data templates - highlight currently viewing module and lesson
Diffstat (limited to 'yaksh')
-rw-r--r--yaksh/templates/yaksh/quizzes_user.html2
-rw-r--r--yaksh/templates/yaksh/show_video.html89
-rw-r--r--yaksh/templates/yaksh/user_data.html115
-rw-r--r--yaksh/templates/yaksh/view_answerpaper.html66
4 files changed, 132 insertions, 140 deletions
diff --git a/yaksh/templates/yaksh/quizzes_user.html b/yaksh/templates/yaksh/quizzes_user.html
index cb79799..1a708ef 100644
--- a/yaksh/templates/yaksh/quizzes_user.html
+++ b/yaksh/templates/yaksh/quizzes_user.html
@@ -145,7 +145,7 @@
{% with course.data.get_learning_modules as modules %}
{% if modules %}
<p> <span class="badge badge-pill badge-primary">
- What you'll learn</span>
+ Course Content</span>
<ul>
{% for module in modules %}
<li>{{module.name|title}}</li>
diff --git a/yaksh/templates/yaksh/show_video.html b/yaksh/templates/yaksh/show_video.html
index 42c7ee2..a2edbe0 100644
--- a/yaksh/templates/yaksh/show_video.html
+++ b/yaksh/templates/yaksh/show_video.html
@@ -15,13 +15,13 @@
{% for module in all_modules %}
<div id="accordian">
<div class="card">
- <div class="card-header" style="height: 120px">
+ <div class="card-header">
<div class="row">
<div class="col-md-10">
<a href="{% url 'yaksh:view_module' module.id course.id %}">
{{module.name}}
- {% if module.id == learning_module.id %}
- <i class="fa fa-thumb-tack" data-toggle="tooltip" title="Currently on"></i>
+ {% if learning_module.id == module.id %}
+ <i class="fa fa-edit"></i>
{% endif %}
</a>
</div>
@@ -32,7 +32,11 @@
</div>
</div>
</div>
- <div id="collapse{{module.id}}" class="collapse hide" data-parent="#accordion">
+ {% if learning_module.id == module.id %}
+ <div id="collapse{{module.id}}" class="collapse show" data-parent="#accordion">
+ {% else %}
+ <div id="collapse{{module.id}}" class="collapse hide" data-parent="#accordion">
+ {% endif %}
<div class="card-body">
{% for unit in module.get_learning_units %}
{% get_unit_status course module unit user as status %}
@@ -44,10 +48,6 @@
<i class="fa fa-square-o"></i>
{% endif %}
{{ unit.quiz.description }}
- {% if unit.id == current_unit.id %}
- <i class="fa fa-thumb-tack" data-toggle="tooltip" title="Currently on">
- </i>
- {% endif %}
</a>
{% else %}
<a href="{% url 'yaksh:show_lesson' unit.lesson.id module.id course.id %}" class="list-group-item">
@@ -58,7 +58,7 @@
{% endif %}
{{ unit.lesson.name }}
{% if unit.id == current_unit.id %}
- <i class="fa fa-thumb-tack" data-toggle="tooltip" title="Currently on">
+ <i class="fa fa-play-circle" data-toggle="tooltip" title="Currently on">
</i>
{% endif %}
</a>
@@ -75,7 +75,7 @@
<div id="content">
<button type="button" id="sidebarCollapse" class="btn btn-outline-info">
- <i class="fa fa-times fa-lg"></i>
+ <i class="fa fa-navicon fa-lg"></i>
</button>
<br><br>
@@ -106,62 +106,55 @@
{% if state == "module" %} <!-- Module instructions body -->
{% if learning_module.html_data %}
- <div></div>
- <center>
- {{learning_module.html_data|safe}}
- <br>
- {% if first_unit %}
- <a href="{% url 'yaksh:next_unit' course.id learning_module.id first_unit.id '1' %}" class="btn btn-success btn-lg">Start
- <i class="fa fa-play">
- </i>
- </a>
- {% else %}
- <a href="{% url 'yaksh:next_unit' course.id learning_module.id %}" class="btn btn-success btn-lg">Next
- <i class="fa fa-step-forward">
- </i>
- </a>
- {% endif %}
- </center>
+ {{learning_module.html_data|safe}}
{% else %}
No Module information
{% endif %}
- {% else %} <!-- Lesson body -->
- <div>
- <center>
- {{lesson.html_data|safe}}
- <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>
+ <br>
+ {% if first_unit %}
+ <a href="{% url 'yaksh:next_unit' course.id learning_module.id first_unit.id '1' %}" class="btn btn-success btn-lg">Start
+ <i class="fa fa-play">
+ </i>
</a>
- </center>
+ {% else %}
+ <a href="{% url 'yaksh:next_unit' course.id learning_module.id %}" class="btn btn-success btn-lg">Next
+ <i class="fa fa-step-forward">
+ </i>
+ </a>
+ {% endif %}
+ {% else %} <!-- Lesson body -->
+ <div class="col-md-6" style="width: 100%">
+ {{lesson.html_data|safe}}
+ <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>
</div>
<br>
+ <div class="col-md-7">
{% with lesson.get_files as lesson_files %}
{% if lesson_files %}
- <div class="col-md-7">
- <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 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>
- <br>
{% endif %}
{% endwith %}
+ </div>
{% endif %}
</div>
</div>
<script type="text/javascript">
$(document).ready(function () {
$('#sidebarCollapse').on('click', function () {
- $(this).find('i').toggleClass('fa-times fa-navicon')
$('#sidebar').toggleClass('active');
});
});
diff --git a/yaksh/templates/yaksh/user_data.html b/yaksh/templates/yaksh/user_data.html
index ff600c3..6547851 100644
--- a/yaksh/templates/yaksh/user_data.html
+++ b/yaksh/templates/yaksh/user_data.html
@@ -11,44 +11,9 @@
{% endblock %}
{% block content %}
<div class="container">
- <div class="card">
- <div class="card-header">
- Student Details
- </div>
- <div class="card-body">
- <p><b>Name:</b> {{ data.user.get_full_name.title }}</p>
- {% with data.profile as profile %}
- {% if profile %}
- <div class="row">
- <div class="col-md-4">
- <p><b> Roll number:</b> {{ profile.roll_number }}</p>
- <p><b>Position: </b> {{ profile.position }}</p>
- <p><b>Department: </b>{{ profile.department }}</p>
- <p><b>Institute: </b>{{ profile.institute }}</p>
- </div>
- <div class="col-md-7">
- <p><b>Username:</b> {{ data.user.username }}</p>
- <p><b>Email:</b> {{ data.user.email }}</p>
- <p><b>Date joined:</b> {{ data.user.date_joined }}</p>
- <p><b>Last login:</b> {{ data.user.last_login }}</p>
- </div>
- </div>
- {% endif %}
- {% endwith %}
- </div>
- </div>
- <hr>
{% if data.papers %}
- <p class="text-center"><a href="{% url 'yaksh:grade_user' data.papers.0.question_paper.quiz.id data.user.id course_id %}" class="btn btn-info ">
- Grade/correct paper</a>
- </p>
- {% for paper in data.papers %}
- {% if forloop.counter == 2 and data.questionpaperid %}
- <hr>
- <u>
- <h2> Previous attempts </h2>
- </u>
- {% endif %}
+ <p class="text-center">
+ {% with data.papers.0 as paper %}
<div class="card">
<div class="card-header">
Course Details
@@ -58,35 +23,47 @@
<div class="col-md-6">
<p><b>Course:</b> {{ paper.course.name }}</p>
<p><b>Quiz:</b> {{ paper.question_paper.quiz.description }}</p>
- <p><b>Start time:</b> {{ paper.start_time }}</p>
- <p><b>End time:</b> {{ paper.end_time }}</p>
- <p><b>Status:</b>
- {% if paper.passed %}
- <span class="badge badge-pill badge-success"> Passed </span>
- {% else %}
- <span class="badge badge-pill badge-danger"> Failed </span>
- {% endif %}
- </p>
</div>
<div class="col-md-6">
- <p><b>Total Marks:</b> {{ paper.question_paper.total_marks }}</p>
- <p><b>Marks obtained:</b> {{ paper.marks_obtained }}</p>
- {% if paper.percent %}
- <p><b>Percentage obtained:</b> {{paper.percent}}%</p>
- {% endif %}
- <p><b>Total attempts at questions:</b> {{ paper.answers.count }}</p>
- <p>
- <b>Attempt Number:</b>
- <span class="badge badge-pill badge-info">
- {{paper.attempt_number}}
- </span>
- </p>
- <p><b>User IP address:</b> {{ paper.user_ip }}</p>
+ <p><b>Start time:</b> {{ paper.start_time }}</p>
+ <p><b>End time:</b> {{ paper.end_time }}</p>
+ <p><b>User IP:</b> {{paper.user_ip}} </p>
</div>
</div>
</div>
</div>
- <hr>
+ {% endwith %}
+ <br>
+ <a href="{% url 'yaksh:grade_user' data.papers.0.question_paper.quiz.id data.user.id course_id %}" class="btn btn-info">
+ Grade User
+ </a>
+ <br>
+ {% for paper in data.papers %}
+ <br>
+ <h3><b><u>Attempt Number:</u></b>&nbsp;<span class="badge badge-pill badge-info">
+ {{paper.attempt_number}}
+ </span></h3>
+ <div class="card">
+ <div class="card-header">
+ Scorecard
+ </div>
+ <div class="card-body">
+ <p><b>Status:</b>
+ {% if paper.passed %}
+ <span class="badge badge-pill badge-success"> Passed </span>
+ {% else %}
+ <span class="badge badge-pill badge-danger"> Failed </span>
+ {% endif %}
+ </p>
+ <p><b>Total Marks:</b> {{ paper.question_paper.total_marks }}</p>
+ <p><b>Marks obtained:</b> {{ paper.marks_obtained }}</p>
+ {% if paper.percent %}
+ <p><b>Percentage obtained:</b> {{paper.percent}}%</p>
+ {% endif %}
+ <p><b>Total attempts at questions:</b> {{ paper.answers.count }}</p>
+ </div>
+ </div>
+ <br>
{% if paper.answers.count %}
<div class="card">
<div class="card-header">
@@ -354,8 +331,24 @@
</div>
</div>
</div>
+ {% else %}
+ <div class="alert alert-warning">
+ No submissions found
+ </div>
{% endif %} {# if paper.answers.count #}
+ <hr>
{% endfor %} {# for paper in data.papers #}
+ {% else %}
+ <br>
+ <center>
+ <div class="alert alert-warning">
+ {% if quiz.is_exercise %}
+ You have not attempted the Exercise {{ quiz.description }}
+ {% else %}
+ You have not attempted the quiz {{ quiz.description }}
+ {% endif %}
+ </div>
+ </center>
{% endif %} {# if data.papers #}
</div>
-{% endblock %} \ No newline at end of file
+{% endblock %}
diff --git a/yaksh/templates/yaksh/view_answerpaper.html b/yaksh/templates/yaksh/view_answerpaper.html
index eeb0bf3..c1f13d1 100644
--- a/yaksh/templates/yaksh/view_answerpaper.html
+++ b/yaksh/templates/yaksh/view_answerpaper.html
@@ -2,6 +2,7 @@
{% load custom_filters %}
{% load static %}
+{% block title %} View Answer paper {% endblock %}
{% block pagetitle %} Answer Paper for {{ quiz.description }}{% endblock pagetitle %}
{% block script %}
@@ -18,13 +19,7 @@
<br><br>
{% if data.papers %}
<p class="text-center">
- {% for paper in data.papers %}
- {% if forloop.counter == 2 and data.questionpaperid %}
- <hr>
- <u>
- <h2> Previous attempts </h2>
- </u>
- {% endif %}
+ {% with data.papers.0 as paper %}
<div class="card">
<div class="card-header">
Course Details
@@ -34,35 +29,41 @@
<div class="col-md-6">
<p><b>Course:</b> {{ paper.course.name }}</p>
<p><b>Quiz:</b> {{ paper.question_paper.quiz.description }}</p>
- <p><b>Start time:</b> {{ paper.start_time }}</p>
- <p><b>End time:</b> {{ paper.end_time }}</p>
- <p><b>Status:</b>
- {% if paper.passed %}
- <span class="badge badge-pill badge-success"> Passed </span>
- {% else %}
- <span class="badge badge-pill badge-danger"> Failed </span>
- {% endif %}
- </p>
</div>
<div class="col-md-6">
- <p><b>Total Marks:</b> {{ paper.question_paper.total_marks }}</p>
- <p><b>Marks obtained:</b> {{ paper.marks_obtained }}</p>
- {% if paper.percent %}
- <p><b>Percentage obtained:</b> {{paper.percent}}%</p>
- {% endif %}
- <p><b>Total attempts at questions:</b> {{ paper.answers.count }}</p>
- <p>
- <b>Attempt Number:</b>
- <span class="badge badge-pill badge-info">
- {{paper.attempt_number}}
- </span>
- </p>
- <p><b>User IP address:</b> {{ paper.user_ip }}</p>
+ <p><b>Start time:</b> {{ paper.start_time }}</p>
+ <p><b>End time:</b> {{ paper.end_time }}</p>
</div>
</div>
</div>
</div>
- <hr>
+ {% endwith %}
+ {% for paper in data.papers %}
+ <br>
+ <h3><b><u>Attempt Number:</u></b>&nbsp;<span class="badge badge-pill badge-info">
+ {{paper.attempt_number}}
+ </span></h3>
+ <div class="card">
+ <div class="card-header">
+ Scorecard
+ </div>
+ <div class="card-body">
+ <p><b>Status:</b>
+ {% if paper.passed %}
+ <span class="badge badge-pill badge-success"> Passed </span>
+ {% else %}
+ <span class="badge badge-pill badge-danger"> Failed </span>
+ {% endif %}
+ </p>
+ <p><b>Total Marks:</b> {{ paper.question_paper.total_marks }}</p>
+ <p><b>Marks obtained:</b> {{ paper.marks_obtained }}</p>
+ {% if paper.percent %}
+ <p><b>Percentage obtained:</b> {{paper.percent}}%</p>
+ {% endif %}
+ <p><b>Total attempts at questions:</b> {{ paper.answers.count }}</p>
+ </div>
+ </div>
+ <br>
{% if paper.answers.count %}
<div class="card">
<div class="card-header">
@@ -330,7 +331,12 @@
</div>
</div>
</div>
+ {% else %}
+ <div class="alert alert-warning">
+ No submissions found
+ </div>
{% endif %} {# if paper.answers.count #}
+ <hr>
{% endfor %} {# for paper in data.papers #}
{% else %}
<br>