]> code.communitydata.science - coldcallbot-discord.git/blob - flask_app/static/process_button.js
Merge remote-tracking branch 'flask_repo/main' into flask
[coldcallbot-discord.git] / flask_app / static / process_button.js
1 $(document).ready(function() {
2    $('#goodButton, #badButton, #neutralButton, #absentButton, #nextButton').on('click', function() {
3        var studentName = $('#studentName').text();
4        console.log(studentName);
5        var buttonValue = $(this).val();
6        var courseCode = window.location.pathname.split('/').pop();
7        $.ajax({
8            url: '/response_quality',
9            type: 'POST',
10            data: {
11               studentName: studentName,
12               buttonValue: buttonValue,
13               course: courseCode
14            },
15            success: function(response) {
16               $('#studentName').text(response);
17            },
18            error: function(error) {
19               console.log(error);
20            }
21        });
22    });
23 });

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