summaryrefslogtreecommitdiff
path: root/yaksh/templates
diff options
context:
space:
mode:
Diffstat (limited to 'yaksh/templates')
-rw-r--r--yaksh/templates/yaksh/add_lesson.html28
-rw-r--r--yaksh/templates/yaksh/add_module.html51
-rw-r--r--yaksh/templates/yaksh/add_quiz.html12
-rw-r--r--yaksh/templates/yaksh/design_questionpaper.html72
-rw-r--r--yaksh/templates/yaksh/micromanaged.html22
-rw-r--r--yaksh/templates/yaksh/micromonitor.html9
-rw-r--r--yaksh/templates/yaksh/monitor.html31
-rw-r--r--yaksh/templates/yaksh/question.html10
-rw-r--r--yaksh/templates/yaksh/quit.html4
-rw-r--r--yaksh/templates/yaksh/quizzes_user.html2
-rw-r--r--yaksh/templates/yaksh/show_video.html6
-rw-r--r--yaksh/templates/yaksh/statistics_question.html117
12 files changed, 278 insertions, 86 deletions
diff --git a/yaksh/templates/yaksh/add_lesson.html b/yaksh/templates/yaksh/add_lesson.html
index b984db0..4211b1b 100644
--- a/yaksh/templates/yaksh/add_lesson.html
+++ b/yaksh/templates/yaksh/add_lesson.html
@@ -9,6 +9,8 @@
</script>
<script type="text/javascript" src="{% static 'yaksh/js/jquery-ui.js' %}">
</script>
+<script type="text/javascript" src="{% static 'yaksh/js/mathjax/MathJax.js' %}?config=TeX-MML-AM_CHTML">
+</script>
{% endblock %}
{% block css %}
@@ -17,15 +19,15 @@
{% endblock %}
{% block content %}
-<div class="container">
+<div class="container-fluid">
{% if error %}
<div class="alert alert-danger">
{{error}}
</div>
{% endif %}
-<div class="container">
+<div class="container-fluid">
<div class="row justify-content-center form-group">
- <div class="col-md-9 col-md-offset-4">
+ <div class="col-md-5 col-md-offset-4">
<a class="btn btn-primary" href="{% url 'yaksh:get_course_modules' course_id %}">
<i class="fa fa-arrow-left"></i>&nbsp;Back
</a>
@@ -137,18 +139,20 @@
</center>
</form>
<hr>
- <div class="card" id="preview_text_div" style="display: none;">
- <div class="card-heading">
- <center>
- <h3>Description Preview</h3>
- </center>
- </div>
- <div class="card-body" id="description_body">
- </div>
- </div>
</fieldset>
</form>
</div>
+ <div class="col-md-6">
+ <div class="card" id="preview_text_div">
+ <div class="card-header">
+ <center>
+ <h3>Description Preview</h3>
+ </center>
+ </div>
+ <div class="card-body" id="description_body">
+ </div>
+ </div>
+ </div>
</div>
</div>
{% endblock %} \ No newline at end of file
diff --git a/yaksh/templates/yaksh/add_module.html b/yaksh/templates/yaksh/add_module.html
index 262c009..7112485 100644
--- a/yaksh/templates/yaksh/add_module.html
+++ b/yaksh/templates/yaksh/add_module.html
@@ -11,6 +11,8 @@
</script>
<script type="text/javascript" src="{% static 'yaksh/js/jquery-ui.js' %}">
</script>
+<script type="text/javascript" src="{% static 'yaksh/js/mathjax/MathJax.js' %}?config=TeX-MML-AM_CHTML">
+</script>
{% endblock %}
{% block css %}
@@ -19,17 +21,7 @@
{% endblock %}
{% block content %}
-<div class="container">
-{% if messages %}
- {% for message in messages %}
- <div class="alert alert-dismissible alert-{{ message.tags }}">
- <button type="button" class="close" data-dismiss="alert">
- <i class="fa fa-close"></i>
- </button>
- <strong>{{ message }}</strong>
- </div>
- {% endfor %}
-{% endif %}
+<div class="container-fluid">
{% if course_id %}
<a class="btn btn-primary" href="{% url 'yaksh:get_course_modules' course_id %}">
<i class="fa fa-arrow-left"></i>
@@ -43,10 +35,23 @@
{% endif %}
</div>
<br>
-{% if status == "add" %}
<div class="container">
+{% if messages %}
+ {% for message in messages %}
+ <div class="alert alert-dismissible alert-{{ message.tags }}">
+ <button type="button" class="close" data-dismiss="alert">
+ <i class="fa fa-close"></i>
+ </button>
+ <strong>{{ message }}</strong>
+ </div>
+ {% endfor %}
+{% endif %}
+</div>
+<br>
+{% if status == "add" %}
+<div class="container-fluid">
<div class="row justify-content-center form-group">
- <div class="col-md-9 col-md-offset-4">
+ <div class="col-md-5 col-md-offset-4">
<form name=frm id=frm action="" method="post">
<fieldset>
{% csrf_token %}
@@ -92,18 +97,20 @@
</center>
</form>
<hr>
- <div class="card" id="preview_text_div" style="display: none;">
- <div class="card-heading">
- <center>
- <h3>Description Preview</h3>
- </center>
- </div>
- <div class="card-body" id="description_body">
- </div>
- </div>
</fieldset>
</form>
</div>
+ <div class="col-md-5">
+ <div class="card" id="preview_text_div">
+ <div class="card-header">
+ <center>
+ <h3>Description Preview</h3>
+ </center>
+ </div>
+ <div class="card-body" id="description_body">
+ </div>
+ </div>
+ </div>
</div>
</div>
{% endif %}
diff --git a/yaksh/templates/yaksh/add_quiz.html b/yaksh/templates/yaksh/add_quiz.html
index 55e3bd6..9b80e0d 100644
--- a/yaksh/templates/yaksh/add_quiz.html
+++ b/yaksh/templates/yaksh/add_quiz.html
@@ -55,7 +55,7 @@
{% if quiz and course_id %}
{% if quiz.questionpaper_set.get.id %}
<center>
- <a href="{% url 'yaksh:designquestionpaper' quiz.id quiz.questionpaper_set.get.id course_id %}" class="btn btn-primary">
+ <a href="{% url 'yaksh:designquestionpaper' course_id quiz.id quiz.questionpaper_set.get.id %}" class="btn btn-primary">
<i class="fa fa-edit"></i> Edit Question Paper
</a>
<a href="{% url 'yaksh:preview_questionpaper' quiz.questionpaper_set.get.id %}" class="btn btn-info" target="_blank">
@@ -65,11 +65,11 @@
<br>
<h4>You can check the quiz by attempting it in the following modes:</h4>
<a class="btn btn-outline-info" name="button" href="{% url 'yaksh:test_quiz' 'usermode' quiz.id course_id %}" target="blank">
- User Mode
+ Try as student
</a>
- <a class="btn btn-outline-info" name="button" href="{% url 'yaksh:test_quiz' 'godmode' quiz.id course_id %}" target="blank">
- God Mode
+ <a class="btn btn-outline-primary" name="button" href="{% url 'yaksh:test_quiz' 'godmode' quiz.id course_id %}" target="blank">
+ Try as teacher
</a>
<a data-toggle="modal" data-target="#help">
<span class="text-info"><i class="fa fa-info-circle"></i> Help</span></a>
@@ -88,13 +88,13 @@
</div>
<div class="modal-body">
<p>
- <b>User Mode:</b> Attempt quiz the way normal users will attempt i.e. -
+ <b>Try as student:</b> Attempt quiz the way students will attempt i.e. -
<ul class="list-group list-group-flush">
<li class="list-group-item">Quiz will have the same duration as that of the original quiz.</li>
<li class="list-group-item">Quiz won't start if the course is inactive or the quiz time has expired.</li>
<li class="list-group-item">You will be notified about quiz prerequisites.(You can still attempt the quiz though)</li>
</ul>
- <b>God Mode:</b> Attempt quiz without any time or eligibilty constraints.
+ <b>Try as teacher:</b> Attempt quiz without any time or eligibilty constraints.
</p>
</div>
</div>
diff --git a/yaksh/templates/yaksh/design_questionpaper.html b/yaksh/templates/yaksh/design_questionpaper.html
index ffbdf5f..fcc3ed5 100644
--- a/yaksh/templates/yaksh/design_questionpaper.html
+++ b/yaksh/templates/yaksh/design_questionpaper.html
@@ -114,12 +114,47 @@
<div id="fixed-available-wrapper">
<p><u>Select questions to add:</u></p>
<div id="fixed-available">
- {% if state == "fixed" or state == "None" %}
+ {% if questions %}
+ {% if state == "fixed" or state == "None" %}
+ <ul class="inputs-list">
+ <h5><input id="add_checkall" name="add_checkall" type="checkbox"> Select All </h5>
+ {% for question in questions %}
+ <li>
+ <label>
+ <input type="checkbox" name="questions" data-qid="{{question.id}}" value={{question.id}}>
+ <span>
+ {% if user == question.user %}
+ <a href="{% url 'yaksh:add_question' question.id %}" target="_blank">{{ question.summary }}</a>
+ {% else %}
+ {{question.summary}}
+ {% endif %}
+ </span>
+ <span> {{ question.points }}</span>
+ </label>
+ </li>
+ {% endfor %}
+ </ul>
+ {% endif %}
+ {% endif %}
+ </div>
+ </div>
+ <br />
+ <button id="add-fixed" name="add-fixed" class="btn btn-success pull-right" type="submit">
+ <i class="fa fa-plus-square"></i>&nbsp;Add to paper
+ </button>
+ </div>
+ <div class="col-md-6">
+ <div id="fixed-added-wrapper">
+ <p><u>Fixed questions currently in paper:</u></p>
+ <div id="fixed-added">
+ {% if fixed_questions %}
<ul class="inputs-list">
- {% for question in questions %}
+ <h5><input id="remove_checkall" type="checkbox"> Select All </h5>
+ {% for question in fixed_questions %}
<li>
<label>
- <input type="checkbox" name="questions" data-qid="{{question.id}}" value={{question.id}}>
+ <input type="checkbox" name="added-questions"
+ data-qid="{{question.id}}" value={{question.id}}>
<span>
{% if user == question.user %}
<a href="{% url 'yaksh:add_question' question.id %}" target="_blank">{{ question.summary }}</a>
@@ -127,7 +162,7 @@
{{question.summary}}
{% endif %}
</span>
- <span> {{ question.points }}</span>
+ <span> {{ question.points }} </span>
</label>
</li>
{% endfor %}
@@ -136,35 +171,6 @@
</div>
</div>
<br />
- <button id="add-fixed" name="add-fixed" class="btn btn-success pull-right" type="submit">
- <i class="fa fa-plus-square"></i>&nbsp;Add to paper
- </button>
- </div>
- <div class="col-md-6">
- <div id="fixed-added-wrapper">
- <p><u>Fixed questions currently in paper:</u></p>
- <div id="fixed-added">
- <ul class="inputs-list">
- {% for question in fixed_questions %}
- <li>
- <label>
- <input type="checkbox" name="added-questions"
- data-qid="{{question.id}}" value={{question.id}}>
- <span>
- {% if user == question.user %}
- <a href="{% url 'yaksh:add_question' question.id %}" target="_blank">{{ question.summary }}</a>
- {% else %}
- {{question.summary}}
- {% endif %}
- </span>
- <span> {{ question.points }} </span>
- </label>
- </li>
- {% endfor %}
- </ul>
- </div>
- </div>
- <br />
<button id="remove-fixed" name="remove-fixed" class="btn btn-danger pull-right" type="submit">
<i class="fa fa-minus-square"></i>&nbsp;Remove from paper
</button>
diff --git a/yaksh/templates/yaksh/micromanaged.html b/yaksh/templates/yaksh/micromanaged.html
new file mode 100644
index 0000000..336feec
--- /dev/null
+++ b/yaksh/templates/yaksh/micromanaged.html
@@ -0,0 +1,22 @@
+{% if micromanagers %}
+<hr>
+<div class="row">
+ {% for micromanager in micromanagers %}
+ {% if micromanager.attempts_permitted > 0 %}
+ <div class="col-md-8">
+ <p> You have been given a special attempt to the {{ micromanager.quiz.description }} by the course creator</p>
+ </div>
+ <div class="col-md-3">
+ {% if micromanager.can_student_attempt %}
+ <a class="btn btn-success" href="{% url 'yaksh:special_start' micromanager.id %}">
+ Start Special Attempt
+ </a>
+ {% else %}
+ <span class="badge badge-secondary">Exhausted</span>
+ {% endif %}
+ </div>
+ {% endif %}
+ {% endfor %}
+{% endif %}
+</div>
+
diff --git a/yaksh/templates/yaksh/micromonitor.html b/yaksh/templates/yaksh/micromonitor.html
new file mode 100644
index 0000000..cc059aa
--- /dev/null
+++ b/yaksh/templates/yaksh/micromonitor.html
@@ -0,0 +1,9 @@
+{% if micromanager %}
+ {% if micromanager.can_student_attempt %}
+ <a class="btn btn-danger" href="{% url 'yaksh:revoke_special_attempt' micromanager.id %}">Revoke</a>
+ {% else %}
+ <a class="btn btn-success" href="{% url 'yaksh:allow_special_attempt' user_id course_id quiz_id %}">Allow </a>
+ {% endif %}
+{% else %}
+ <a class="btn btn-success" href="{% url 'yaksh:allow_special_attempt' user_id course_id quiz_id %}">Allow </a>
+{% endif %}
diff --git a/yaksh/templates/yaksh/monitor.html b/yaksh/templates/yaksh/monitor.html
index ef7b033..183ba99 100644
--- a/yaksh/templates/yaksh/monitor.html
+++ b/yaksh/templates/yaksh/monitor.html
@@ -74,6 +74,18 @@ $(document).ready(function()
</div>
</div>
<br>
+ <br>
+ {% if messages %}
+ {% for message in messages %}
+ <div class="alert alert-dismissible alert-{{ message.tags }}">
+ <button type="button" class="close" data-dismiss="alert">
+ <i class="fa fa-close"></i>
+ </button>
+ <strong>{{ message }}</strong>
+ </div>
+ {% endfor %}
+ {% endif %}
+ <br>
<div class="row">
<div class="col-md-4">
<a href="{% url 'yaksh:show_statistics' papers.0.question_paper.id course.id %}" class="btn btn-primary">
@@ -102,8 +114,9 @@ $(document).ready(function()
<th> Institute&nbsp;<i class="fa fa-sort"></i> </th>
<th> Marks&nbsp;<i class="fa fa-sort"></i> </th>
<th> Attempts&nbsp;<i class="fa fa-sort"></i> </th>
- <th> Time&nbsp;<i class="fa fa-sort"></i> </th>
+ <th> Time Left&nbsp;<i class="fa fa-sort"></i> </th>
<th> Status&nbsp;<i class="fa fa-sort"></i> </th>
+ <th> Special Attempt&nbsp;<i class="fa fa-sort"></i> </th>
</tr>
</thead>
<tbody>
@@ -118,7 +131,20 @@ $(document).ready(function()
<td> {{ paper.marks_obtained }} </td>
<td> {{ paper.answers.count }} </td>
<td id="time_left{{forloop.counter0}}"> {{ paper.time_left }} </td>
- <td id="status{{forloop.counter0}}">{{ paper.status }}</td>
+ <td> {% if paper.is_attempt_inprogress %}
+ <form method="post" action="{% url 'yaksh:extend_time' paper.id %}">
+ {% csrf_token %}
+ <div class="form-group">
+ <label for="extra_time"> Time in mins </label>
+ <input type="number" class="form-control" id="extra_time" name="extra_time" required>
+ </div>
+ <button type="submit" class="btn btn-primary">Extend Time</button>
+ </form>
+ {% else %}
+ <span class="badge badge-secondary"> Completed </span>
+ {% endif %}
+ </td>
+ <td>{% specail_attempt_monitor paper.user.id course.id quiz.id %}</td>
</tr>
{% endfor %}
</tbody>
@@ -126,7 +152,6 @@ $(document).ready(function()
<!-- CSV Modal -->
<div class="modal fade" id="csvModal" role="dialog">
<div class="modal-dialog">
-
<!-- Modal content-->
<div class="modal-content">
<div class="modal-header">
diff --git a/yaksh/templates/yaksh/question.html b/yaksh/templates/yaksh/question.html
index ae2f9f4..3f7e67e 100644
--- a/yaksh/templates/yaksh/question.html
+++ b/yaksh/templates/yaksh/question.html
@@ -127,14 +127,14 @@ question_type = "{{ question.type }}";
<button type="button" class="close" data-dismiss="alert">
<i class="fa fa-close"></i>
</button>
- <strong>Note:</strong> {{ notification }}
+ {{ notification }}
</div>
{% else %}
<div id="notification" class="alert alert-info col-md-8" role="alert">
<button type="button" class="close" data-dismiss="alert">
<i class="fa fa-close"></i>
</button>
- <strong>Note:</strong> {{ notification }}
+ {{ notification }}
</div>
{% endif %}
{% else %}
@@ -239,21 +239,21 @@ question_type = "{{ question.type }}";
<!-- Integer type question -->
{% if question.type == "integer" %}
Enter Integer:<br/>
- <input autofocus class="form-control" name="answer" type="number" id="integer" value="{{ last_attempt|safe }}" />
+ <input autofocus class="form-control" name="answer" type="number" id="integer" value="{{ last_attempt|to_integer }}" />
<br><br>
{% endif %}
<!-- String type question -->
{% if question.type == "string" %}
Enter Text:<br/>
- <textarea autofocus name="answer" id="string" class="form-control" style="width: 100%">{{ last_attempt|safe }}</textarea>
+ <textarea autofocus name="answer" id="string" class="form-control" style="width: 100%">{{ last_attempt|to_str }}</textarea>
<br/><br/>
{% endif %}
<!-- Float type question -->
{% if question.type == "float" %}
Enter Decimal Value :<br/>
- <input autofocus class="form-control" name="answer" type="number" step="any" id="float" value="{{ last_attempt|safe }}" />
+ <input autofocus class="form-control" name="answer" type="number" step="any" id="float" value="{{ last_attempt|to_float }}" />
<br/><br/>
{% endif %}
diff --git a/yaksh/templates/yaksh/quit.html b/yaksh/templates/yaksh/quit.html
index ccb0893..a801ea8 100644
--- a/yaksh/templates/yaksh/quit.html
+++ b/yaksh/templates/yaksh/quit.html
@@ -56,7 +56,11 @@
{% csrf_token %}
<center>
<button class="btn btn-outline-success btn-lg" type="submit" name="yes">Yes</button>
+ {% if paper.is_special %}
+ <a class="btn btn-outline-danger btn-lg" name="no" href="{% url 'yaksh:skip_question' paper.questions.first.id paper.attempt_number module_id paper.question_paper.id course_id %}">No</a>
+ {% else %}
<a class="btn btn-outline-danger btn-lg" name="no" href="{% url 'yaksh:start_quiz' paper.attempt_number module_id paper.question_paper.id course_id %}">No</a>
+ {% endif %}
</center>
</form>
{% endblock content %}
diff --git a/yaksh/templates/yaksh/quizzes_user.html b/yaksh/templates/yaksh/quizzes_user.html
index a9f5a43..e28cb69 100644
--- a/yaksh/templates/yaksh/quizzes_user.html
+++ b/yaksh/templates/yaksh/quizzes_user.html
@@ -1,4 +1,5 @@
{% extends "user.html" %}
+{% load custom_filters %}
{% block title %} Student Dashboard {% endblock %}
{% block script %}
@@ -104,6 +105,7 @@
{% endif %}
</div>
</div>
+ {% show_special_attempt user.id course.data.id %}
</div>
<div id="collapse{{course.data.id}}" class="collapse hide" data-parent="#accordion">
<div class="card-body">
diff --git a/yaksh/templates/yaksh/show_video.html b/yaksh/templates/yaksh/show_video.html
index a2edbe0..9c8d133 100644
--- a/yaksh/templates/yaksh/show_video.html
+++ b/yaksh/templates/yaksh/show_video.html
@@ -1,8 +1,12 @@
{% extends "user.html" %}
+{% load static %}
{% load custom_filters %}
{% block title %} {{ learning_module.name }} {% endblock %}
-
+{% block script %}
+<script type="text/javascript" src="{% static 'yaksh/js/mathjax/MathJax.js' %}?config=TeX-MML-AM_CHTML">
+</script>
+{% endblock %}
{% block main %}
<div class="wrapper">
<!-- Sidebar -->
diff --git a/yaksh/templates/yaksh/statistics_question.html b/yaksh/templates/yaksh/statistics_question.html
index 58fd8db..52c29d3 100644
--- a/yaksh/templates/yaksh/statistics_question.html
+++ b/yaksh/templates/yaksh/statistics_question.html
@@ -1,9 +1,10 @@
{% extends "manage.html" %}
+{% block title %} Question Statistics {% endblock %}
{% block pagetitle %} Statistics for {{ quiz.description }}{% endblock pagetitle %}
{% block content %}
-<div class="container">
+<div class="container-fluid">
<div class="row">
<div class="col-md-2">
<ul class="list-group">
@@ -18,13 +19,121 @@
<div class="col-md-9">
{% if question_stats %}
<p><b>Total number of participants: {{ total }}</b></p>
- <table class="table table-bordered table-responsive-sm">
- <tr class="bg-light yakshred"><th>Question</th><th>Type</th><th>Total</th><th>Answered</th></tr>
+ <table class="table table-responsive-sm">
+ <tr class="bg-light yakshred"><th>Question</th><th></th><th>Type</th><th>Total</th><th>Answered Correctly</th></tr>
{% for question, value in question_stats.items %}
- <tr><td>{{ question.summary }}</td><td>{{ question.type }}</td><td>{{value.1}}</td><td>{{ value.0 }} ({% widthratio value.0 value.1 100 %}%)</td></tr>
+ <tr>
+ <td width="45%">{{ question.summary }}
+ <div class="collapse" id="collapse_question_{{question.id}}">
+ <br>
+ <div class="card card-body">
+ <strong>
+ Summary:
+ </strong>
+ <p>
+ {{ question.summary }}
+ </p>
+ <strong>
+ Description:
+ </strong>
+ <p>
+ {{ question.description|safe }}
+ </p>
+ <strong>
+ Points:
+ </strong>
+ <p>
+ {{ question.points }}
+ </p>
+ <strong>
+ Type:
+ </strong>
+ <p>
+ {{ question.get_type_display }}
+ </p>
+ {% if question.type in 'mcq mcc' %}
+ <strong>
+ Test Cases:
+ </strong>
+ <p>
+ <ol>
+ {% for tc in question.testcase_set.all %}
+ <li>
+ {{ tc.mcqtestcase.options }}
+ {% if tc.mcqtestcase.correct %}
+ <span class="badge badge-primary">Correct</span>
+ {% endif %}
+ </li>
+ {% endfor %}
+ </ol>
+ </p>
+ {% endif %}
+ </div>
+ </div>
+ </td>
+ <td>
+ <button class="btn btn-outline-primary" type="button" data-toggle="collapse" data-target="#collapse_question_{{question.id}}" aria-expanded="false" aria-controls="collapseExample">
+ <i class="fa fa-angle-down"></i>&nbsp;More
+ </button>
+ </td>
+ <td>{{ question.type }}</td>
+ <td>{{value.1}}</td><td>{{ value.0 }} ({% widthratio value.0 value.1 100 %}%)</td>
+
+
+ </tr>
{% endfor %}
</table>
{% endif %}
+
+ <!-- The Modal -->
+ <div class="modal" id="question_detail_modal">
+ <div class="modal-dialog">
+ <div class="modal-content">
+
+ <!-- Modal Header -->
+ <div class="modal-header">
+ <h4 class="modal-title">Question Details</h4>
+ <button type="button" class="close" data-dismiss="modal">&times;</button>
+ </div>
+
+ <!-- Modal body -->
+ <div class="modal-body">
+ <table>
+ <tr>
+ <td>Summary</td>
+ <td>{{ question.summary }}</td>
+ </tr>
+ <tr>
+ <td>Description</td>
+ <td>{{ question.description }}</td>
+ </tr> <tr>
+ <td>Type</td>
+ <td>{{ question.type }}</td>
+ </tr> <tr>
+ <td>Points</td>
+ <td>{{ question.points }}</td>
+ </tr>
+ <tr>
+ {% for tc in question.testcase_set.all %}
+ tc
+ {% endfor %}
+ <br><br>
+ </tr>
+ </table>
+ </div>
+
+ <!-- Modal footer -->
+ <div class="modal-footer">
+ <button type="button" class="btn btn-danger" data-dismiss="modal">Close</button>
+ </div>
+
+ </div>
+ </div>
+ </div>
+
+ </div>
+ </div>
+ <!-- end Modal outer -->
</div>
</div>
</div>