From 344b6441017f72225a0d89f41c6cde38f4bbe187 Mon Sep 17 00:00:00 2001 From: adityacp Date: Wed, 22 Feb 2017 14:58:12 +0530 Subject: Allow moderator to select questions in any order required --- yaksh/static/yaksh/js/question_paper_creation.js | 14 ++++++++++++++ yaksh/templates/yaksh/design_questionpaper.html | 8 +++++--- 2 files changed, 19 insertions(+), 3 deletions(-) diff --git a/yaksh/static/yaksh/js/question_paper_creation.js b/yaksh/static/yaksh/js/question_paper_creation.js index 898e491..430ec4b 100644 --- a/yaksh/static/yaksh/js/question_paper_creation.js +++ b/yaksh/static/yaksh/js/question_paper_creation.js @@ -46,4 +46,18 @@ $(document).ready(function(){ $("#random").click(); }); + var checked_vals = []; + $('input:checkbox[name="questions"]').click(function() { + if($(this).prop("checked") == true){ + checked_vals.push(parseInt($(this).val())); + } + else{ + checked_vals.pop(parseInt($(this).val())); + } + }); + $('#design_q').submit(function(eventObj) { + $(this).append(''); + return true; +}); + });//document diff --git a/yaksh/templates/yaksh/design_questionpaper.html b/yaksh/templates/yaksh/design_questionpaper.html index 4418c27..829e27f 100644 --- a/yaksh/templates/yaksh/design_questionpaper.html +++ b/yaksh/templates/yaksh/design_questionpaper.html @@ -23,7 +23,7 @@ select {% block content %} -