summaryrefslogtreecommitdiff
path: root/yaksh/templates
diff options
context:
space:
mode:
authorPrabhu Ramachandran2017-03-22 16:56:29 +0530
committerGitHub2017-03-22 16:56:29 +0530
commit99addf818d4b7c5c2d4ccecac7d50b0a5ea89a72 (patch)
tree644c7ff9a21c8f7b14519fe84492341a58099c4c /yaksh/templates
parent49a4cbac480f8a9e3fafcd50e6ce2fa41a5d8699 (diff)
parent99b0bd05370e92ee3663354e5ca9122b75cfb2a7 (diff)
downloadonline_test-99addf818d4b7c5c2d4ccecac7d50b0a5ea89a72.tar.gz
online_test-99addf818d4b7c5c2d4ccecac7d50b0a5ea89a72.tar.bz2
online_test-99addf818d4b7c5c2d4ccecac7d50b0a5ea89a72.zip
Merge pull request #215 from maheshgudi/fill_in_the_blanks
Fill in the blanks
Diffstat (limited to 'yaksh/templates')
-rw-r--r--yaksh/templates/yaksh/add_question.html3
-rw-r--r--yaksh/templates/yaksh/grade_user.html10
-rw-r--r--yaksh/templates/yaksh/question.html38
-rw-r--r--yaksh/templates/yaksh/user_data.html8
-rw-r--r--yaksh/templates/yaksh/view_answerpaper.html7
5 files changed, 63 insertions, 3 deletions
diff --git a/yaksh/templates/yaksh/add_question.html b/yaksh/templates/yaksh/add_question.html
index 0d54ef7..a33950a 100644
--- a/yaksh/templates/yaksh/add_question.html
+++ b/yaksh/templates/yaksh/add_question.html
@@ -58,6 +58,9 @@
<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>
</select></p>
<center>
<button class="btn" type="submit" name="save_question">Save</button>
diff --git a/yaksh/templates/yaksh/grade_user.html b/yaksh/templates/yaksh/grade_user.html
index d20695b..1cb1f99 100644
--- a/yaksh/templates/yaksh/grade_user.html
+++ b/yaksh/templates/yaksh/grade_user.html
@@ -144,6 +144,16 @@ Status : <b style="color: green;"> Passed </b><br/>
{{ forloop.counter }}. {{ testcase.options|safe }}</strong>
{% endif %}
{% endfor %}
+
+ {% elif question.type == "integer" or "string" or "float" %}
+ <h5> <u>Correct Answer:</u></h5>
+ {% for testcase in question.get_test_cases %}
+ <strong>{{ testcase.correct|safe }}</strong>
+ {% if testcase.error_margin %}
+ <strong>{{ testcase.error_margin|safe }}</strong>
+ {% endif %}
+ {% endfor %}
+
{% else %}
<h5> <u>Test cases: </u></h5>
{% for testcase in question.get_test_cases %}
diff --git a/yaksh/templates/yaksh/question.html b/yaksh/templates/yaksh/question.html
index dc8a165..0dad59d 100644
--- a/yaksh/templates/yaksh/question.html
+++ b/yaksh/templates/yaksh/question.html
@@ -156,13 +156,25 @@ function call_skip(url)
<h4>
<u> {{ question.summary }}
{% if question.type == "mcq" %}
- (Single Correct Choice Questions)
+ (SINGLE CORRECT CHOICE)
{% elif question.type == "mcc" %}
- (Multiple Correct Choices)
+ (MULTIPLE CORRECT CHOICES)
{% elif question.type == "code" %}
(PROGRAMMING)
{% elif question.type == "upload" %}
(ASSIGNMENT UPLOAD)
+ {% elif question.type == "integer" %}
+ (FILL IN THE BLANKS WITH INTEGER ANSWER)
+ {% elif question.type == "string" %}
+ (FILL IN THE BLANKS WITH STRING ANSWER)
+ {% if testcase.string_check == "lower" %}
+ <h5>(CASE INSENSITIVE)</h5>
+ {% else %}
+ <h5>(CASE SENSITIVE)</h5>
+ {% endif %}
+
+ {% elif question.type == "float" %}
+ (FILL IN THE BLANKS WITH FLOAT ANSWER)
{% endif %}
</u>
<font class=pull-right>(Marks : {{ question.points }}) </font>
@@ -181,6 +193,25 @@ function call_skip(url)
<input name="answer" type="radio" value="{{ test_case.options }}" />{{ test_case.options|safe }} <br/>
{% endfor %}
{% endif %}
+
+ {% if question.type == "integer" %}
+ Enter Integer:<br/>
+ <input name="answer" type="number" id="integer" />
+ <br/><br/>
+ {% endif %}
+
+ {% if question.type == "string" %}
+ Enter Text:<br/>
+ <textarea name="answer" id="string"></textarea>
+ <br/><br/>
+ {% endif %}
+
+ {% if question.type == "float" %}
+ Enter Decimal Value :<br/>
+ <input name="answer" type="number" step="any" id="float" />
+ <br/><br/>
+ {% endif %}
+
{% if question.type == "mcc" %}
{% for test_case in test_cases %}
<input name="answer" type="checkbox" value="{{ test_case.options }}"> {{ test_case.options|safe }}
@@ -206,10 +237,11 @@ function call_skip(url)
{% endif %}
<div class="from-group">
- {% if question.type == "mcq" or question.type == "mcc"%}
+ {% if question.type == "mcq" or "mcc" or "integer" or "float" or "string" %}
<br><button class="btn btn-primary" type="submit" name="check" id="check">Submit Answer</button>&nbsp;&nbsp;
{% elif question.type == "upload" %}
<br><button class="btn btn-primary" type="submit" name="check" id="check" onClick="return validate();">Upload</button>&nbsp;&nbsp;
+
{% else %}
{% if question in paper.get_questions_unanswered %}
<button class="btn btn-primary" type="submit" name="check" id="check" onClick="submitCode();">Check Answer <span class="glyphicon glyphicon-cog"></span></button>&nbsp;&nbsp;
diff --git a/yaksh/templates/yaksh/user_data.html b/yaksh/templates/yaksh/user_data.html
index 6679599..6e62b66 100644
--- a/yaksh/templates/yaksh/user_data.html
+++ b/yaksh/templates/yaksh/user_data.html
@@ -76,6 +76,14 @@ User IP address: {{ paper.user_ip }}
{{ forloop.counter }}. {{ testcase.options|safe }}</strong>
{% endif %}
{% endfor %}
+
+ {% elif question.type == "integer" or "string" or "float" %}
+ <h5> <u>Correct Answer:</u></h5>
+ {% for testcase in question.get_test_cases %}
+ <strong>{{ testcase.correct|safe }}</strong>
+ {% endfor %}
+
+
{% else %}
<h5> <u>Test cases: </u></h5>
{% for testcase in question.get_test_cases %}
diff --git a/yaksh/templates/yaksh/view_answerpaper.html b/yaksh/templates/yaksh/view_answerpaper.html
index f4edf67..4520ac3 100644
--- a/yaksh/templates/yaksh/view_answerpaper.html
+++ b/yaksh/templates/yaksh/view_answerpaper.html
@@ -55,6 +55,13 @@
{{ forloop.counter }}. {{ testcase.options|safe }}</strong>
{% endif %}
{% endfor %}
+
+ {% elif question.type == "integer" or "string" or "float" %}
+ <h5> <u>Correct Answer:</u></h5>
+ {% for testcase in question.get_test_cases %}
+ <strong>{{ testcase.correct|safe }}</strong>
+ {% endfor %}
+
{% else %}
<h5> <u>Test cases: </u></h5>
{% for testcase in question.get_test_cases %}