summaryrefslogtreecommitdiff
path: root/yaksh
diff options
context:
space:
mode:
authorankitjavalkar2019-01-30 12:50:07 +0530
committerankitjavalkar2019-01-30 12:50:07 +0530
commit64298d4afebdece1eaccb363e83dc64db6645c45 (patch)
tree19310790ca16a96e72b8d61179e908702bcda360 /yaksh
parentcedceac0c7b64e2116b5cfd5ec9461fdff98842c (diff)
downloadonline_test-64298d4afebdece1eaccb363e83dc64db6645c45.tar.gz
online_test-64298d4afebdece1eaccb363e83dc64db6645c45.tar.bz2
online_test-64298d4afebdece1eaccb363e83dc64db6645c45.zip
Allow course moderators to hide or show the grade to students
Diffstat (limited to 'yaksh')
-rw-r--r--yaksh/models.py1
-rw-r--r--yaksh/templates/yaksh/course_modules.html20
2 files changed, 11 insertions, 10 deletions
diff --git a/yaksh/models.py b/yaksh/models.py
index cce90e7..5036524 100644
--- a/yaksh/models.py
+++ b/yaksh/models.py
@@ -758,6 +758,7 @@ class Course(models.Model):
teachers = models.ManyToManyField(User, related_name='teachers')
is_trial = models.BooleanField(default=False)
instructions = models.TextField(default=None, null=True, blank=True)
+ view_grade = models.BooleanField(default=False)
learning_module = models.ManyToManyField(LearningModule,
related_name='learning_module')
diff --git a/yaksh/templates/yaksh/course_modules.html b/yaksh/templates/yaksh/course_modules.html
index 917f78c..244c2d9 100644
--- a/yaksh/templates/yaksh/course_modules.html
+++ b/yaksh/templates/yaksh/course_modules.html
@@ -2,7 +2,6 @@
{% load custom_filters %}
{% block title %} Course Modules {% endblock %}
{% block script %}
-<script src="{{ URL_ROOT }}/static/yaksh/js/donutpiechart.js"></script>
<script>
function view_unit(unit){
$("#"+unit+"_down").toggle();
@@ -36,16 +35,17 @@
</div>
<center>
-<div class=" col-md-8">
-<b>Grade: {% if grade %} {{ grade }} {% else %} Will be available once the course is complete {% endif %}</b>
-</div>
-
+ {% if course.view_grade %}
+ <div class=" col-md-8">
+ <b>Grade: {% if grade %} {{ grade }} {% else %} Will be available once the course is complete {% endif %}</b>
+ </div>
+ {% endif %}
-{% if msg %}
- <div class="col-md-8 alert alert-warning animated flash" role="alert">
- {{ msg }}
- </div>
-{% endif %}
+ {% if msg %}
+ <div class="col-md-8 alert alert-warning animated flash" role="alert">
+ {{ msg }}
+ </div>
+ {% endif %}
</center>
<div class="row justify-content-md-center ">