]> code.communitydata.science - coldcallbot-discord.git/blobdiff - flask_app/static/process_button.js
added flask app from jeremy
[coldcallbot-discord.git] / flask_app / static / process_button.js
diff --git a/flask_app/static/process_button.js b/flask_app/static/process_button.js
new file mode 100644 (file)
index 0000000..6bea8a2
--- /dev/null
@@ -0,0 +1,23 @@
+$(document).ready(function() {
+   $('#goodButton, #badButton, #neutralButton, #absentButton').on('click', function() {
+       var studentName = $('#studentName').text();
+       console.log(studentName);
+       var buttonValue = $(this).val();
+       var courseCode = window.location.pathname.split('/').pop();
+       $.ajax({
+           url: '/response_quality',
+           type: 'POST',
+           data: {
+              studentName: studentName,
+              buttonValue: buttonValue,
+              course: courseCode
+           },
+           success: function(response) {
+              console.log(response);
+           },
+           error: function(error) {
+              console.log(error);
+           }
+       });
+   });
+});

Community Data Science Collective || Want to submit a patch?