window.onload = function(){ makeScenario = function(scenario){ //Create output Element let $trueOutputElement = $("
"); //Create Control Element const isAccordion = true; if(isAccordion){ $controlElement = $("") .addClass("accordion-control") .append(scenario.name); $trueOutputElement.append($controlElement); } //Mature Content rating if(scenario.adult == true){ $adultText = $("") .addClass("adult") .append(`(question for those over the age of 18... or those mature enough)`) $outputElement.append($adultText); $outputElement.addClass("adult-scenario"); } //description $descriptionElement = $(`${scenario.description}
`); //option list $optionElement = $("Why would you choose this awnser?
"); //Awnser space for the default element $whyResponseElement = $("") $whyResponseElement.attr("placeholder", "Enter response here"); //Populate outputElement $outputElement.append($descriptionElement); $outputElement.append($optionElement); $outputElement.append($whyElement); $outputElement.append($whyResponseElement); //Extra Question if(scenario.question){ $question = $("" + scenario.question + "
") .append($("") .attr("placeholder", "Enter response here")); $outputElement.append($question); } //Submission button $submitElement = $("") .attr("type", "submit") .append("Submit"); $outputElement.append($("