summaryrefslogtreecommitdiff
path: root/yaksh/templates
diff options
context:
space:
mode:
Diffstat (limited to 'yaksh/templates')
-rw-r--r--yaksh/templates/base.html2
-rw-r--r--yaksh/templates/exam.html96
-rw-r--r--yaksh/templates/yaksh/complete.html2
-rw-r--r--yaksh/templates/yaksh/error_template.html91
-rw-r--r--yaksh/templates/yaksh/question.html28
-rw-r--r--yaksh/templates/yaksh/quit.html2
-rw-r--r--yaksh/templates/yaksh/quizzes_user.html4
-rw-r--r--yaksh/templates/yaksh/show_video.html7
8 files changed, 118 insertions, 114 deletions
diff --git a/yaksh/templates/base.html b/yaksh/templates/base.html
index 007d9b8..e7c4a99 100644
--- a/yaksh/templates/base.html
+++ b/yaksh/templates/base.html
@@ -52,6 +52,7 @@
{% block content %}
{% endblock %}
</div>
+ </div>
<footer class="footer" id="footer_div">
<div class="logged_user_info" align="center">
{% block info %}
@@ -61,7 +62,6 @@
<p align="center">Developed by FOSSEE group, IIT Bombay</p>
</div>
</footer>
- </div>
</body>
</html>
diff --git a/yaksh/templates/exam.html b/yaksh/templates/exam.html
index ce3bf44..d0812a4 100644
--- a/yaksh/templates/exam.html
+++ b/yaksh/templates/exam.html
@@ -33,15 +33,6 @@
</nav><!-- /.navbar -->
{% endblock %}
{% block content %}
- <script>
- $(document).ready(function() {
- var ele = document.getElementById('error_panel')
- if (ele) {
- ele.scrollIntoView(true);
- window.scrollBy(0, -15);
- }
- });
- </script>
<div class="container-fluid">
<div class="col-sm-3 col-md-2 sidebar">
<p> Question Navigator </p>
@@ -78,96 +69,11 @@
{% endblock %}
</div>
<div class="col-sm-9 col-sm-offset-3 col-md-10 col-md-offset-2 main">
- <div class="row">
<div class="row">
{% block main %}
{% endblock %}
</div>
- <br/>
- {% if question.type == 'code' or question.type == 'upload' %}
- {% if error_message %}
- <div class="row" id="error_panel">
- {% for error in error_message %}
- <div class="panel panel-danger">
- <div class="panel-heading">Error No. {{ forloop.counter }}</div>
- <div class="panel-body">
- <div class="well well-sm">
- {% if not error.type %}
- <pre><code> {{error|safe}} </code></pre>
- {% elif error.type == 'assertion' %}
- {% if error.test_case %}
- <strong> We tried your code with the following test case:</strong><br/></br>
- <pre><code><strong style="color:#d9534f">{{error.test_case}}</strong></code></pre>
- {% endif %}
- <p> <b>The following error took place: </b></p>
- <table class="table table-bordered" width="100%" id='assertion'>
- <col width="30%">
- <tr class = "active">
- <td><b>Exception Name: </b></td>
- <td><span style="color: #d9534f">{{error.exception}}</span></td>
- </tr>
- <tr>
- <td><b>Exception Message: </b></td><td>{{error.message}}</td>
- </tr>
- <tr>
- {% if error.traceback %}
- <td><b>Full Traceback: </b></td>
- <td><pre>{{error.traceback}}</pre></td>
- {% endif %}
- </tr>
- </table>
- {% elif error.type == 'stdio' %}
- {% if error.given_input %}
- <table class="table table-bordered">
- <col width="30%">
- <tr class = "active">
- <td> For given Input value(s):</td>
- <td>{{error.given_input}}</td>
- </tr>
- </table>
- {% endif %}
- <table class="table table-bordered" width="100%" id="stdio">
- <col width="10%">
- <col width="40%">
- <col width="40%">
- <col width="10%">
- <tr class="info">
- <th><center>Line No.</center></th>
- <th><center>Expected Output</center></th>
- <th><center>User output</center></th>
- <th><center>Status</center></th>
- </tr>
- {% for expected,user in error.expected_output|zip:error.user_output %}
- <td> {{forloop.counter}} </td>
- <td>{{expected|default:""}} </td>
- <td>{{user|default:""}}</td>
- {% if forloop.counter0 in error.error_line_numbers or not expected or not user %}
- <td><span class ="glyphicon glyphicon-remove text-warning"/></td>
- {% else %}
- <td><span class ="glyphicon glyphicon-ok text-success"/></td>
- {% endif %}
- </tr>
- {% endfor %}
- </table>
- <table width="100%" class='table table-bordered'>
- <col width="10">
- <tr class = "danger">
- <td><b>Error:</b></td>
- <td>{{error.error_msg}}</td>
- </tr>
- </table>
-
- {% endif %}
</div>
- </div>
- </div>
- {% endfor %}
-
- </div>
- {% endif %}
- {% endif %}
- </div>
</div>
- </div>
-</div>
+
{% endblock %}
diff --git a/yaksh/templates/yaksh/complete.html b/yaksh/templates/yaksh/complete.html
index c99b8f0..6c0d878 100644
--- a/yaksh/templates/yaksh/complete.html
+++ b/yaksh/templates/yaksh/complete.html
@@ -5,7 +5,7 @@
{% csrf_token %}
{% if paper.questions_answered.all or paper.questions_unanswered.all %}
<center><table class="table table-bordered" >
- <caption> <center><h2>Submission Status</h2> </center></caption>
+ <caption> <center><h3>Submission Status</h3> </center></caption>
<thead>
<tr>
<th> Question</th>
diff --git a/yaksh/templates/yaksh/error_template.html b/yaksh/templates/yaksh/error_template.html
new file mode 100644
index 0000000..61657ae
--- /dev/null
+++ b/yaksh/templates/yaksh/error_template.html
@@ -0,0 +1,91 @@
+{% block css%}
+ <link rel="stylesheet" href="{{ URL_ROOT }}/static/yaksh/css/dashboard.css" type="text/css" />
+{% endblock %}
+
+{% load custom_filters %}
+
+{% if error_message %}
+ {% for error in error_message %}
+
+ <div class="panel panel-danger">
+ <div class="panel-heading">Error No. {{ forloop.counter }}</div>
+ <div class="panel-body">
+ <div class="well well-sm">
+ {% if not error.type %}
+ <pre><code> {{error|safe}} </code></pre>
+
+ {% elif error.type == 'assertion' %}
+
+ {% if error.test_case %}
+ <strong> We tried your code with the following test case:</strong>
+ <br/></br>
+ <pre><code><strong style="color:#d9534f">
+ {{error.test_case}}
+ </strong></code></pre>
+ {% endif %}
+ <p> <b>The following error took place: </b></p>
+ <table class="table table-bordered" width="100%" id='assertion'>
+ <col width="30%">
+ <tr class = "active">
+ <td><b>Exception Name: </b></td>
+ <td><span style="color: #d9534f">{{error.exception}}</span></td>
+ </tr>
+ <tr>
+ <td><b>Exception Message: </b></td><td>{{error.message}}</td>
+ </tr>
+ <tr>
+ {% if error.traceback %}
+ <td><b>Full Traceback: </b></td>
+ <td><pre>{{error.traceback}}</pre></td>
+ {% endif %}
+ </tr>
+ </table>
+
+ {% elif error.type == 'stdio' %}
+
+ {% if error.given_input %}
+ <table class="table table-bordered">
+ <col width="30%">
+ <tr class = "active">
+ <td> For given Input value(s):</td>
+ <td>{{error.given_input}}</td>
+ </tr>
+ </table>
+ {% endif %}
+
+ <table class="table table-bordered" width="100%" id="stdio">
+ <col width="10%">
+ <col width="40%">
+ <col width="40%">
+ <col width="10%">
+ <tr class="info">
+ <th><center>Line No.</center></th>
+ <th><center>Expected Output</center></th>
+ <th><center>User output</center></th>
+ <th><center>Status</center></th>
+ </tr>
+ {% for expected,user in error.expected_output|zip:error.user_output %}
+ <td> {{forloop.counter}} </td>
+ <td>{{expected|default:""}} </td>
+ <td>{{user|default:""}}</td>
+ {% if forloop.counter0 in error.error_line_numbers or not expected or not user %}
+ <td><span class ="glyphicon glyphicon-remove text-warning"/></td>
+ {% else %}
+ <td><span class ="glyphicon glyphicon-ok text-success"/></td>
+ {% endif %}
+ </tr>
+ {% endfor %}
+ </table>
+ <table width="100%" class='table table-bordered'>
+ <col width="10">
+ <tr class = "danger">
+ <td><b>Error:</b></td>
+ <td>{{error.error_msg}}</td>
+ </tr>
+ </table>
+ {% endif %}
+ </div>
+ </div>
+ </div>
+ {% endfor %}
+{% endif %} \ No newline at end of file
diff --git a/yaksh/templates/yaksh/question.html b/yaksh/templates/yaksh/question.html
index 12f5da6..674fafc 100644
--- a/yaksh/templates/yaksh/question.html
+++ b/yaksh/templates/yaksh/question.html
@@ -106,15 +106,15 @@ module_id = "{{module.id}}"
{% get_unit_status course module unit user as status %}
{% if unit.quiz.id == paper.question_paper.quiz.id %}
- <span class="glyphicon glyphicon-pencil" data-toggle="tooltip" title="Current Unit"></span>
+ <span class="glyphicon glyphicon-pencil" data-toggle="tooltip" title="Currently on"></span>
{% endif %}
{% if unit.learning_type == "quiz" %}
- <a href="{{ URL_ROOT }}/exam/start/{{unit.quiz.questionpaper_set.get.id}}/{{learning_module.id}}/{{course.id}}">
+ <a href="{{ URL_ROOT }}/exam/start/{{unit.quiz.questionpaper_set.get.id}}/{{module.id}}/{{course.id}}">
{{ unit.quiz.description }}
</a>
{% else %}
- <a href="{{ URL_ROOT }}/exam/show_video/{{unit.lesson.id}}/{{learning_module.id}}/{{course.id}}">
+ <a href="{{ URL_ROOT }}/exam/show_lesson/{{unit.lesson.id}}/{{module.id}}/{{course.id}}">
{{ unit.lesson.name }}
</a>
{% endif %}
@@ -200,19 +200,19 @@ module_id = "{{module.id}}"
{% if question.type == "integer" %}
Enter Integer:<br/>
- <input name="answer" type="number" id="integer" value={{ last_attempt|safe }} />
+ <input autofocus 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">{{ last_attempt|safe }}</textarea>
+ <textarea autofocus 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" value={{ last_attempt|safe }} />
+ <input autofocus name="answer" type="number" step="any" id="float" value={{ last_attempt|safe }} />
<br/><br/>
{% endif %}
@@ -242,7 +242,7 @@ module_id = "{{module.id}}"
<a href="#answer" class="pull-right" onclick="reset_editor()" name="reset" id="reset">Undo Changes&nbsp;<span class="glyphicon glyphicon-refresh"></span></a>
</div>
</div>
- <textarea name="answer" id="answer"></textarea>
+ <textarea autofocus name="answer" id="answer"></textarea>
<br>
{% endif %}
<div class="from-group">
@@ -262,12 +262,16 @@ module_id = "{{module.id}}"
{% if question in paper.get_questions_unanswered %}
<button class="btn btn-primary" onclick="call_skip('{{ URL_ROOT }}/exam/{{ question.id }}/skip/{{ paper.attempt_number }}/{{ module.id }}/{{ paper.question_paper.id }}/{{course.id}}/')" name="skip" id="skip">Attempt Later <span class="glyphicon glyphicon-arrow-right"></span></button>
{% endif %}
- </div>
- </div>
- </div>
-
+ {% endif %}
+ </div>
</form>
- {% endif %}
+ </div>
+ </div>
+ </div>
+ <br/>
+ {% if question.type == 'code' or question.type == 'upload' %}
+ <div class="row" id="error_panel"></div>
+ {% endif %}
<!-- Modal -->
<div class="modal fade " id="upload_alert" >
diff --git a/yaksh/templates/yaksh/quit.html b/yaksh/templates/yaksh/quit.html
index b168724..b38c21e 100644
--- a/yaksh/templates/yaksh/quit.html
+++ b/yaksh/templates/yaksh/quit.html
@@ -3,7 +3,7 @@
{% block pagetitle %} Yaksh Online Test {% endblock %}
{% block content %}
<center><table class="table table-bordered" >
- <caption> Submission Status </caption>
+ <caption> <center><h3>Submission Status</h3> </center> </caption>
<thead>
<tr>
<th> Question</th>
diff --git a/yaksh/templates/yaksh/quizzes_user.html b/yaksh/templates/yaksh/quizzes_user.html
index 3c4b985..26e550d 100644
--- a/yaksh/templates/yaksh/quizzes_user.html
+++ b/yaksh/templates/yaksh/quizzes_user.html
@@ -97,8 +97,8 @@ No Courses to display
</td>
<td>
{% if unit.learning_type == "quiz" %}
- {% if quiz.view_answerpaper %}
- <a href="{{ URL_ROOT }}/exam/view_answerpaper/{{ quiz.questionpaper_set.get.id }}/"><i class="fa fa-eye" aria-hidden="true"></i> Can View </a>
+ {% if unit.quiz.view_answerpaper %}
+ <a href="{{ URL_ROOT }}/exam/view_answerpaper/{{ unit.quiz.questionpaper_set.get.id }}/{{course.id}}"><i class="fa fa-eye" aria-hidden="true"></i> Can View </a>
{% else %}
<a><i class="fa fa-eye-slash" aria-hidden="true"></i> Cannot view now </a>
{% endif %}
diff --git a/yaksh/templates/yaksh/show_video.html b/yaksh/templates/yaksh/show_video.html
index ffb0c68..ff79808 100644
--- a/yaksh/templates/yaksh/show_video.html
+++ b/yaksh/templates/yaksh/show_video.html
@@ -23,7 +23,7 @@
{{ unit.quiz.description }}
</a>
{% else %}
- <a href="{{ URL_ROOT }}/exam/show_video/{{unit.lesson.id}}/{{learning_module.id}}/{{course.id}}">
+ <a href="{{ URL_ROOT }}/exam/show_lesson/{{unit.lesson.id}}/{{learning_module.id}}/{{course.id}}">
{{ unit.lesson.name }}
</a>
{% endif %}
@@ -42,9 +42,11 @@
{% block main %}
{% if msg %}
<center>
-<div class="alert alert-warning">{{msg}}</div>
+<div class="col-md-12 col-md-offset-1 main">
+<div class="alert alert-warning">{{msg}}</div></div>
</center>
{% endif %}
+<div class="col-md-12 col-md-offset-1 main">
{% if state == "module" %}
<div class="panel panel-default">
<div class="panel-body">
@@ -71,4 +73,5 @@
</a>
</div>
{% endif %}
+</div>
{% endblock %} \ No newline at end of file