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 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'yaksh/static') 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 -- cgit From 5e500f3344a13d375d018312936280d88d47c93c Mon Sep 17 00:00:00 2001 From: adityacp Date: Wed, 15 Mar 2017 17:55:34 +0530 Subject: Change templates and js - Support multiple files uploading in assignment - Create new check field to grade assignement based question - Add js changes --- yaksh/static/yaksh/js/add_question.js | 36 ++++++++++++++++++++++++++--------- 1 file changed, 27 insertions(+), 9 deletions(-) (limited to 'yaksh/static') diff --git a/yaksh/static/yaksh/js/add_question.js b/yaksh/static/yaksh/js/add_question.js index 8ca22eb..05752b4 100644 --- a/yaksh/static/yaksh/js/add_question.js +++ b/yaksh/static/yaksh/js/add_question.js @@ -111,16 +111,34 @@ function textareaformat() }); - $('#id_type').bind('focus', function(event){ - var type = document.getElementById('id_type'); - type.style.border = '1px solid #ccc'; - }); + $('#id_type').bind('focus', function(event){ + var type = document.getElementById('id_type'); + type.style.border = '1px solid #ccc'; + }); + + $('#id_language').bind('focus', function(event){ + var language = document.getElementById('id_language'); + language.style.border = '1px solid #ccc'; + }); + document.getElementById('my').innerHTML = document.getElementById('id_description').value ; - $('#id_language').bind('focus', function(event){ - var language = document.getElementById('id_language'); - language.style.border = '1px solid #ccc'; - }); - document.getElementById('my').innerHTML = document.getElementById('id_description').value ; + + if (document.getElementById('id_grade_assignment_upload').checked || + document.getElementById('id_type').val() == 'upload'){ + $("#id_grade_assignment_upload").prop("disabled", false); + } + else{ + $("#id_grade_assignment_upload").prop("disabled", true); + } + + $('#id_type').change(function() { + if ($(this).val() == "upload"){ + $("#id_grade_assignment_upload").prop("disabled", false); + } + else{ + $("#id_grade_assignment_upload").prop("disabled", true); + } + }); } function autosubmit() -- cgit