From d0cbfb251f2cd606bee2b9cd7a8692f1d1146b47 Mon Sep 17 00:00:00 2001 From: adityacp Date: Wed, 30 Nov 2016 17:38:26 +0530 Subject: Render Instructions from textarea --- yaksh/static/yaksh/js/add_quiz.js | 6 ++++++ yaksh/templates/yaksh/add_quiz.html | 10 +++++++++- 2 files changed, 15 insertions(+), 1 deletion(-) (limited to 'yaksh') 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 = "

" + $(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 @@
{{ form.as_table }} +
+

-
+
@@ -55,4 +58,9 @@ Close {% endif %} + {% endblock %} -- cgit