-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathchatbot2.html
59 lines (34 loc) · 1.94 KB
/
chatbot2.html
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
<html>
<head>
<script>
know = {
"Hello" : "          Hi!I am stdbot!!! How can I help you?",
"hello" : "          Hi!I am stdbot!!! How can I help you?",
"Hi" : "          Hi!I am stdbot!!! How can I help you?",
"How intense are classes/exams? (hrs/week?)" : "          5-6 hrs per day i-e 25-30 hrs per week",
"Can I feel there is a collaborative environment with other students?" : "          yeah!It depends on you",
"Is your lab a good one to join?":"          Yes, It is Important to join lab in regular basis.Do you need your lab Schedule?",
"yes" : "          Monday:Os lab(Time 9:30-11:30),Tuesday:Programming Lab(Time 9:30-11:30);Thrusday:Communication lab(Time 9:30-11:30);Friday:Digital Design Lab(Time 8:30-10:30)",
"No" : "          Its ok",
"What do you think of the classes? (Were they valuable, did you learn a lot, did they take a lot of effort, etc?" : "&nsbp &nsbp &nsbp &nsbp &nsbpIt depends how attentive you are during class",
"What is the timing for midsem?" : "          It will probably in the last week of September",
"How old are you?" : "          I am infinity in age"
};
function talk() {
var user = document.getElementById("userBox").value;
document.getElementById("userBox").value= "";
document.getElementById("chatLog").innerHTML += user+"<br>";
if (user in know) {
document.getElementById("chatLog").innerHTML += know[user] + "<br>";
} else
{
document.getElementById("chatLog").innerHTML += "Sorry!I don't understand,Please ask another question... <br>";
}
}
</script>
</head>
<body>
<p id="chatLog"> - - <b>Student Assitant bot-<br>It helps student to know updated information and time schedule of college</b> - - <br> </p>
<input id="userBox" type="text" onkeydown="if(event.keyCode == 13) {talk()}">
</body>
</html>