diff options
author | CruiseDevice | 2020-01-06 22:54:48 +0530 |
---|---|---|
committer | CruiseDevice | 2020-01-06 22:54:48 +0530 |
commit | 3995f0a05fe3e681a21116c158708598db0ada08 (patch) | |
tree | e0f56a299b4c351c7c417873dcb2b3be42078e1f /yaksh/templates | |
parent | da4460ede9d857844f9ed8d6fe4ed877c34fab4c (diff) | |
download | online_test-3995f0a05fe3e681a21116c158708598db0ada08.tar.gz online_test-3995f0a05fe3e681a21116c158708598db0ada08.tar.bz2 online_test-3995f0a05fe3e681a21116c158708598db0ada08.zip |
Fix issue in add_question.html template
- Test case select dropdown now shows only testcase
type based on the question type.
- Fix blank question created issue in add_question template.
Diffstat (limited to 'yaksh/templates')
-rw-r--r-- | yaksh/templates/yaksh/add_question.html | 59 |
1 files changed, 43 insertions, 16 deletions
diff --git a/yaksh/templates/yaksh/add_question.html b/yaksh/templates/yaksh/add_question.html index cd05516..665e86a 100644 --- a/yaksh/templates/yaksh/add_question.html +++ b/yaksh/templates/yaksh/add_question.html @@ -4,19 +4,19 @@ {% block pagetitle %} Add Question {% endblock pagetitle %} {% block css %} -<link rel="stylesheet" type="text/css" href="{% static 'yaksh/css/autotaggit.css' %}"> + <link rel="stylesheet" type="text/css" href="{% static 'yaksh/css/autotaggit.css' %}"> {% endblock %} {% block 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> + <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 'yaksh:add_question' question.id %}" method="post" name=frm onSubmit="return autosubmit();" enctype="multipart/form-data"> + <form action="{% if question %}{% url 'yaksh:add_question' question.id %}{% endif %}" method="post" name=frm onSubmit="return autosubmit();" enctype="multipart/form-data"> {% csrf_token %} <center> {{qform.instance.language}} @@ -71,18 +71,45 @@ </div> {% 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> + {% if question %} + <label for="case_type">Add Test Case:</label> + {% if question.type == "code" %} + {% if qform.instance.language == "bash" %} + <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="hooktestcase">Hook </option> + </select> + {% elif qform.instance.language == "scilab" %} + <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="hooktestcase">Hook </option> + </select> + {% else %} + <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="hooktestcase">Hook </option> + <option value="easystandardtestcase">Easy Standard </option> + </select> + {% endif %} + {% else %} + <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> + {% endif %} + {% endif %} </div> <center> <button class="btn btn-lg btn-success" type="submit" name="save_question">Save</button> |