diff options
Diffstat (limited to 'yaksh/templates')
-rw-r--r-- | yaksh/templates/yaksh/add_question.html | 3 | ||||
-rw-r--r-- | yaksh/templates/yaksh/grade_user.html | 10 | ||||
-rw-r--r-- | yaksh/templates/yaksh/question.html | 38 | ||||
-rw-r--r-- | yaksh/templates/yaksh/user_data.html | 8 | ||||
-rw-r--r-- | yaksh/templates/yaksh/view_answerpaper.html | 7 |
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> {% elif question.type == "upload" %} <br><button class="btn btn-primary" type="submit" name="check" id="check" onClick="return validate();">Upload</button> + {% 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> 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 %} |