module.exports = function(io) {
  
  var poll = {
    responseId: 1,
    type: 'thumbs',
    datetime: new Date(),
    lessonId: 13,
  };

  io.on('connection', function(client){

    //TEACHER CODE
      
    client.on('studentConnect', function(data) {
      // FRONTEND-LISTENER: client.on('newStudentConnected', (studentInfo) => {display(studentCount++ and studentInfo);});
      
      //TODO: DB.write('newStudentConnected', data);
    });

    client.on('responseFromStudent', function(data) {
      // write data to the DB
      // TODO: DB query writing data

      // display data on frontend
      // FRONTEND-LISTENER: client.on('studentData', (data) => {display(data)});
      client.emit('studentData', data);
    });

    client.on('teacherConnect', function(data) {
      console.log('Teacher connected');
    });


    //STUDENT CODE

    // client.on('newPoll', function(data) {
    //   client.emit(data);
    // });

    setTimeout(function(){
      io.sockets.emit('responseFromStudent');
    }, 5000);

  });
};
@@ -455,35 +455,31 @@
 ent.on('
-responseFromStudent
+studentResponse
 ', funct
@@ -675,24 +675,26 @@
 a)%7D);%0A      
+//
 client.emit(
@@ -707,32 +707,57 @@
 ntData', data);%0A
+      console.log(data);%0A
     %7D);%0A%0A    cli
@@ -872,179 +872,8 @@
 DE%0A%0A
-    // client.on('newPoll', function(data) %7B%0A    //   client.emit(data);%0A    // %7D);%0A%0A    setTimeout(function()%7B%0A      io.sockets.emit('responseFromStudent');%0A    %7D, 5000);
 %0A%0A  

Rewrite student response event