summaryrefslogtreecommitdiff
path: root/yaksh
diff options
context:
space:
mode:
Diffstat (limited to 'yaksh')
-rw-r--r--yaksh/templates/yaksh/add_question.html30
-rw-r--r--yaksh/templates/yaksh/showquestions.html2
-rw-r--r--yaksh/views.py5
3 files changed, 21 insertions, 16 deletions
diff --git a/yaksh/templates/yaksh/add_question.html b/yaksh/templates/yaksh/add_question.html
index 17cdcfe..0c846d0 100644
--- a/yaksh/templates/yaksh/add_question.html
+++ b/yaksh/templates/yaksh/add_question.html
@@ -74,18 +74,6 @@
</div>
</td>
</tr>
- {% if question %}
- <tr><td>Add Test Case:</td>
- <td>
- <select id="case_type" class="form-control" name="case_type" onchange="frm.submit()">
- <option value="" selected="selected">Select Testcase</option>
- {% for key, value in testcase_options %}
- <option value="{{key}}">{{value}}</option>
- {% endfor %}
- </select>
- </td>
- </tr>
- {% endif %}
</table>
{% if uploaded_files %}
<div class="card">
@@ -127,6 +115,22 @@
<h3>Test Cases</h3>
</div>
<div class="card-body">
+ {% if question %}
+ <div class="row">
+ <div class="col pb-4">
+ <tr><td>Add Test Case:</td>
+ <td>
+ <select id="case_type" class="form-control" name="case_type" onchange="frm.submit()">
+ <option value="" selected="selected">Select Testcase</option>
+ {% for key, value in testcase_options %}
+ <option value="{{key}}">{{value}}</option>
+ {% endfor %}
+ </select>
+ </td>
+ </tr>
+ </div>
+ </div>
+ {% endif %}
{% for formset in formsets %}
{{ formset.management_form }}
<div id="accordion">
@@ -141,7 +145,7 @@
</div>
<div class="ml-auto">
<a class="card-link" data-toggle="collapse" href="#collapse{{form.instance.id}}">
- <i class="fa fa-toggle-down"></i>
+ Details&nbsp;<i class="fa fa-angle-down"></i></i>
</a>
</div>
</div>
diff --git a/yaksh/templates/yaksh/showquestions.html b/yaksh/templates/yaksh/showquestions.html
index fdfcc60..e0cd529 100644
--- a/yaksh/templates/yaksh/showquestions.html
+++ b/yaksh/templates/yaksh/showquestions.html
@@ -122,7 +122,7 @@
</div>
<input type="text" name="question_tags" id="question_tags" class="form-control" type="search" placeholder="Search using comma separated Tags">
<span class="input-group-append">
- <a class="btn btn-outline-secondary" type="submit"><i class="fa fa-search yakshred"></i></a>
+ <button class="btn btn-outline-secondary" type="submit"><i class="fa fa-search"></i></button>
</span>
</div>
</div>
diff --git a/yaksh/views.py b/yaksh/views.py
index 51f6e54..9efcbe9 100644
--- a/yaksh/views.py
+++ b/yaksh/views.py
@@ -103,8 +103,9 @@ def get_html_text(md_text):
def formfield_callback(field):
- if (isinstance(field, models.TextField) and field.name == 'expected_output'
- or field.name == 'expected_input'):
+ if (isinstance(field, models.TextField) and field.name == 'expected_input'):
+ return fields.CharField(strip=False, required = False)
+ if (isinstance(field, models.TextField) and field.name == 'expected_output'):
return fields.CharField(strip=False)
return field.formfield()