{"id":4792,"date":"2024-11-02T04:29:40","date_gmt":"2024-11-02T04:29:40","guid":{"rendered":"https:\/\/beams-experiments.com\/?page_id=4792"},"modified":"2025-10-14T06:32:36","modified_gmt":"2025-10-14T05:32:36","slug":"pre-task-questionnaire-chatbot","status":"publish","type":"page","link":"https:\/\/beams-experiments.com\/index.php\/pre-task-questionnaire-chatbot\/","title":{"rendered":"Pre-task Questionnaire-Chatbot"},"content":{"rendered":"\n<!DOCTYPE html>\n<html>\n<head>\n    <style>\n        #progressBarContainer {\n            width: 90%;\n            background-color: #e0e0e0;\n            border-radius: 5px;\n            margin-top: 20px;\n        }\n        #progressBar {\n            height: 10px;\n            background-color: #007bff;\n            border-radius: 5px;\n            width: 33%;\n        }\n        #progressText {\n            text-align: center;\n            margin-top: 5px;\n        }\n        #nextButton {\n            display: block;\n            background-color: #007bff;\n            color: white;\n            padding: 10px 20px;\n            margin: 20px auto;\n            font-size: 16px;\n            border: none;\n            border-radius: 5px;\n            cursor: not-allowed;\n            opacity: 0.5;\n        }\n        #nextButton:enabled {\n            cursor: pointer;\n            opacity: 1;\n        }\n        .questionnaire {\n            margin: 20px;\n            text-align: left;\n        }\n        .questionnaire input,\n        .questionnaire select {\n            margin: 5px 0;\n        }\n        .radio-container {\n            display: flex;\n            flex-wrap: wrap;\n        }\n        .radio-container label {\n            margin-right: 10px;\n            margin-bottom: 5px;\n        }\n    <\/style>\n<\/head>\n<body>\n\n    <!-- Questionnaire Section -->\n    <div class=\"questionnaire\">\n        <p><b>1. Student Category:<\/b><\/p>\n        <label><input type=\"radio\" name=\"studentCategory\" value=\"0\"> Home Student<\/label>\n        <label><input type=\"radio\" name=\"studentCategory\" value=\"1\"> International Student<\/label>\n\n        <p><b>2. Please enter your study pathway at Bayes:<\/b>\n            <select name=\"pathway\" id=\"pathway\">\n                <option value=\"\" selected disabled>\u2014 Select your pathway \u2014<\/option>\n                <option value=\"BSc Business Management\">BSc Business Management<\/option>\n                <option value=\"BSc Business with Finance\">BSc Business with Finance<\/option>\n                <option value=\"BSc Business with Marketing\">BSc Business with Marketing<\/option>\n                <option value=\"BSc Business Management with Social Purpose\">BSc Business Management with Social Purpose<\/option>\n                <option value=\"BSc Business Management, Digital Innovation and Entrepreneurship\">BSc Business Management, Digital Innovation and Entrepreneurship<\/option>\n                <option value=\"BSc International Business\">BSc International Business<\/option>\n            <\/select>\n        <\/p>\n        <p id=\"pathwayFeedback\" style=\"margin-top:6px; display:none;\">\n            Selected pathway: <span id=\"pathwayChoice\"><\/span>\n        <\/p>\n\n        <p><b>3. Gender:<\/b><\/p>\n        <label><input type=\"radio\" name=\"gender\" value=\"Male\"> Male<\/label>\n        <label><input type=\"radio\" name=\"gender\" value=\"Female\"> Female<\/label>\n        <label><input type=\"radio\" name=\"gender\" value=\"Other\"> Other<\/label>\n        <label><input type=\"radio\" name=\"gender\" value=\"Prefer not to say\"> Prefer not to say<\/label>\n\n        <p><b>In the following questions, use a scale from 1 to 7, where 1 is \u201cNot at all\u201d and 7 is \u201cVery much so\u201d.<\/b><\/p>\n        <p><b>4. How familiar are you with AI tools?<\/b><br>\n            <label style=\"margin-right:10px;\"><input type=\"radio\" name=\"aiFamiliarity\" value=\"1\"> 1<\/label>\n            <label style=\"margin-right:10px;\"><input type=\"radio\" name=\"aiFamiliarity\" value=\"2\"> 2<\/label>\n            <label style=\"margin-right:10px;\"><input type=\"radio\" name=\"aiFamiliarity\" value=\"3\"> 3<\/label>\n            <label style=\"margin-right:10px;\"><input type=\"radio\" name=\"aiFamiliarity\" value=\"4\"> 4<\/label>\n            <label style=\"margin-right:10px;\"><input type=\"radio\" name=\"aiFamiliarity\" value=\"5\"> 5<\/label>\n            <label style=\"margin-right:10px;\"><input type=\"radio\" name=\"aiFamiliarity\" value=\"6\"> 6<\/label>\n            <label style=\"margin-right:10px;\"><input type=\"radio\" name=\"aiFamiliarity\" value=\"7\"> 7<\/label>\n        <\/p>\n\n        <p><b>5. How often do you use AI tools?<\/b><br>\n            <label style=\"margin-right:10px;\"><input type=\"radio\" name=\"aiUsage\" value=\"1\"> 1<\/label>\n            <label style=\"margin-right:10px;\"><input type=\"radio\" name=\"aiUsage\" value=\"2\"> 2<\/label>\n            <label style=\"margin-right:10px;\"><input type=\"radio\" name=\"aiUsage\" value=\"3\"> 3<\/label>\n            <label style=\"margin-right:10px;\"><input type=\"radio\" name=\"aiUsage\" value=\"4\"> 4<\/label>\n            <label style=\"margin-right:10px;\"><input type=\"radio\" name=\"aiUsage\" value=\"5\"> 5<\/label>\n            <label style=\"margin-right:10px;\"><input type=\"radio\" name=\"aiUsage\" value=\"6\"> 6<\/label>\n            <label style=\"margin-right:10px;\"><input type=\"radio\" name=\"aiUsage\" value=\"7\"> 7<\/label>\n        <\/p>\n\n    <\/div>\n\n    <!-- Next Button -->\n    <button id=\"nextButton\" disabled>Next<\/button>\n\n    <!-- Progress Bar -->\n    <div id=\"progressBarContainer\">\n        <div id=\"progressBar\"><\/div>\n    <\/div>\n    <div id=\"progressText\">Page 1 out of 3<\/div>\n\n    <script src=\"https:\/\/ajax.googleapis.com\/ajax\/libs\/jquery\/3.5.1\/jquery.min.js\"><\/script>\n    <script>\n        localStorage.clear(); \/\/clear previous chats and their vars \n\n        let groupID = '0'; \/\/ Manually control groupID\n        localStorage.setItem('groupID', groupID); \/\/ Store it in local storage\n\n        \/\/ Expose selected pathway globally if you need to access it elsewhere\n        window.selectedPathway = '';\n\n        const genderMapping = {\n            \"Male\": 1,\n            \"Female\": 2,\n            \"Other\": 3,\n            \"Prefer not to say\": 4\n        };\n\n        function checkFields() {\n            let allFilled = true;\n\n            \/\/ Check regular inputs and textareas\n            $('.questionnaire input[type=\"number\"], .questionnaire textarea').each(function() {\n                if ($(this).val() === \"\" || $(this).val() === null) {\n                    allFilled = false;\n                    return false;\n                }\n            });\n\n            \/\/ Check pathway select specifically (default disabled option has empty value)\n            if ($('#pathway').val() === \"\" || $('#pathway').val() === null) {\n                allFilled = false;\n                return false;\n            }\n\n            if (!allFilled) {\n                return false;\n            }\n\n            \/\/ Check radio button groups are answered\n            const radioNames = new Set();\n            $('.questionnaire input[type=\"radio\"]').each(function() {\n                radioNames.add($(this).attr('name'));\n            });\n            for (const name of radioNames) {\n                if (!$('input[name=\"' + name + '\"]:checked').length) {\n                    allFilled = false;\n                    break;\n                }\n            }\n\n            return allFilled;\n        }\n\n        \/\/ Update feedback and global variable when pathway changes\n        $('#pathway').on('change', function() {\n            window.selectedPathway = this.value;\n            const feedback = document.getElementById('pathwayFeedback');\n            const choice = document.getElementById('pathwayChoice');\n            if (this.value) {\n                choice.textContent = this.options[this.selectedIndex].text;\n                feedback.style.display = 'block';\n            } else {\n                feedback.style.display = 'none';\n            }\n        });\n\n        \/\/ Event listener for inputs, textareas, and selects to toggle Next button\n        $('.questionnaire').on('change keyup', 'input, textarea, select', function() {\n            if (checkFields()) {\n                $('#nextButton').removeAttr('disabled').css({ cursor: 'pointer', opacity: 1 });\n            } else {\n                $('#nextButton').attr('disabled', 'disabled').css({ cursor: 'not-allowed', opacity: 0.5 });\n            }\n        });\n\n        $('#nextButton').on('click', function() {\n            var studentCategory = $('[name=\"studentCategory\"]').val();\n            var gender = genderMapping[$('[name=\"gender\"]:checked').val()] || 0;\n            var pathway = $('#pathway').val();\n            \n            var aiFamiliarity = $('[name=\"aiFamiliarity\"]:checked').val();\n            var aiUsage = $('[name=\"aiUsage\"]:checked').val();\n\n            \/\/ Save data to local storage\n            localStorage.setItem('studentCategory', studentCategory);\n            localStorage.setItem('gender', gender.toString());\n            localStorage.setItem('pathway', pathway);\n            localStorage.setItem('aiFamiliarity', aiFamiliarity);\n            localStorage.setItem('aiUsage', aiUsage);\n\n            \/\/ Redirect to the next page\n            window.location.href = 'https:\/\/beams-experiments.com\/index.php\/AI_HE\/chatbot\/bayes-ug-chatbot-pilot\/';\n        });\n    <\/script>\n\n<\/body>\n<\/html>\n","protected":false},"excerpt":{"rendered":"<p>1. Student Category: Home Student International Student 2. Please enter your study pathway at Bayes: \u2014 Select your pathway \u2014BSc Business ManagementBSc Business with FinanceBSc Business with MarketingBSc Business Management with Social PurposeBSc Business Management, Digital Innovation and EntrepreneurshipBSc International Business Selected pathway: 3. Gender: Male Female Other Prefer not to say In the following [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"om_disable_all_campaigns":false,"footnotes":""},"class_list":["post-4792","page","type-page","status-publish","hentry"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/beams-experiments.com\/index.php\/wp-json\/wp\/v2\/pages\/4792","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/beams-experiments.com\/index.php\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/beams-experiments.com\/index.php\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/beams-experiments.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/beams-experiments.com\/index.php\/wp-json\/wp\/v2\/comments?post=4792"}],"version-history":[{"count":13,"href":"https:\/\/beams-experiments.com\/index.php\/wp-json\/wp\/v2\/pages\/4792\/revisions"}],"predecessor-version":[{"id":6374,"href":"https:\/\/beams-experiments.com\/index.php\/wp-json\/wp\/v2\/pages\/4792\/revisions\/6374"}],"wp:attachment":[{"href":"https:\/\/beams-experiments.com\/index.php\/wp-json\/wp\/v2\/media?parent=4792"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}