I have a quiz created in PHP. This quiz will test a users knowledge of javascript. Unfortunately whenever I include javascript code in the questions this creates a conflict with the php code.
For example
$question1 = “1. Inside which HTML element do we put the JavaScript?”;
$question1_correct_answer ="a. ";
$question1_option2 ="b. ";
$question1_option3 ="c. ";
$question1_option4 ="d. ";
$_SESSION[‘question1’] = $question1;
$question2 = “2. How do you create a function?”;
$question2_correct_answer =“function:myFunction()”;
$question2_option2 =“function myFunction()”;
$question2_option3 =“function=myFunction()”;
$question2_option4 =“All are correct”;
$_SESSION[‘question2’] = $question2;
I know the solution is simple. Please help me here. Thank you