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(-) (limited to 'yaksh') 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 From fbeb3428426691c29d4dd3f38b2245f21b5673ef Mon Sep 17 00:00:00 2001 From: ankitjavalkar Date: Fri, 3 Apr 2020 11:11:41 +0530 Subject: Minor fixes based on feedback --- yaksh/templates/yaksh/add_question.html | 14 +------------- yaksh/templates/yaksh/showquestions.html | 2 +- 2 files changed, 2 insertions(+), 14 deletions(-) (limited to 'yaksh') diff --git a/yaksh/templates/yaksh/add_question.html b/yaksh/templates/yaksh/add_question.html index 342e8ae..0c846d0 100644 --- a/yaksh/templates/yaksh/add_question.html +++ b/yaksh/templates/yaksh/add_question.html @@ -74,18 +74,6 @@
- {% if question %} - Add Test Case: - - - - - {% endif %} {% if uploaded_files %}
@@ -157,7 +145,7 @@
- + Details 
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 @@ - + -- cgit