summaryrefslogtreecommitdiff
path: root/yaksh/templates
diff options
context:
space:
mode:
Diffstat (limited to 'yaksh/templates')
-rw-r--r--yaksh/templates/base.html6
-rw-r--r--yaksh/templates/exam.html10
-rw-r--r--yaksh/templates/user.html5
-rw-r--r--yaksh/templates/yaksh/grade_user.html48
-rw-r--r--yaksh/templates/yaksh/intro.html5
-rw-r--r--yaksh/templates/yaksh/moderator_dashboard.html5
-rw-r--r--yaksh/templates/yaksh/question.html38
-rw-r--r--yaksh/templates/yaksh/user_data.html18
-rw-r--r--yaksh/templates/yaksh/view_answerpaper.html29
9 files changed, 135 insertions, 29 deletions
diff --git a/yaksh/templates/base.html b/yaksh/templates/base.html
index cbe396f..e7cc15c 100644
--- a/yaksh/templates/base.html
+++ b/yaksh/templates/base.html
@@ -52,7 +52,11 @@
{% block content %}
{% endblock %}
</div>
- <footer class="footer">
+ <footer class="footer" id="footer_div">
+ <div class="logged_user_info" align="center">
+ {% block info %}
+ {% endblock %}
+ </div>
<div class="container">
<p align="center">Developed by FOSSEE group, IIT Bombay</p>
</div>
diff --git a/yaksh/templates/exam.html b/yaksh/templates/exam.html
index 45b85f0..9596c1c 100644
--- a/yaksh/templates/exam.html
+++ b/yaksh/templates/exam.html
@@ -18,7 +18,13 @@
<form id="logout" action="{{URL_ROOT}}/exam/quit/{{ paper.attempt_number }}/{{ paper.question_paper.id }}/" method="post" class="pull-right">
{% csrf_token %}
<ul class="nav navbar-nav navbar">
- <li style="padding: 10px"><button class="btn btn-danger btn-sm" type="submit" name="quit">Quit Exam <span class="glyphicon glyphicon-off"></span></button></li>
+ <li style="padding: 10px"><button class="btn btn-danger btn-sm" type="submit" name="quit">
+ {% if paper.questions_unanswered.all %}
+ Quit Exam
+ {% else %}
+ Finish Exam
+ {% endif %}
+ <span class="glyphicon glyphicon-off"></span></button></li>
</ul>
</form>
<div class="time-div" id="time_left"></div>
@@ -40,7 +46,7 @@
<div class="col-sm-3 col-md-2 sidebar">
<p> Question Navigator </p>
<ul class="pagination pagination-sm">
- {% for qid in paper.questions.all %}
+ {% for qid in paper.get_all_ordered_questions %}
{%if paper.question_paper.quiz.allow_skip %}
{% if qid in paper.get_questions_unanswered %}
{% if qid.id == question.id %}
diff --git a/yaksh/templates/user.html b/yaksh/templates/user.html
index b068fae..83aea13 100644
--- a/yaksh/templates/user.html
+++ b/yaksh/templates/user.html
@@ -40,3 +40,8 @@
</div>
</div>
{% endblock %}
+{% if user %}
+ {% block info %}
+ <h5>{{user.get_full_name|title}}({{user.profile.roll_number}}) Logged in as {{user.username}}</h5>
+ {% endblock %}
+{% endif %}
diff --git a/yaksh/templates/yaksh/grade_user.html b/yaksh/templates/yaksh/grade_user.html
index 9cdfb1a..37bc788 100644
--- a/yaksh/templates/yaksh/grade_user.html
+++ b/yaksh/templates/yaksh/grade_user.html
@@ -9,6 +9,14 @@
{% block script %}
<script src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"></script>
+<script src="{{ URL_ROOT }}/static/yaksh/js/jquery.tablesorter.min.js"></script>
+<script type="text/javascript">
+$(document).ready(function()
+{
+ $("#marks_table").tablesorter({sortList: [[2,1]]});
+});
+
+</script>
{% endblock script %}
{% if course_details %}
@@ -108,17 +116,25 @@ Status : <b style="color: green;"> Passed </b><br/>
{% if paper.answers.count %}
<h4> Report </h4><br>
-<table class="table table-bordered">
+<table class="tablesorter table table-striped table-bordered" id ='marks_table'>
+ <thead>
+ <tr>
+ <th>Question Id</th>
<th>Questions</th>
<th>Marks Obtained</th>
+ </tr>
+ </thead>
+ <tbody>
{% for question, answers in paper.get_question_answers.items %}
{% with answers|last as answer %}
<tr>
- <td>{{ question.id }}</td>
+ <td>{{question.id}}</td>
+ <td><a href="#question_{{question.id}}">{{ question.summary }}</a></td>
<td>{{ answer.answer.marks }}</td>
</tr>
{% endwith %}
{% endfor %}
+ </tbody>
</table>
@@ -135,7 +151,7 @@ Status : <b style="color: green;"> Passed </b><br/>
{% for question, answers in paper.get_question_answers.items %}
<div class = "well well-sm">
<div class="panel panel-info">
- <div class="panel-heading">
+ <div class="panel-heading" id="question_{{question.id}}">
<strong> Details: {{forloop.counter}}. {{ question.summary }}
<span class="marks pull-right"> Mark(s): {{ question.points }} </span>
</strong>
@@ -220,7 +236,7 @@ Status : <b style="color: green;"> Passed </b><br/>
<col width="40%">
<col width="40%">
<col width="10%">
- <tr class="info">
+ <tr>
<th><center>Line No.</center></th>
<th><center>Expected Output</center></th>
<th><center>User output</center></th>
@@ -240,7 +256,7 @@ Status : <b style="color: green;"> Passed </b><br/>
</table>
<table width="100%" class='table table-bordered'>
<col width="10">
- <tr class = "danger">
+ <tr>
<td><b>Error:</b></td>
<td>{{error.error_msg}}</td>
</tr>
@@ -252,12 +268,28 @@ Status : <b style="color: green;"> Passed </b><br/>
</div>
<div class="panel-body">
- {% if question.type != "code" %}
+ {% if question.type == "code" %}
+ <pre><code>{{ ans.answer.answer.strip|safe }}</code></pre>
+ {% elif question.type == "mcc"%}
<div class="well well-sm">
- {{ ans.answer.answer.strip|safe }}
+ {% for testcases in question.get_test_cases %}
+ {%if testcases.id|stringformat:"i" in ans.answer.answer.strip|safe %}
+ <li>{{ testcases.options.strip|safe }}</li>
+ {% endif %}
+ {% endfor %}
+ </div>
+ {% elif question.type == "mcq"%}
+ <div class="well well-sm">
+ {% for testcases in question.get_test_cases %}
+ {%if testcases.id|stringformat:"i" == ans.answer.answer.strip|safe %}
+ <li>{{ testcases.options.strip|safe }}</li>
+ {% endif %}
+ {% endfor %}
</div>
{% else %}
- <pre><code>{{ ans.answer.answer.strip|safe }}</code></pre>
+ <div class="well well-sm">
+ {{ ans.answer.answer.strip|safe }}
+ </div>
{% endif %}
</div>
</div>
diff --git a/yaksh/templates/yaksh/intro.html b/yaksh/templates/yaksh/intro.html
index 29723fa..3b9ba82 100644
--- a/yaksh/templates/yaksh/intro.html
+++ b/yaksh/templates/yaksh/intro.html
@@ -43,3 +43,8 @@
</div>
</div>
{% endblock content %}
+{% if user %}
+ {% block info %}
+ <h5>{{user.get_full_name|title}}({{user.profile.roll_number}}) Logged in as {{user.username}}</h5>
+ {% endblock %}
+{% endif %} \ No newline at end of file
diff --git a/yaksh/templates/yaksh/moderator_dashboard.html b/yaksh/templates/yaksh/moderator_dashboard.html
index c61675d..25bd580 100644
--- a/yaksh/templates/yaksh/moderator_dashboard.html
+++ b/yaksh/templates/yaksh/moderator_dashboard.html
@@ -79,3 +79,8 @@
</div>
{% endif %}
{% endblock %}
+{% if user %}
+ {% block info %}
+ <h5>{{user.get_full_name|title}}({{user.profile.roll_number}}) Logged in as {{user.username}}</h5>
+ {% endblock %}
+{% endif %}
diff --git a/yaksh/templates/yaksh/question.html b/yaksh/templates/yaksh/question.html
index 3a3066c..1e1f38f 100644
--- a/yaksh/templates/yaksh/question.html
+++ b/yaksh/templates/yaksh/question.html
@@ -53,7 +53,7 @@ function updateClock(){
var ss = ('0' + t.seconds).slice(-2);
if(t.total<0){
-
+
document.forms["code"].submit();
clearInterval(timeinterval);
return null;
@@ -77,10 +77,7 @@ function validate(){
$("#upload_alert").modal("show");
return false;
}
- else
- {
- send_request();
- }
+ return true;
}
function call_skip(url)
@@ -91,6 +88,7 @@ function call_skip(url)
}
init_val = '{{ last_attempt|escape_quotes|safe }}';
lang = "{{ question.language }}"
+
</script>
{% endblock script %}
@@ -155,32 +153,44 @@ lang = "{{ question.language }}"
<div class="panel-body">
{% if question.type == "mcq" %}
{% for test_case in test_cases %}
- <input name="answer" type="radio" value="{{ test_case.options }}" />{{ test_case.options|safe }} <br/>
+ {% if last_attempt and last_attempt|safe == test_case.id|safe %}
+ <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" %}
Enter Integer:<br/>
- <input name="answer" type="number" id="integer" />
+ <input name="answer" type="number" id="integer" value={{ last_attempt|safe }} />
<br/><br/>
{% endif %}
{% if question.type == "string" %}
Enter Text:<br/>
- <textarea name="answer" id="string"></textarea>
+ <textarea name="answer" id="string">{{ last_attempt|safe }}</textarea>
<br/><br/>
{% endif %}
{% if question.type == "float" %}
Enter Decimal Value :<br/>
- <input name="answer" type="number" step="any" id="float" />
+ <input name="answer" type="number" step="any" id="float" value={{ last_attempt|safe }} />
<br/><br/>
{% endif %}
{% if question.type == "mcc" %}
{% for test_case in test_cases %}
- <input name="answer" type="checkbox" value="{{ test_case.options }}"> {{ test_case.options|safe }}
+ {% 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 }}
<br>
+ {% else %}
+ <input name="answer" type="checkbox" value="{{ test_case.id }}">
+ {{ test_case.options}}
+ <br/>
+ {% endif %}
{% endfor %}
{% endif %}
{% if question.type == "upload" %}
@@ -241,6 +251,8 @@ lang = "{{ question.language }}"
</div>
</div>
{% endblock main %}
-
-
-
+{% if user %}
+ {% block info %}
+ <h5>{{user.get_full_name|title}}({{user.profile.roll_number}}) Logged in as {{user.username}}</h5>
+ {% endblock %}
+{% endif %}
diff --git a/yaksh/templates/yaksh/user_data.html b/yaksh/templates/yaksh/user_data.html
index a8adc22..31a023d 100644
--- a/yaksh/templates/yaksh/user_data.html
+++ b/yaksh/templates/yaksh/user_data.html
@@ -104,11 +104,29 @@ User IP address: {{ paper.user_ip }}
</div>
<div class="panel-body">
<h5><u>Student answer:</u></h5>
+ {% if question.type == "mcc"%}
+ <div class="well well-sm">
+ {% for testcases in question.get_test_cases %}
+ {%if testcases.id|stringformat:"i" in answers.0.answer|safe %}
+ <li>{{ testcases.options.strip|safe }}</li>
+ {% endif %}
+ {% endfor %}
+ </div>
+ {% elif question.type == "mcq"%}
+ <div class="well well-sm">
+ {% for testcases in question.get_test_cases %}
+ {%if testcases.id|stringformat:"i" == answers.0.answer|safe %}
+ <li>{{ testcases.options.strip|safe }}</li>
+ {% endif %}
+ {% endfor %}
+ </div>
+ {%else%}
<div class="well well-sm">
{{ answers.0.answer|safe }}
</div>
</div>
</div>
+ {% endif %}
{% else %}
<h5>Student answer: </h5>
{% for answer in answers %}
diff --git a/yaksh/templates/yaksh/view_answerpaper.html b/yaksh/templates/yaksh/view_answerpaper.html
index 9edff5a..850d789 100644
--- a/yaksh/templates/yaksh/view_answerpaper.html
+++ b/yaksh/templates/yaksh/view_answerpaper.html
@@ -82,16 +82,35 @@
Autocheck: {{ answers.0.error_list.0 }}
</div>
<div class="panel-body">
- <h5><u>Student answer:</u></h5>
- <div class="well well-sm">
- {{ answers.0.answer|safe }}
- {% if question.type == "upload" and has_user_assignment %}
+ {% if question.type == "mcc"%}
+ <div class="well well-sm">
+ {% for testcases in question.get_test_cases %}
+ {%if testcases.id|stringformat:"i" in answers.0.answer|safe %}
+ <li>{{ testcases.options.strip|safe }}</li>
+ {% endif %}
+ {% endfor %}
+ </div>
+ {% elif question.type == "mcq"%}
+ <div class="well well-sm">
+ {% for testcases in question.get_test_cases %}
+ {%if testcases.id|stringformat:"i" == answers.0.answer|safe %}
+ <li>{{ testcases.options.strip|safe }}</li>
+ {% endif %}
+ {% endfor %}
+ </div>
+ {% elif question.type == "upload" and has_user_assignment %}
<a href="{{URL_ROOT}}/exam/download/user_assignment/{{question.id}}/{{data.user.id}}/{{paper.question_paper.quiz.id}}">
+ <div class="well well-sm">
<div class="panel">
Assignment File for {{ data.user.get_full_name.title }}
</div></a>
- {% endif %}
</div>
+ {% else %}
+ <h5><u>Student answer:</u></h5>
+ <div class="well well-sm">
+ {{ answers.0.answer|safe }}
+ </div>
+ {% endif %}
</div>
</div>
{% else %}