diff options
author | jayparikh111 | 2012-02-29 13:14:00 +0530 |
---|---|---|
committer | jayparikh111 | 2012-02-29 13:14:00 +0530 |
commit | 87862b8c8d7822a4578b5cb5f413bedb37454bd2 (patch) | |
tree | e6af84fb02fd5e2dc3321150dc1234d450847575 | |
parent | 7660073c5c83534a869f685b27c0fe0152b9983c (diff) | |
download | online_test-87862b8c8d7822a4578b5cb5f413bedb37454bd2.tar.gz online_test-87862b8c8d7822a4578b5cb5f413bedb37454bd2.tar.bz2 online_test-87862b8c8d7822a4578b5cb5f413bedb37454bd2.zip |
minor changes for rendering question(s)
-rw-r--r-- | testapp/templates/exam/add_question.html | 17 | ||||
-rw-r--r-- | testapp/templates/exam/edit_question.html | 19 | ||||
-rw-r--r-- | testapp/templates/exam/grade_user.html | 4 |
3 files changed, 34 insertions, 6 deletions
diff --git a/testapp/templates/exam/add_question.html b/testapp/templates/exam/add_question.html index 59a1d64..8bccb66 100644 --- a/testapp/templates/exam/add_question.html +++ b/testapp/templates/exam/add_question.html @@ -2,18 +2,31 @@ {% block subtitle %}Add Question{% endblock %} +{% block script %} +<script type='text/javascript'> +function my_render(frm) +{ + document.getElementById('my').innerHTML = frm.description.value; + +} +</script> +{% endblock %} {% block css %} <link rel="stylesheet" href="{{ URL_ROOT }}/static/exam/css/question_quiz.css" type="text/css" /> {% endblock %} {% block manage %} -<form action="" method="post"> +<form action="" method="post" name="frm" onKeyPress='javascript:my_render(frm);'> {% csrf_token %} +<b>Look of Question in HTML Format :</b> +<p id='my' ></p> + <center><table class=span1> {{ form.as_table }} </table> + <center><button class="btn" type="submit" name="savequestion">Save</button> <button class="btn" type="button" name="button" onClick='location.replace("{{URL_ROOT}}/exam/manage/questions/");'>Cancel</button> </center> </form> -{% endblock %} +{% endblock %} diff --git a/testapp/templates/exam/edit_question.html b/testapp/templates/exam/edit_question.html index 6a4f1ec..a189ac5 100644 --- a/testapp/templates/exam/edit_question.html +++ b/testapp/templates/exam/edit_question.html @@ -5,11 +5,25 @@ {% block css %} <link rel="stylesheet" href="{{ URL_ROOT }}/static/exam/css/question_quiz.css" type="text/css" /> {% endblock %} - +{% block script %} +<script type='text/javascript'> +function my_render(frm) +{ + for(var i=1;i<=frm.description.length;i++) + { + document.getElementById(i).innerHTML = frm.description[i-1].value; + } + +} +</script> +{% endblock %} {% block manage %} -<form action="{{URL_ROOT}}/exam/manage/editquestion/" method="post"> +<form name='frm' action="{{URL_ROOT}}/exam/manage/editquestion/" method="post" onKeyPress='javascript:my_render(frm);'> {% csrf_token %} + {% for form in forms %} +<b>Look of Question in HTML Format :</b> +<p id='{{forloop.counter}}'></p> <table class=span1> {{ form.as_table }} </table> @@ -19,3 +33,4 @@ <button class="btn" type="button" name="button" onClick='location.replace("{{URL_ROOT}}/exam/manage/questions/");'>Cancel</button> </center> </form> {% endblock %} + diff --git a/testapp/templates/exam/grade_user.html b/testapp/templates/exam/grade_user.html index 5d3aa58..b7970e8 100644 --- a/testapp/templates/exam/grade_user.html +++ b/testapp/templates/exam/grade_user.html @@ -56,7 +56,7 @@ Start time: {{ paper.start_time }} <br/> {% csrf_token %} {% for question, answers in paper.get_question_answers.items %} <p><strong> - <a id='myHeader' href="{{URL_ROOT}}/admin/exam/question/{{question.id}}" onMouseOver="javascript:showdata('myContent{{question.id}}','myHeader');" onMouseOut="javascript:hidedata('myContent{{question.id}}','myHeader');"> Question: {{ question.id }}. {{ question.summary }} </a> + <a id='myHeader' href="{{URL_ROOT}}/admin/exam/question/{{question.id}}" onMouseOver="javascript:showdata('myContent{{question.id}}','myHeader');" onMouseOut="javascript:hidedata('myContent{{question.id}}','myHeader');"> Question: {{ question.id }}. {{ question.summary }} </a> (Points: {{ question.points }})</strong> </p> <div style="clear:both;"></div> <div id="contentDiv"> <div id="myContent{{question.id}}" style="display: none;"> @@ -70,7 +70,7 @@ Start time: {{ paper.start_time }} <br/> </div> - (Points: {{ question.points }})</strong> </p> + {% if question.type == "mcq" %} <p> Choices: {% for option in question.options.strip.splitlines %} {{option}}, {% endfor %} |