From d7bc376400a610fa2760e05cfb7781050a08dc7b Mon Sep 17 00:00:00 2001 From: ankitjavalkar Date: Fri, 27 Mar 2020 15:44:08 +0530 Subject: Allow stdio expected input to be optional and miscellanous UI fixes --- yaksh/templates/yaksh/add_question.html | 16 ++++++++++++++++ yaksh/views.py | 5 +++-- 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/yaksh/templates/yaksh/add_question.html b/yaksh/templates/yaksh/add_question.html index 17cdcfe..342e8ae 100644 --- a/yaksh/templates/yaksh/add_question.html +++ b/yaksh/templates/yaksh/add_question.html @@ -127,6 +127,22 @@

Test Cases

+ {% if question %} +
+
+ Add Test Case: + + + + +
+
+ {% endif %} {% for formset in formsets %} {{ formset.management_form }}
diff --git a/yaksh/views.py b/yaksh/views.py index b54461f..873c227 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() -- cgit