diff --git a/public/index.html b/public/index.html
index b1cbdf3..30e169d 100644
--- a/public/index.html
+++ b/public/index.html
@@ -7,13 +7,17 @@
- Lesson Prompts
-
-
- - Current Prompt
-
-
-
+
+
+
+
+ - Current Prompt
+
+
+
+
diff --git a/public/js/index.js b/public/js/index.js
index fb139c6..bcdbd19 100644
--- a/public/js/index.js
+++ b/public/js/index.js
@@ -18,6 +18,12 @@ socket.on('prompt sent', function (prompt) {
}
});
+socket.on('disconnect students', function (prompt) {
+ document.querySelector('h1').innerHTML = "Thanks for attending this class!"
+ document.querySelector('main').innerHTML = "";
+ window.close();
+});
+
button.addEventListener('click', (event)=>{
button.setAttribute("disabled",true);
socket.emit('prompt completed', username);
diff --git a/server.js b/server.js
index ebaccc2..1ed103b 100644
--- a/server.js
+++ b/server.js
@@ -48,6 +48,7 @@ socketserver.on('connection', (socket)=>{
socketserver.emit('username list', usernames);
socketserver.emit('prompt completed', currentComplete);
socketserver.emit('prompt sent', currentPrompt);
+ socketserver.emit('disconnect students', currentPrompt);
});
});