{% extends "base.html" %} <!DOCTYPE html> {% block title %} Answer question {% endblock %} {% block css %} <link rel="stylesheet" href="{{ URL_ROOT }}/static/exam/css/question.css" type="text/css" /> {% endblock %} {% block script %} <script src="{{ URL_ROOT }}/static/exam/js/question.js"></script> {% endblock script %} {% block onload %} onload="update_time()" {% endblock onload %} {% block pagetitle %} <table><h6><div> <tr><td class=td1-class><h5>You have {{ paper.questions_left }} question(s) left in {{ quiz_name }} </h5> <td class=td2-class><div class=time-div id="time_left"> </div> </div></h6></table> {% endblock %} {% block content %} <div class="topbar"> <div class="fill"> <div class="container"> <h3 class="brand"><strong>Online Test</h3></strong> <ul> <li> <h5><a> Hi {{user.first_name.title}} {{user.last_name.title}} </a></h5> </ul> <form id="logout" action="{{URL_ROOT}}/exam/quit/" method="post" class="pull-right"> {% csrf_token %} <button class="btn" type="submit" name="quit">Quit Exam and Logout</button> </li> </form> </div> </div> </div> <h4><u> {{ question.summary }} </u><font class=pull-right>(Marks : {{ question.points }}) </font></h4><br> <font size=3 face=arial> {{ question.description|safe }} </font> {% if error_message %}<h5>ERROR:</h5><div class="alert alert-error">{{ error_message }}</div>{% endif %} <p id="status"></p> <form id="code" action="{{URL_ROOT}}/exam/{{ question.id }}/check/" method="post"> {% csrf_token %} {% if question.type == "mcq" %} {% for option in question.options.strip.splitlines %} <input name="answer" type="radio" value="{{option}}" />{{option}} <br/> {% endfor %} {% else %} <textarea rows="15" style="width:810px;margin-bottom:10px;" name="answer">{% if last_attempt %}{{last_attempt.strip}}{% else %}{% if question.type == "bash" %} #!/bin/bash{% else %}# Enter your answer here.{% endif %}{% endif %}</textarea> {% endif %} {% if question.type == "mcq" %} <br><button class="btn" type="submit" name="check" id="check">Submit Answer</button> {% else %} <button class="btn" type="submit" name="check" id="check" onClick="submitCode();">Check Answer</button> {% endif %} <button class="btn" type="submit" name="skip" id="skip">Skip Question</button> </form> {% endblock content %}