summaryrefslogtreecommitdiff
path: root/yaksh/static
diff options
context:
space:
mode:
authorPrabhu Ramachandran2016-05-10 20:09:08 +0530
committerPrabhu Ramachandran2016-05-10 20:09:08 +0530
commit5c74697b00ea08a2b78615637d8b322410fca4b0 (patch)
treed5b937e90bc7d3051b9c9128c4e1560b09db1c2c /yaksh/static
parentd386d24aaa662f91e4314060926dc9bc02426c7d (diff)
parentc384c60c6d7fb5d30f3f929c518e0b41e084c4c4 (diff)
downloadonline_test-5c74697b00ea08a2b78615637d8b322410fca4b0.tar.gz
online_test-5c74697b00ea08a2b78615637d8b322410fca4b0.tar.bz2
online_test-5c74697b00ea08a2b78615637d8b322410fca4b0.zip
Merge pull request #96 from ankitjavalkar/code-eval-refactor-clean2
Code evaluator refactor
Diffstat (limited to 'yaksh/static')
-rw-r--r--yaksh/static/yaksh/js/add_question.js67
-rw-r--r--yaksh/static/yaksh/js/show_testcase.js24
2 files changed, 25 insertions, 66 deletions
diff --git a/yaksh/static/yaksh/js/add_question.js b/yaksh/static/yaksh/js/add_question.js
index 946c139..e435dde 100644
--- a/yaksh/static/yaksh/js/add_question.js
+++ b/yaksh/static/yaksh/js/add_question.js
@@ -109,34 +109,6 @@ function textareaformat()
document.getElementById('my').innerHTML = document.getElementById('id_description').value ;
});
- $('#id_test').bind('focus', function( event ){
- document.getElementById("id_test").rows=5;
- document.getElementById("id_test").cols=40;
- });
-
- $('#id_test').bind('blur', function( event ){
- document.getElementById("id_test").rows=1;
- document.getElementById("id_test").cols=40;
- });
-
- $('#id_options').bind('focus', function( event ){
- document.getElementById("id_options").rows=5;
- document.getElementById("id_options").cols=40;
- });
- $('#id_options').bind('blur', function( event ){
- document.getElementById("id_options").rows=1;
- document.getElementById("id_options").cols=40;
- });
-
- $('#id_snippet').bind('focus', function( event ){
- document.getElementById("id_snippet").rows=5;
- document.getElementById("id_snippet").cols=40;
- });
- $('#id_snippet').bind('blur', function( event ){
- document.getElementById("id_snippet").rows=1;
- document.getElementById("id_snippet").cols=40;
- });
-
$('#id_type').bind('focus', function(event){
var type = document.getElementById('id_type');
@@ -147,32 +119,7 @@ function textareaformat()
var language = document.getElementById('id_language');
language.style.border = '1px solid #ccc';
});
-
- $('#id_type').bind('change',function(event){
- var value = document.getElementById('id_type').value;
- if(value == 'mcq' || value == 'mcc')
- {
- document.getElementById('id_options').style.visibility='visible';
- document.getElementById('label_option').innerHTML="Options :";
- }
- else
- {
- document.getElementById('id_options').style.visibility='hidden';
- document.getElementById('label_option').innerHTML = "";
- }
- });
- document.getElementById('my').innerHTML = document.getElementById('id_description').value ;
- var value = document.getElementById('id_type').value;
- if(value == 'mcq' || value == 'mcc')
- {
- document.getElementById('id_options').style.visibility='visible';
- document.getElementById('label_option').innerHTML="Options :"
- }
- else
- {
- document.getElementById('id_options').style.visibility='hidden';
- document.getElementById('label_option').innerHTML = "";
- }
+ document.getElementById('my').innerHTML = document.getElementById('id_description').value ;
}
function autosubmit()
@@ -190,16 +137,4 @@ function autosubmit()
return false;
}
-
- if (type.value == 'mcq' || type.value == 'mcc')
- {
- var value = document.getElementById('id_options').value;
- if(value.split('\n').length < 4)
- {
- alert("Please Enter 4 options. One option per line.");
- return false;
- }
- return true;
- }
-
}
diff --git a/yaksh/static/yaksh/js/show_testcase.js b/yaksh/static/yaksh/js/show_testcase.js
new file mode 100644
index 0000000..71be9dc
--- /dev/null
+++ b/yaksh/static/yaksh/js/show_testcase.js
@@ -0,0 +1,24 @@
+function confirm_delete(frm)
+{
+ var n=0;
+ test_case = document.getElementsByName('test_case');
+ for (var i =0;i<test_case.length;i++)
+ {
+ if (test_case[i].checked == false)
+ n = n + 1 ;
+ }
+ if(n==test_case.length)
+ {
+ alert("Please Select at least one test case");
+ return false;
+ }
+ var r = confirm("Are you Sure ?");
+ if(r==false)
+ {
+ for(i=0;i<test_case.length;i++)
+ {
+ test_case[i].checked=false;
+ }
+ return false;
+ }
+} \ No newline at end of file