diff options
Diffstat (limited to 'yaksh/templates')
-rw-r--r-- | yaksh/templates/exam.html | 4 | ||||
-rw-r--r-- | yaksh/templates/yaksh/question.html | 37 | ||||
-rw-r--r-- | yaksh/templates/yaksh/user_data.html | 4 |
3 files changed, 32 insertions, 13 deletions
diff --git a/yaksh/templates/exam.html b/yaksh/templates/exam.html index b497cc0..02ff70a 100644 --- a/yaksh/templates/exam.html +++ b/yaksh/templates/exam.html @@ -52,7 +52,9 @@ {% endif %} {% endif %} {% if qid in paper.get_questions_answered %} - <li class="disabled"><a style="background-color:#B4B8BA; width:25%" href="#" data-toggle="tooltip" title="{{ qid.description }}" >{{ forloop.counter }}</a></li> + <li><a style="background-color:#B4B8BA; width:25%" href="#" data-toggle="tooltip" + onclick="call_skip('{{ URL_ROOT }}/exam/{{ question.id }}/skip/{{ qid.id }}/{{ paper.attempt_number }}/{{ paper.question_paper.id }}/')" + title="{{ qid.description }}">{{ forloop.counter }}</a></li> {% endif %} {% else %} {% if qid.id == question.id %} diff --git a/yaksh/templates/yaksh/question.html b/yaksh/templates/yaksh/question.html index 1f6e67d..9dd0de5 100644 --- a/yaksh/templates/yaksh/question.html +++ b/yaksh/templates/yaksh/question.html @@ -135,13 +135,25 @@ function call_skip(url) {% block onload %} onload="updateTime();" {% endblock %} {% block main %} - <p id="status"></p> - <form id="code" action="{{URL_ROOT}}/exam/{{ question.id }}/check/{{ paper.attempt_number }}/{{ paper.question_paper.id }}/" method="post" enctype="multipart/form-data"> - {% csrf_token %} - <input type=hidden name="question_id" id="question_id" value={{ question.id }}></input> - <div class="panel panel-default"> - <div class="panel-heading"> - <h4><u> {{ question.summary }} + <p id="status"></p> + {% if notification %} + {% if question.type == "code" %} + <div class="alert alert-success" role="alert"> + <strong>Note:</strong> {{ notification }} + </div> + {% else %} + <div class="alert alert-warning" role="alert"> + <strong>Note:</strong> {{ notification }} + </div> + {% endif %} + {% endif %} + <form id="code" action="{{URL_ROOT}}/exam/{{ question.id }}/check/{{ paper.attempt_number }}/{{ paper.question_paper.id }}/" method="post" enctype="multipart/form-data"> + {% csrf_token %} + <input type=hidden name="question_id" id="question_id" value={{ question.id }}></input> + <div class="panel panel-default"> + <div class="panel-heading"> + <h4> + <u> {{ question.summary }} {% if question.type == "mcq" %} (Single Correct Choice Questions) {% elif question.type == "mcc" %} @@ -151,8 +163,8 @@ function call_skip(url) {% elif question.type == "upload" %} (ASSIGNMENT UPLOAD) {% endif %} - </u> - <font class=pull-right>(Marks : {{ question.points }}) </font> + </u> + <font class=pull-right>(Marks : {{ question.points }}) </font> </h4> <font size=3 face=arial> {{ question.description|safe }} </font> {% if files %} @@ -198,10 +210,15 @@ function call_skip(url) {% elif question.type == "upload" %} <br><button class="btn btn-primary" type="submit" name="check" id="check" onClick="return validate();">Upload</button> {% else %} - <button class="btn btn-primary" type="submit" name="check" id="check" onClick="submitCode();">Check Answer <span class="glyphicon glyphicon-cog"></span></button> + {% if question in paper.get_questions_unanswered %} + <button class="btn btn-primary" type="submit" name="check" id="check" onClick="submitCode();">Check Answer <span class="glyphicon glyphicon-cog"></span></button> + {% endif %} {% endif %} + {% if paper.question_paper.quiz.allow_skip and not paper.get_questions_unanswered|length_is:"1" %} + {% if question in paper.get_questions_unanswered %} <button class="btn btn-primary" onclick="call_skip('{{ URL_ROOT }}/exam/{{ question.id }}/skip/{{ paper.attempt_number }}/{{ paper.question_paper.id }}/')" name="skip" id="skip">Attempt Later <span class="glyphicon glyphicon-arrow-right"></span></button> + {% endif %} </div> </div> </div> diff --git a/yaksh/templates/yaksh/user_data.html b/yaksh/templates/yaksh/user_data.html index 9be28fb..16707b2 100644 --- a/yaksh/templates/yaksh/user_data.html +++ b/yaksh/templates/yaksh/user_data.html @@ -100,7 +100,7 @@ User IP address: {{ paper.user_ip }} {% else %} <h5>Student answer: </h5> {% for answer in answers %} - {% if not answer.skipped %} + {% if answer.answer.correct %} <div class="panel panel-success"> <div class="panel-heading">Correct answer @@ -116,7 +116,7 @@ User IP address: {{ paper.user_ip }} </div> <div class="panel-body"><pre><code>{{ answer.answer.answer.strip }}</code></pre></div> </div> - {% endif %} + {% endfor %} {% endif %} <hr> |