summaryrefslogtreecommitdiff
path: root/yaksh/templates
diff options
context:
space:
mode:
authoradityacp2020-02-17 13:28:01 +0530
committeradityacp2020-02-17 13:28:01 +0530
commit8b0fb468fd94565b359f3c5bf2f2b694e7a9c97a (patch)
tree07e8df762c518881b44556578fe3b5349b31a73c /yaksh/templates
parent5eae1a6c6ebba23179052f87b50c2cb34dd62d05 (diff)
parent3995f0a05fe3e681a21116c158708598db0ada08 (diff)
downloadonline_test-8b0fb468fd94565b359f3c5bf2f2b694e7a9c97a.tar.gz
online_test-8b0fb468fd94565b359f3c5bf2f2b694e7a9c97a.tar.bz2
online_test-8b0fb468fd94565b359f3c5bf2f2b694e7a9c97a.zip
Fix conflicts
Diffstat (limited to 'yaksh/templates')
-rw-r--r--yaksh/templates/yaksh/add_question.html154
1 files changed, 99 insertions, 55 deletions
diff --git a/yaksh/templates/yaksh/add_question.html b/yaksh/templates/yaksh/add_question.html
index c4cd8a7..a400e35 100644
--- a/yaksh/templates/yaksh/add_question.html
+++ b/yaksh/templates/yaksh/add_question.html
@@ -1,52 +1,66 @@
{% 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> {{ fileform.file_field }}{{ fileform.file_field.errors }}
- {% 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}}">&nbsp;delete</input>&nbsp;
- <input type="checkbox" name="extract" value="{{file.id}}" >{% if file.extract %} dont extract{% else %}
- extract{% endif %}</input>&nbsp;&nbsp;
- <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 }}
+ <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}}
+ <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>
+ {% 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}}">&nbsp;delete</input>&nbsp;
+ <input type="checkbox" name="extract" value="{{file.id}}" >{% if file.extract %} dont extract{% else %}extract{% endif %}</input>&nbsp;&nbsp;
+ <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">
@@ -56,24 +70,54 @@
</div>
{% endfor %}
- </div>
- {% endfor %}
- <p><label for="case_type">Add Test Case:</label> <select id="case_type" 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></p>
- <center>
- <button class="btn btn-success" type="submit" name="save_question">Save</button>
- <button class="btn btn-info" type="button" name="button" onClick='location.replace("{{URL_ROOT}}/exam/manage/questions/");'>Back to Questions</button>
- <button class="btn btn-danger" type="submit" name="delete_files">Delete Selected Files</button>
- </center>
-</form>
+ </div>
+ {% endfor %}
+ <div class="form-group">
+ {% 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>
+ <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 %}