diff options
Diffstat (limited to 'yaksh/static')
-rw-r--r-- | yaksh/static/yaksh/js/question_filter.js | 47 | ||||
-rw-r--r-- | yaksh/static/yaksh/js/show_question.js | 17 |
2 files changed, 14 insertions, 50 deletions
diff --git a/yaksh/static/yaksh/js/question_filter.js b/yaksh/static/yaksh/js/question_filter.js deleted file mode 100644 index aa3a229..0000000 --- a/yaksh/static/yaksh/js/question_filter.js +++ /dev/null @@ -1,47 +0,0 @@ -$(document).ready(function(){ - $question_type = $("#id_question_type"); - $marks = $("#id_marks"); - $language = $("#id_language"); - - function question_filter() { - $.ajax({ - url: "/exam/ajax/questions/filter/", - type: "POST", - data: { - question_type: $question_type.val(), - marks: $marks.val(), - language: $language.val() - }, - dataType: "html", - success: function(output) { - var questions = $(output).filter("#questions").html(); - $("#filtered-questions").html(questions); - } - }); - } - - $question_type.change(function() { - question_filter() - }); - - $language.change(function() { - question_filter() - }); - - $marks.change(function() { - question_filter() - }); - - $("#checkall").change(function(){ - if($(this).prop("checked")) { - $("#filtered-questions input:checkbox").each(function(index, element) { - $(this).prop('checked', true); - }); - } - else { - $("#filtered-questions input:checkbox").each(function(index, element) { - $(this).prop('checked', false); - }); - } - }); -});
\ No newline at end of file diff --git a/yaksh/static/yaksh/js/show_question.js b/yaksh/static/yaksh/js/show_question.js index e6825a0..d7b6a44 100644 --- a/yaksh/static/yaksh/js/show_question.js +++ b/yaksh/static/yaksh/js/show_question.js @@ -47,7 +47,18 @@ function append_tag(tag){ tag_name.value = tag.value; } } -$(document).ready(function() - { - $("#questions-table").tablesorter({sortList: [[0,0], [4,0]]}); +$(document).ready(function() { + $("#questions-table").tablesorter({}); + $("#checkall").change(function(){ + if($(this).prop("checked")) { + $("#filtered-questions input:checkbox").each(function(index, element) { + $(this).prop('checked', true); + }); + } + else { + $("#filtered-questions input:checkbox").each(function(index, element) { + $(this).prop('checked', false); + }); + } }); +}); |