summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--yaksh/forms.py4
-rw-r--r--yaksh/models.py6
-rw-r--r--yaksh/templates/yaksh/quizzes_user.html17
3 files changed, 23 insertions, 4 deletions
diff --git a/yaksh/forms.py b/yaksh/forms.py
index 8a90dee..6ec031c 100644
--- a/yaksh/forms.py
+++ b/yaksh/forms.py
@@ -266,9 +266,11 @@ class QuestionFilterForm(forms.Form):
class CourseForm(forms.ModelForm):
+ """ course form for moderators """
+
class Meta:
model = Course
- fields = ['name', 'active', 'enrollment']
+ fields = ['name', 'active', 'enrollment', 'instructions']
class ProfileForm(forms.ModelForm):
diff --git a/yaksh/models.py b/yaksh/models.py
index a86250b..7e0ce16 100644
--- a/yaksh/models.py
+++ b/yaksh/models.py
@@ -109,6 +109,7 @@ class Course(models.Model):
created_on = models.DateTimeField(auto_now_add=True)
teachers = models.ManyToManyField(User, related_name='teachers')
is_trial = models.BooleanField(default=False)
+ instructions = models.TextField(default=None, null=True, blank=True)
objects = CourseManager()
def request(self, *users):
@@ -195,9 +196,8 @@ class Course(models.Model):
###############################################################################
class ConcurrentUser(models.Model):
- concurrent_user = models.OneToOneField(User, null=False)
- session_key = models.CharField(null=False, max_length=40)
-
+ concurrent_user = models.OneToOneField(User)
+ session_key = models.CharField(max_length=40)
###############################################################################
class Profile(models.Model):
diff --git a/yaksh/templates/yaksh/quizzes_user.html b/yaksh/templates/yaksh/quizzes_user.html
index 524d76f..63f22a1 100644
--- a/yaksh/templates/yaksh/quizzes_user.html
+++ b/yaksh/templates/yaksh/quizzes_user.html
@@ -60,6 +60,23 @@
</table>
{% endif %}
</div>
+
+ {% if course.instructions %}
+ <div class="row">
+ <div class="panel-group">
+ <div class="panel panel-default">
+ <div class="panel-heading">
+ <h4 class="panel-title">
+ <a data-toggle="collapse" href="#collapse{{ forloop.counter }}">Course Instructions</a>
+ </h4>
+ </div>
+ <div id="collapse{{ forloop.counter }}" class="panel-collapse collapse">
+ <div class="panel-body"> {{ course.instructions|safe }}</div>
+ </div>
+ </div>
+ </div>
+ </div>
+ {% endif %}
</div>
</div><!--/row-->
</br>