summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoradityacp2016-11-30 17:38:26 +0530
committeradityacp2016-11-30 17:38:26 +0530
commitd0cbfb251f2cd606bee2b9cd7a8692f1d1146b47 (patch)
treeef07fb7de81b9e03c8096f4defc2f60c476c9ba7
parent9b4416ecee8b7522d1c3f4de25557a31315df397 (diff)
downloadonline_test-d0cbfb251f2cd606bee2b9cd7a8692f1d1146b47.tar.gz
online_test-d0cbfb251f2cd606bee2b9cd7a8692f1d1146b47.tar.bz2
online_test-d0cbfb251f2cd606bee2b9cd7a8692f1d1146b47.zip
Render Instructions from textarea
-rw-r--r--yaksh/static/yaksh/js/add_quiz.js6
-rw-r--r--yaksh/templates/yaksh/add_quiz.html10
2 files changed, 15 insertions, 1 deletions
diff --git a/yaksh/static/yaksh/js/add_quiz.js b/yaksh/static/yaksh/js/add_quiz.js
index 3da4d5c..a026ec0 100644
--- a/yaksh/static/yaksh/js/add_quiz.js
+++ b/yaksh/static/yaksh/js/add_quiz.js
@@ -7,6 +7,12 @@ function test()
{
document.getElementById("submit").innerHTML = "Save";
}
+ var template = "<p id='rendered_text'></p>"
+ $(template).insertBefore("#id_instructions");
+ $('#id_instructions').bind('keypress', function (event){
+ document.getElementById('rendered_text').innerHTML = document.getElementById('id_instructions').value ;
+ });
+ document.getElementById('rendered_text').innerHTML = document.getElementById('id_instructions').value ;
}
String.prototype.beginsWith = function (string) {
diff --git a/yaksh/templates/yaksh/add_quiz.html b/yaksh/templates/yaksh/add_quiz.html
index 2df97a2..b3b49ae 100644
--- a/yaksh/templates/yaksh/add_quiz.html
+++ b/yaksh/templates/yaksh/add_quiz.html
@@ -20,14 +20,17 @@
<center>
<table class=span1>
{{ form.as_table }}
+ </table>
<script type="text/javascript">
$("#id_start_date_time").datetimepicker({format: 'Y-m-d H:i:s'});
$("#id_end_date_time").datetimepicker({format: 'Y-m-d H:i:s'});
</script>
</table>
+ <br/><br/>
</center>
- <center><button class="btn" type="submit" id="submit" name="questionpaper"> Save </button>
+ <center><button class="btn" type="submit" id="submit" name="questionpaper"> Save
+ </button>
<button class="btn" type="button" name="button" onClick='location.replace("{{URL_ROOT}}/exam/manage/courses/");'>Cancel</button> </center>
@@ -55,4 +58,9 @@
<a href="" onclick="$('#help').hide(); return false"> Close </a>
</div>
{% endif %}
+ <style type="text/css">
+ #rendered_text{
+ width: 550px;
+ }
+ </style>
{% endblock %}