summaryrefslogtreecommitdiff
path: root/yaksh/templates
diff options
context:
space:
mode:
Diffstat (limited to 'yaksh/templates')
-rw-r--r--yaksh/templates/exam.html8
-rw-r--r--yaksh/templates/yaksh/add_question.html1
-rw-r--r--yaksh/templates/yaksh/grade_user.html7
-rw-r--r--yaksh/templates/yaksh/question.html13
-rw-r--r--yaksh/templates/yaksh/user_data.html8
-rw-r--r--yaksh/templates/yaksh/view_answerpaper.html7
6 files changed, 41 insertions, 3 deletions
diff --git a/yaksh/templates/exam.html b/yaksh/templates/exam.html
index b497cc0..ae1a620 100644
--- a/yaksh/templates/exam.html
+++ b/yaksh/templates/exam.html
@@ -84,9 +84,13 @@
<div class="panel-body"><pre><code>{{ error }}</code></pre></div>
</div>
{% endfor %}
-
+ {% if error != "Incorrect answer" %}
+ <div class="panel-heading">Testcase No. {{ forloop.counter }}</div>
+ <div class="panel-body"><pre><code>{{ error }}</code></pre></div>
+ {% endif %}
</div>
- {% endif %}
+ {% endfor %}
+ </div>
{% endif %}
</div>
</div>
diff --git a/yaksh/templates/yaksh/add_question.html b/yaksh/templates/yaksh/add_question.html
index 75802b4..a1b5e90 100644
--- a/yaksh/templates/yaksh/add_question.html
+++ b/yaksh/templates/yaksh/add_question.html
@@ -56,6 +56,7 @@
<option value="stdiobasedtestcase">StdIO </option>
<option value="mcqtestcase">MCQ/MCC </option>
<option value="hooktestcase">Hook </option>
+ <option value="integertestcase">Integer </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 63ff5eb..7801b0b 100644
--- a/yaksh/templates/yaksh/grade_user.html
+++ b/yaksh/templates/yaksh/grade_user.html
@@ -139,6 +139,13 @@ Status : <b style="color: green;"> Passed </b><br/>
{{ forloop.counter }}. {{ testcase.options|safe }}</strong>
{% endif %}
{% endfor %}
+
+ {% elif question.type == "integer" %}
+ <h5> <u>Correct Answer:</u></h5>
+ {% for testcase in question.get_test_cases %}
+ <strong>{{ testcase.correct }}</strong>
+ {% 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 27b2956..35c8052 100644
--- a/yaksh/templates/yaksh/question.html
+++ b/yaksh/templates/yaksh/question.html
@@ -149,6 +149,8 @@ function call_skip(url)
(PROGRAMMING)
{% elif question.type == "upload" %}
(ASSIGNMENT UPLOAD)
+ {% elif question.type == "integer" %}
+ (ANSWER IN INTEGER)
{% endif %}
</u>
<font class=pull-right>(Marks : {{ question.points }}) </font>
@@ -167,6 +169,14 @@ 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:&nbsp;&nbsp;&nbsp;&nbsp;
+ <input name="answer" type="textbox" id="integer" />
+ <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 }}
@@ -192,10 +202,11 @@ function call_skip(url)
{% endif %}
<div class="from-group">
- {% if question.type == "mcq" or question.type == "mcc"%}
+ {% if question.type == "mcq" or question.type == "mcc" or question.type == "integer" %}
<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 %}
<button class="btn btn-primary" type="submit" name="check" id="check" onClick="submitCode();">Check Answer <span class="glyphicon glyphicon-cog"></span></button>&nbsp;&nbsp;
{% endif %}
diff --git a/yaksh/templates/yaksh/user_data.html b/yaksh/templates/yaksh/user_data.html
index 9be28fb..b667676 100644
--- a/yaksh/templates/yaksh/user_data.html
+++ b/yaksh/templates/yaksh/user_data.html
@@ -75,6 +75,14 @@ User IP address: {{ paper.user_ip }}
{{ forloop.counter }}. {{ testcase.options|safe }}</strong>
{% endif %}
{% endfor %}
+
+ {% elif question.type == "integer" %}
+ <h5> <u>Correct Answer:</u></h5>
+ {% for testcase in question.get_test_cases %}
+ <strong>{{ testcase.correct }}</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 5eb55df..76369db 100644
--- a/yaksh/templates/yaksh/view_answerpaper.html
+++ b/yaksh/templates/yaksh/view_answerpaper.html
@@ -51,6 +51,13 @@
{{ forloop.counter }}. {{ testcase.options|safe }}</strong>
{% endif %}
{% endfor %}
+
+ {% elif question.type == "integer" %}
+ <h5> <u>Correct Answer:</u></h5>
+ {% for testcase in question.get_test_cases %}
+ <strong>{{ testcase.correct }}</strong>
+ {% endfor %}
+
{% else %}
<h5> <u>Test cases: </u></h5>
{% for testcase in question.get_test_cases %}