diff options
author | ankitjavalkar | 2016-04-29 11:23:07 +0530 |
---|---|---|
committer | ankitjavalkar | 2016-05-05 19:21:34 +0530 |
commit | 34fb6b71ce5fcbd9a5537b305504cadaeb86d9a3 (patch) | |
tree | 769c50fc9825ee73eeb7d844db3676a06f2e4e67 /yaksh/templates | |
parent | 5967e0e1cce19d356ba622719b332f776127b277 (diff) | |
download | online_test-34fb6b71ce5fcbd9a5537b305504cadaeb86d9a3.tar.gz online_test-34fb6b71ce5fcbd9a5537b305504cadaeb86d9a3.tar.bz2 online_test-34fb6b71ce5fcbd9a5537b305504cadaeb86d9a3.zip |
- Modify question - answer validation in views
- Modify show_question to include test_cases in template context
- Modify question display template
- Minor changes in forms and urls for proper rebasing
Diffstat (limited to 'yaksh/templates')
-rw-r--r-- | yaksh/templates/yaksh/question.html | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/yaksh/templates/yaksh/question.html b/yaksh/templates/yaksh/question.html index e542fe9..8a67818 100644 --- a/yaksh/templates/yaksh/question.html +++ b/yaksh/templates/yaksh/question.html @@ -165,8 +165,14 @@ function call_skip(url) <input type=hidden name="question_id" id="question_id" value={{ question.id }}></input> {% if question.type == "mcq" %} - {% for option in question.options.strip.splitlines %} - <input name="answer" type="radio" value="{{option}}" />{{option}} <br/> + {% for test_case in test_cases %} + <input name="answer" type="radio" value="{{ test_case.options }}" />{{ test_case.options }} <br/> + {% endfor %} + {% endif %} + {% if question.type == "mcc" %} + {% for test_case in test_cases %} + <input name="answer" type="checkbox" value="{{ test_case.options }}"> {{ test_case.options }} + <br> {% endfor %} {% endif %} {% if question.type == "upload" %} @@ -174,12 +180,6 @@ function call_skip(url) <input type=file id="assignment" name="assignment"> <hr> {% endif %} - {% if question.type == "mcc" %} - {% for option in question.options.strip.splitlines %} - <input name="answer" type="checkbox" value="{{ option }}"> {{ option }} - <br> - {% endfor %} - {% endif %} {% if question.type == "code" %} <h3>Program:</h3> <textarea rows="1" class="bash" readonly="yes" name="snippet" id="snippet" wrap="off" >{% if last_attempt %}{{ question.snippet }}{% else %}{% if question.type == "bash" %} #!/bin/bash {{ question.snippet }}{% else %}{{ question.snippet }}{% endif %}{% endif %}</textarea> @@ -204,7 +204,7 @@ function call_skip(url) {% endif %} </form> </div> - + <!-- Modal --> <div class="modal fade " id="upload_alert" > <div class="modal-dialog"> |