This repository has been archived by the owner on Jun 11, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest.php
71 lines (58 loc) · 1.82 KB
/
test.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
<html>
<head>
<script>
function showUser(str) {
if (str=="") {
document.getElementById("txtHint").innerHTML="";
return;
}
if (window.XMLHttpRequest) {
// code for IE7+, Firefox, Chrome, Opera, Safari
xmlhttp=new XMLHttpRequest();
} else { // code for IE6, IE5
xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
}
xmlhttp.onreadystatechange=function() {
if (this.readyState==4 && this.status==200) {
document.getElementById("txtHint").innerHTML=this.responseText;
}
}
xmlhttp.open("GET","display.php?q="+str,true);
xmlhttp.send();
}
</script>
<script type="text/javascript" src="http://code.jquery.com/jquery-1.4.4.min.js"></script>
<script type='text/javascript'>
$(window).load(function(){
$("#delete").live('click', function(event) {
alert('you clicked me!');
event.preventDefault();// using this page stop being refreshing
$.ajax({
type: 'POST',
url: 'delete_ques.php',
data: $('#quesForm').serialize(),
success: function (data) {
alert(data);
}
});
});
});
</script>
</head>
<body>
<button type="button" class="mui-btn mui-btn--raised mui-btn--accent" name="delete" id="delete" ><b>Delete</b></button>
<select name="qtype" id="qtype" onchange="showUser(this.value)">
<option value="mcq">Multiple Choice Questions</option>
<option value="fib">Fill in the Blanks</option>
<option value="tf">True or False</option>
<option value="rear">Code Rearrange</option>
<option value="cmcq">Code based MCQ</option>
<option value="short">Short Questions</option>
<option value="long">Long Questions</option>
</select>
<label>Select Type of Quiz</label>
<div id="txtHint">
</div>
</div>
</body>
</html>