X-Git-Url: https://code.communitydata.science/coldcallbot-discord.git/blobdiff_plain/92e65de7715056ee39c923e1d51fb8c777e64afd..e756c448c0c124b81ab74ac356d1d289af902cd1:/flask_app/static/process_button.js?ds=inline diff --git a/flask_app/static/process_button.js b/flask_app/static/process_button.js new file mode 100644 index 0000000..6bea8a2 --- /dev/null +++ b/flask_app/static/process_button.js @@ -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); + } + }); + }); +});