From ce995e06e3509a1340061c51dfa08a65c69eef66 Mon Sep 17 00:00:00 2001 From: prathamesh Date: Mon, 14 Aug 2017 12:10:42 +0530 Subject: Front-end modification for improved code server Added JQuery to handle request. Sends ajax request and gets json as response. json contains token i.e uid which is answer id. Using uid, an ajax request is sent after every 2 secs till the server gives the desire result. If the code result has error then html is written on the document. If the result has correct answer then next question is displayed. *includes function for string will not work for older browers. Will substitute with a different function in next commit. --- yaksh/templates/yaksh/question.html | 51 +++++-------------------------------- 1 file changed, 6 insertions(+), 45 deletions(-) (limited to 'yaksh/templates') diff --git a/yaksh/templates/yaksh/question.html b/yaksh/templates/yaksh/question.html index ee33523..9df2fef 100644 --- a/yaksh/templates/yaksh/question.html +++ b/yaksh/templates/yaksh/question.html @@ -15,7 +15,7 @@ {% endblock %} {% block script %} - + @@ -79,7 +79,7 @@ function validate(){ } else { - return true; + send_request(); } } @@ -89,47 +89,8 @@ function call_skip(url) form.action = url form.submit(); } - - {% endblock script %} @@ -239,13 +200,13 @@ function call_skip(url)
{% if question.type == "mcq" or "mcc" or "integer" or "float" or "string" %} -
  
+
  
{% elif question.type == "upload" %}
   {% else %} {% if question in paper.get_questions_unanswered %} -    +    {% endif %} {% endif %} -- cgit