diff options
author | CruiseDevice | 2020-01-06 14:35:29 +0530 |
---|---|---|
committer | CruiseDevice | 2020-01-06 14:35:29 +0530 |
commit | da4460ede9d857844f9ed8d6fe4ed877c34fab4c (patch) | |
tree | 54fcbfe415c287805cfd52e8172433514651c880 | |
parent | 68aab21a767de33e9a798ca847bc788d7429507d (diff) | |
download | online_test-da4460ede9d857844f9ed8d6fe4ed877c34fab4c.tar.gz online_test-da4460ede9d857844f9ed8d6fe4ed877c34fab4c.tar.bz2 online_test-da4460ede9d857844f9ed8d6fe4ed877c34fab4c.zip |
Resolve comments
- Use django URL tag
- Fix Add Testcase dropdown width
-rw-r--r-- | yaksh/templates/yaksh/add_question.html | 145 |
1 files changed, 73 insertions, 72 deletions
diff --git a/yaksh/templates/yaksh/add_question.html b/yaksh/templates/yaksh/add_question.html index 96917da..cd05516 100644 --- a/yaksh/templates/yaksh/add_question.html +++ b/yaksh/templates/yaksh/add_question.html @@ -1,93 +1,94 @@ {% extends "manage.html" %} - +{% load staticfiles %} {% block title %} Add Question {% endblock title %} {% block pagetitle %} Add Question {% endblock pagetitle %} {% block css %} -<link rel="stylesheet" media="all" type="text/css" href="{{ URL_ROOT }}/static/yaksh/css/autotaggit.css" /> +<link rel="stylesheet" type="text/css" href="{% static 'yaksh/css/autotaggit.css' %}"> {% endblock %} {% block script %} -<script src="{{ URL_ROOT }}/static/yaksh/js/add_question.js"></script> -<script src="{{ URL_ROOT }}/static/yaksh/js/mathjax/MathJax.js?config=TeX-MML-AM_CHTML"></script> +<script type="text/javascript" src="{% static 'yaksh/js/add_question.js' %}"></script> +<script type="text/javascript" src="{% static 'yaksh/js/mathjax/MathJax.js?config=TeX-MML-AM_CHTML' %}"></script> {% endblock %} {% block onload %} onload='javascript:textareaformat();' {% endblock %} {% block content %} <div class="yakshwell container"> -<form action="{{ URL_ROOT }}/exam/manage/addquestion/{{ question.id }}/" method="post" name=frm onSubmit="return autosubmit();" enctype="multipart/form-data"> - {% csrf_token %} - <center> - <table class="table table-responsive-sm"> - <tr><td>Summary: <td>{{ qform.summary }}{{ qform.summary.errors }} - <tr><td> Language: <td> {{qform.language}}{{qform.language.errors}} - <tr><td> Type: <td> {{ qform.type }}{{qform.type.errors}} - <tr><td>Points:<td><button class="btn-mini" type="button" onClick="increase(frm);">+</button>{{qform.points }}<button class="btn-mini" type="button" onClick="decrease(frm);">-</button>{{ qform.points.errors }} - <tr><td><strong>Rendered: </strong><td><p id='my'></p> - <tr><td>Description: <td>{{ qform.description}} {{qform.description.errors}} - <tr><td>Tags: <td>{{ qform.tags }} - <tr><td><strong>Rendered Solution: </strong><td><p id='rend_solution'></p> - <tr><td>Solution: <td>{{ qform.solution }} - <tr><td>Snippet: <td>{{ qform.snippet }} - <tr><td>Minimum Time(in minutes):<td> {{ qform.min_time }} - <tr><td>Partial Grading: <td>{{ qform.partial_grading }} - <tr><td>Grade Assignment Upload:<td> {{ qform.grade_assignment_upload }} - <tr><td> File: <td> - <div class="input-group mb-3"> - <div class="custom-file"> - {{ fileform.file_field }}{{ fileform.file_field.errors }} - <label class="custom-file-label" for="id_file"> - Choose file - </label> + <form action="{% url 'yaksh:add_question' question.id %}" method="post" name=frm onSubmit="return autosubmit();" enctype="multipart/form-data"> + {% csrf_token %} + <center> + {{qform.instance.language}} + <table class="table table-responsive-sm"> + <tr><td>Summary: <td>{{ qform.summary }}{{ qform.summary.errors }} + <tr><td> Language: <td> {{qform.language}}{{qform.language.errors}} + <tr><td> Type: <td> {{ qform.type }}{{qform.type.errors}} + <tr><td>Points:<td><button class="btn-mini" type="button" onClick="increase(frm);">+</button>{{qform.points }}<button class="btn-mini" type="button" onClick="decrease(frm);">-</button>{{ qform.points.errors }} + <tr><td><strong>Rendered: </strong><td><p id='my'></p> + <tr><td>Description: <td>{{ qform.description}} {{qform.description.errors}} + <tr><td>Tags: <td>{{ qform.tags }} + <tr><td><strong>Rendered Solution: </strong><td><p id='rend_solution'></p> + <tr><td>Solution: <td>{{ qform.solution }} + <tr><td>Snippet: <td>{{ qform.snippet }} + <tr><td>Minimum Time(in minutes):<td> {{ qform.min_time }} + <tr><td>Partial Grading: <td>{{ qform.partial_grading }} + <tr><td>Grade Assignment Upload:<td> {{ qform.grade_assignment_upload }} + <tr><td> File: <td> + <div class="input-group mb-3"> + <div class="custom-file"> + {{ fileform.file_field }}{{ fileform.file_field.errors }} + <label class="custom-file-label" for="id_file"> + Choose file + </label> + </div> </div> - </div> - {% if uploaded_files %} - <br> - <b>Uploaded files:</b><br> - Check on delete to delete files, - extract to extract files and hide to hide files from student(if required)<br> - {% for file in uploaded_files %} - <input type="checkbox" name="clear" value="{{file.id}}"> delete</input> - <input type="checkbox" name="extract" value="{{file.id}}" >{% if file.extract %} dont extract{% else %}extract{% endif %}</input> - <input type="checkbox" name="hide" value="{{file.id}}" >{% if file.hide %} show{% else %}hide{% endif %}</input> - <a href="{{file.file.url}}">{{ file.file.name }}</a> + {% if uploaded_files %} <br> - {% endfor %} - {% endif %} - </table> - </center> - {% for formset in formsets %} - <div class="form-group"> - {{ formset.management_form }} + <b>Uploaded files:</b><br> + Check on delete to delete files, + extract to extract files and hide to hide files from student(if required)<br> + {% for file in uploaded_files %} + <input type="checkbox" name="clear" value="{{file.id}}"> delete</input> + <input type="checkbox" name="extract" value="{{file.id}}" >{% if file.extract %} dont extract{% else %}extract{% endif %}</input> + <input type="checkbox" name="hide" value="{{file.id}}" >{% if file.hide %} show{% else %}hide{% endif %}</input> + <a href="{{file.file.url}}">{{ file.file.name }}</a> + <br> + {% endfor %} + {% endif %} + </table> + </center> + {% for formset in formsets %} + <div class="form-group"> + {{ formset.management_form }} - {% for form in formset %} - <div class="link-formset well"> - {{ form.as_p }} - </div> - {% endfor %} + {% for form in formset %} + <div class="link-formset well"> + {{ form.as_p }} + </div> + {% endfor %} - </div> - {% endfor %} - <div class="form-group"> - <label for="case_type">Add Test Case:</label> - <select id="case_type" class="form-control" name="case_type" onchange="frm.submit()"> - <option value="" selected="selected">---------</option> - <option value="standardtestcase">Standard </option> - <option value="stdiobasedtestcase">StdIO </option> - <option value="mcqtestcase">MCQ/MCC </option> - <option value="hooktestcase">Hook </option> - <option value="integertestcase">Integer </option> - <option value="stringtestcase"> String </option> - <option value="floattestcase"> Float </option> - <option value="arrangetestcase">Arrange options </option> - </select> </div> - <center> - <button class="btn btn-lg btn-success" type="submit" name="save_question">Save</button> - <button class="btn btn-lg btn-info" type="button" name="button" onClick='location.replace("{% url 'yaksh:show_questions' %}");'>Back to Questions</button> - <button class="btn btn-lg btn-danger" type="submit" name="delete_files">Delete Selected Files</button> - </center> -</form> + {% endfor %} + <div class="form-group"> + <label for="case_type">Add Test Case:</label> + <select id="case_type" class="form-control w-auto" name="case_type" onchange="frm.submit()"> + <option value="" selected="selected">---------</option> + <option value="standardtestcase">Standard </option> + <option value="stdiobasedtestcase">StdIO </option> + <option value="mcqtestcase">MCQ/MCC </option> + <option value="hooktestcase">Hook </option> + <option value="integertestcase">Integer </option> + <option value="stringtestcase"> String </option> + <option value="floattestcase"> Float </option> + <option value="arrangetestcase">Arrange options </option> + </select> + </div> + <center> + <button class="btn btn-lg btn-success" type="submit" name="save_question">Save</button> + <a class="btn btn-lg btn-info" href="{% url 'yaksh:show_questions' %}">Back to Questions</a> + <button class="btn btn-lg btn-danger" type="submit" name="delete_files">Delete Selected Files</button> + </center> + </form> </div> {% endblock %} |