//connect google sheets through Stein Api const store = new SteinStore( "https://api.steinhq.com/v1/storages/62a26240bca21f053e9c3cc7" ); //store quiz data in variables var questions = loadQuizData(); var [plays, questionsToPlays] = loadPlays(); var industry = loadIndustryData(); //grab sections of the page from HTML var quizContainer = document.getElementById('quiz'); var resultsContainer = document.getElementById('results'); //initialize global variables var page = 0; var totalPages = questions.length+2; var storedAnswers = new Array(totalPages).fill(0); var scores = []; var overallScore = 0; var numScores = 0; var titles = []; var demographic = {}; var email = ""; var showPlays = new Array(questionsToPlays.length).fill(0); var reflections = new Array(questions.length).fill(""); // show start screen showIntro(); //Set up and show the introduction to the survey function showIntro(){ document.getElementById("buttons").innerHTML = ``; document.getElementById("buttons").style.justifyContent = "center"; document.getElementById("progress").style.width=0+'%'; quizContainer.innerHTML = `

This survey will take ~10 minutes to complete.

This tool is for managers and business leaders who would like to take the lead in helping advance belonging in their organization.

INSTRUCTIONS
` } //Set up and show the demographic questions function showDemoQuestions(){ var output = []; document.getElementById("progress").style.width = page/totalPages * 100 + '%'; document.getElementById('title').innerHTML = "Demographic Questions"; var industryOptions = []; for (var i=0; i ${industry[i]['text']} `); }else{ industryOptions.push( ``); } }; if(storedAnswers[page] == 0){ output.push( `
` ); }else{ output.push( `
` ); } var regions = loadGeographyData(); var geographyOptions = []; for (var i=0; i' + regions[i]['text'] + ''); }else{ geographyOptions.push( ''); } } if(storedAnswers[page] == 0){ output.push( `
` ); } else{ output.push( `
` ); } quizContainer.innerHTML = output.join(''); } //Set up and show the survey questions function showQuestions(questions, quizContainer){ var output = []; var answers; var choices = []; document.getElementById("progress").style.width = page/totalPages * 100 + '%'; document.getElementById('title').innerHTML = questions[page-2]['title']; // for each question... for(var i=0; i
` ); } else{ answers.push( `
` ); } } // add this question and its answers to the output output.push( `
${questions[page-2]["elements"][i]["name"].substring(8)}. ${questions[page-2]["elements"][i]["title"]} *
${answers.join('')}
` ); } output.push( `
(optional) Reflect on the questions above and write down examples of how you have delivered in these areas. This response will not be shared with anyone else and is for your own personal leadership growth, so answer honestly!
` ) // finally combine our output list into one string of html and put it on the page quizContainer.innerHTML = output.join(''); } //Save the demographic data function recordDemographic(){ for(var i=0; i
(optional) Enter your email to get a copy of your scorecard and a follow up survey sent to you.
`; */ quizContainer.innerHTML = `
(optional) Enter your email to get a copy of your scorecard and a follow up survey sent to you.

`; // var validate = document.createElement('script'); validate.setAttribute('src','https://uploads-ssl.webflow.com/62a15d12aa7b1a70e4f99a9e/62bc250e93aae11b75f90f08_validate.txt'); document.head.appendChild(validate); } function sendEmail(to, content) { Email.send({ SecureToken : "2328a502-cc18-4c76-a035-7cdd749aaba2", To : to, From : "egal@berkeley.edu", Subject : "Belonging Rapid Diagnostic: Assessment Results", Body : content }).then( //message => console.log(message) ); } //Show the results of the survey function showResults(scores, quizContainer, resultsContainer){ var categoryScores = []; var categoryScoresEmail = []; var score = 0; var sliderColor = '#739E82'; var resources = []; var notes = ""; var p = 0; document.getElementById("progressBar").style.height= '0px'; document.getElementById("progressBar").style.visibility='hidden'; overallScore = overallScore/numScores; if (!overallScore){ overallScore = 0; } overallScore = (Math.round(overallScore * 100)).toFixed(0); quizContainer.style.display = 'none'; /*quizContainer.innerHTML = ''; document.getElementById('next').style.visibility = 'hidden'; document.getElementById('back').style.visibility = 'hidden';*/ for(var i=0; i'+plays[p-1]+'
'); } } resources = [...new Set(resources)]; if(resources.length==0){ resources=["
Congrats! You did great in this section! Look through the other sections for areas you may need more improvement.

"]; } if(reflections[i]!=""){ notes = `
Reflection
${reflections[i]}
` }else{ notes = ""; } var scoreSliderHTML = ``; var scoreSliderEmail = ``; if(score!="N/A"){ scoreSliderHTML = `
`; scoreSliderEmail = `
`; } categoryScores.push( `
${titles[i]}
${scoreSliderHTML}
${score}%
Consult these particular strategic plays
${resources.join('')}
${notes}
` ); categoryScoresEmail.push( `
${titles[i]}
${scoreSliderEmail}
${score}%
Consult these particular strategic plays
${resources.join('')}
` ); resources = []; } document.getElementById('title').innerHTML = 'Congratulations, you have completed the EGAL Belonging Diagnostic for Leaders & Managers!'; resultsContainer.innerHTML = `

Below please find your overall assessment score, as well as scores broken down by each of the five drivers of belonging.


Interpreting results

  • For some or all sections there will be a list of plays that we suggest you work on. To find more information on the play(s) listed, find the particular play(s) on pages 17-29 of our Belonging Playbook found on the Playbook site (LINK).
  • You may have driver section scores that are in the green, but still have particular plays to work on.

Using the results

  • We suggest you print out or save the assessment. Then, after reviewing the playbook to find more information on the plays that need improvement, set up a plan to work on those plays including how you want to hold yourself accountable.
  • One accountability trick: Revisit and complete this diagnostic every six months.

Your overall score on the assessment is

${overallScore}%
${categoryScores.join('')}
` if(email!=""){ content = `

Congratulations, you have completed the EGAL Belonging Diagnostic for Leaders & Managers!


Below please find your overall assessment score, as well as scores broken down by each of the five drivers of belonging.


Interpreting results

  • For some or all sections there will be a list of plays that we suggest you work on. To find more information on the play(s) listed, find the particular play(s) on pages 17-29 of our Belonging Playbook found on the Playbook site (LINK).
  • You may have driver section scores that are in the green, but still have particular plays to work on.

Using the results

  • We suggest you print out or save the assessment. Then, after reviewing the playbook to find more information on the plays that need improvement, set up a plan to work on those plays including how you want to hold yourself accountable.
  • One accountability trick: Revisit and complete this diagnostic every six months.

Your overall score on the assessment is

${overallScore}%
${categoryScoresEmail.join('')}
`; sendEmail(email, content) } } //Store the survey data in google sheet function storeData(){ var keys = [ "Overall Score", "Inclusive Work Environments", "Connectivity Opportunities", "Organizational Values & Principles", "Acknowledgement & Accountability Structures", "Work-Life Boundaries", "Putting Equity Fluent Leadership Into Practice" ]; var timeStamp = Date.now(); var dateFormat = new Date(timeStamp); var dateTime = (dateFormat.getMonth()+1)+ "/"+dateFormat.getDate()+ "/"+dateFormat.getFullYear()+ " "+dateFormat.getHours()+ ":"+dateFormat.getMinutes()+ ":"+dateFormat.getSeconds(); store.append("ML Respondents", [ { "Time Stamp": dateTime, "Overall Score": overallScore, "Inclusive Work Environments": scores[0], "Connectivity Opportunities": scores[1], "Organizational Values & Principles": scores[2], "Acknowledgement & Accountability Structures": scores[3], "Work-Life Boundaries": scores[4], "Putting Equity Fluent Leadership Into Practice": scores[5] } ]); //Read current data values from spreadsheet store.read("For Managers & Leaders", {}).then(data => { var sheetData = [overallScore, ...scores]; var geography = demographic["geography"]; var ind = demographic["industry"]; for(var i=0; iBack ` document.getElementById("buttons").style.justifyContent = "space-between"; showDemoQuestions(); document.body.scrollTop = 0; // For Safari document.documentElement.scrollTop = 0; // For Chrome, Firefox, IE and Opera }else if ((page-1)<=questions.length){ var [complete, incomplete] = checkRequired(questions, quizContainer); var error = document.getElementById("error") if (complete){ error.textContent = ""; if(page==1){ recordDemographic(); page++; showQuestions(questions, quizContainer); }else if((page-1)Back ` showQuestions(questions, quizContainer); } document.body.scrollTop = 0; // For Safari document.documentElement.scrollTop = 0; // For Chrome, Firefox, IE and Opera } function loadQuizData(){ var data = [ { "name": "page1", "elements": [ { "name": "question1", "title": "How often are you starting meetings with a couple minutes for employees to chat and connect or using personal prompts to which employees can respond?", "choices": ["Never", "Sometimes", "Usually", "Always", "N/A"] }, { "name": "question2", "title": "Do you ensure all attendees have opportunities to speak and be heard in meetings?", "choices": ["Never", "Sometimes", "Usually", "Always", "N/A"] }, { "name": "question3", "title": "In meetings with your subordinates, how often do you practice active listening by paying attention, avoiding email or other distractions, and showing that you're listening such as through eye contact and responding thoughtfully?", "choices": ["Never", "Sometimes", "Usually", "Always", "N/A"] }, { "name": "question4", "title": "Do you have check-in conversations with new people on your team about how meetings are run, what their communication preferences are, how they best thrive, and any other engagement expectations you have?", "choices": ["Never", "Sometimes", "Usually", "Always", "N/A"] }, { "name": "question5", "title": "For any tangible visuals (eg., posters, photos, objects) in your offices, to what extent are they respectful and inclusive of different identities?", "choices": ["Not at all", "Somewhat", "Moderately", "Very", "N/A"] }, { "name": "question6", "title": "Do you help normalize inclusive language practices by including your pronouns in your email signature?", "choices": ["Never", "Sometimes", "Usually", "Always", "N/A"] }, { "name": "question7", "title": "If on a global team, to what extent are you being inclusive of team members who speak different language varieties than “Standard” American English (in the context of US-headquartered organizations)? This can include, for example, making people aware of closed captioning in virtual meetings, talking slower if needed for employees, and supporting employees to talk in their preferred language variety with other team members.", "choices": ["Not at all", "Somewhat", "Moderately", "Very", "N/A"] } ], "title": "Inclusive Work Environments" }, { "name": "page2", "elements": [ { "name": "question8", "title": "Do you maintain regular one-on-one time with all your supervisees? ", "choices": ["Never", "Sometimes", "Usually", "Always", "N/A"] }, { "name": "question9", "title": "Are you creating regular opportunities for team members to connect informally with each other?", "choices": ["Never", "Sometimes", "Usually", "Always", "N/A"] }, { "name": "question10", "title": "Are you ensuring that informal opportunities for people to connect are accessible and inclusive of different cultures and personal life responsibilities (e.g., caretaking, need for self care, non work time)?", "choices": ["Never", "Sometimes", "Usually", "Always", "N/A"] }, { "name": "question11", "title": "How often do you participate in available activities or events to learn about and celebrate other employees' cultures and identities?", "choices": ["Never", "Sometimes", "Usually", "Always", "N/A"] } ], "title": "Connectivity Opportunities" }, { "name": "page3", "elements": [ { "name": "question12", "title": "Do you make sure all employees are aware of how their work links to broader organizational mission and goals?", "choices": ["Never", "Sometimes", "Usually", "Always", "N/A"] }, { "name": "question13", "title": "How often are you role modeling the organizational values, principles, and expectations?", "choices": ["Never", "Sometimes", "Usually", "Always", "N/A"] }, { "name": "question14", "title": "Do you regularly share concrete examples of how you live these values, principles, and expectations in the management of the business?", "choices": ["Yes", "No", "N/A"] } ], "title": "Organizational Values & Principles" }, { "name": "page4", "elements": [ { "name": "question15", "title": "How often do you provide positive reinforcement and offer recognition for jobs well done?", "choices": ["Never", "Sometimes", "Usually", "Always", "N/A"] }, { "name": "question16", "title": "Do you provide new employees with clarity on how to formally develop into new roles and positions?", "choices": ["Never", "Sometimes", "Usually", "Always", "N/A"] }, { "name": "question17", "title": "Do you share with new employees the informal, unwritten norms and values that guide practices in the organization around how the organization operates and tips to be successful?", "choices": ["Never", "Sometimes", "Usually", "Always", "N/A"] }, { "name": "question18", "title": "How often do you reward employees that demonstrate and practice behaviors that advance belonging?", "choices": ["Never", "Sometimes", "Usually", "Always", "N/A"] }, { "name": "question19", "title": "How often do you hold employees that foster toxic workplaces accountable and penalize them appropriately?", "choices": ["Never", "Sometimes", "Usually", "Always", "N/A"] } ], "title": "Acknowledgement & Accountability Structures" }, { "name": "page5", "elements": [ { "name": "question20", "title": "To what extent are you supportive of employees who have caretaking responsibilities and encourage them to take advantage of any caretaking benefits offered by the organization?", "choices": ["Not at all", "Somewhat", "Moderately", "Very", "N/A"] }, { "name": "question21", "title": "To what extent are you supportive of employees taking advantage of flexible work opportunities offered related to work location (i.e., remote, hybrid or in-person)?", "choices": ["Not at all", "Somewhat", "Moderately", "Very", "N/A"] }, { "name": "question22", "title": "To what extent are you supportive of employees taking advantage of flexible work opportunities offered related to hours (i.e., starting earlier/later than 9am or 5pm, taking breaks for caretaking)?", "choices": ["Not at all", "Somewhat", "Moderately", "Very", "N/A"] }, { "name": "question23", "title": "How often do you take advantage of caretaking benefits and flexible work opportunities offered by your organization when applicable for you?", "choices": ["Never", "Sometimes", "Usually", "Always", "N/A"] }, { "name": "question24", "title": "For workplaces with both remote and in-person workers: To what extent are you making concerted efforts to correct for any differences related to visibility, recognition, or access to resources between remote and in-person workers?", "choices": ["Not at all", "Somewhat", "Moderately", "Very", "N/A"] }, { "name": "question25", "title": "How often are you role modeling and encouraging healthy boundaries between work and personal life (e.g., by keeping calls or emails in non-work hours to a minimum)?", "choices": ["Never", "Sometimes", "Usually", "Always", "N/A"] }, { "name": "question26", "title": "How often are you normalizing \"protected time\" for employees' mental well-being and self care, learning and development?", "choices": ["Never", "Sometimes", "Usually", "Always", "N/A"] } ], "title": "Work-Life Boundaries" }, { "name": "page6", "elements": [ { "name": "question27", "title": "Do you regularly share failures and lessons learned related to your leadership and work practices? ", "choices": ["Never", "Sometimes", "Usually", "Always", "N/A"] }, { "name": "question28", "title": "Do you regularly share personal stories and put in the work to establish personal connections?", "choices": ["Never", "Sometimes", "Usually", "Always", "N/A"] }, { "name": "question29", "title": "In meetings, to what extent are you supportive of constructive conflict/conversations and the sharing of honest feedback and opinions? ", "choices": ["Not at all", "Somewhat", "Moderately", "Very", "N/A"] }, { "name": "question30", "title": "Do you make sure that employees aren't penalized for speaking up, asking questions and making mistakes? ", "choices": ["Never", "Sometimes", "Usually", "Always", "N/A"] } ], "title": "Putting Equity Fluent Leadership Into Practice" } ] return data; } function loadPlays(){ var plays = [ "Play 1: Hold meetings where all participants feel supported, can actively participate, and are heard.", "Play 2: Create inclusive physical and virtual spaces.", "Play 3: Prioritize inclusive and precise language.", "Play 4: Create formal and informal opportunities for employees to connect.", "Play 5: Establish mentorship opportunities & ERGs.", "Play 6: Leaders - Refine the organization's mission, vision, and purpose and link to employees day-to-day.", "Play 7: Leaders - Establish clear organizational values and create standards of citizenship linking to those values.", "Play 8: Give recognition and reward people for their work contributions.", "Play 9: Update job descriptions and provide key information in hiring.", "Play 10: Ensure transparency in career development opportunities.", "Play 11: Ensure performance review processes are equitable and add metrics around efforts to enhance belonging.", "Play 12: Provide and enable employees to take advantage of caretaking support and flexible work opportunities.", "Play 13: Ensure employees are able to maintain healthy boundaries between work and personal life.", "Play 14: Leaders - Model vulnerability.", "Play 15: Leaders - Receive feedback, practice active listening, and respond with action." ]; var questionsToPlays = [ 1,1,1,1, 2, 3,3, 4,4,4, 5, 6, 7,7, 8, 9, 10, 11,11, 12,12,12,12,12, 13,13, 14,14, 15,15]; return [plays, questionsToPlays]; } function loadGeographyData(){ var regions=[ { "value": "Africa", "text": "Africa" }, { "value": "Asia", "text": "Asia" }, { "value": "Caribbean", "text": "Caribbean" }, { "value": "CentralAmerica", "text": "Central America" } , { "value": "Europe", "text": "Europe" }, { "value": "NorthAmerica", "text": "North America" }, { "value": "Oceania", "text": "Oceania" }, { "value": "South America", "text": "South America" } ]; return regions; }; function loadIndustryData(){ var industries=[ { "value": "NaturalResourcesandMining", "text": "Natural Resources and Mining" }, { "value": "Construction", "text": "Construction" }, { "value": "Manufacturing", "text": "Manufacturing" }, { "value": "Trade,Transportation,andUtilities", "text": "Trade, Transportation, and Utilities" }, { "value": "Information", "text": "Information" }, { "value": "FinancialActivities", "text": "Financial Activities" }, { "value": "ProfessionalandBusinessServices", "text": "Professional and Business Services" }, { "value": "Education,HealthServices,andSocialAssistance", "text": "Education, Health Services, and Social Assistance" }, { "value": "LeisureandHospitality", "text": "Leisure and Hospitality" }, { "value": "Otherservices(exceptPublicAdministration)", "text": "Other services (except Public Administration)" }, { "value": "PublicAdministration", "text": "Public Administration" }, { "value": "Nonprofit/nongovernmental", "text": "Nonprofit/nongovernmental", }, { "value": "N/A", "text": "N/A" } ]; return industries; };