Question: Seeking php help - I'm trying to put together a multiple choice quiz and could use some help. I'm not entirely sure how I would

Seeking php help -

I'm trying to put together a multiple choice quiz and could use some help. I'm not entirely sure how I would keep score and return the percentage, this should be a function. I'm also not sure how to apply my multiple choice quiz into my page. I've pasted the instructions, and my code so far - thanks for your time and help!

Intructions

Use arrays, loops and functions. Use one multidimensional associative array to store the questions, choices and answers for this quiz. Use a nested foreach loop to display the questions and choices. Create and use a simple function to calculate the percentage based on the number correct out of the total number of questions.

Validation and sticky forms

The form should be validated to ensure the user and answered all five questions before calculating the score.

Code

html>

  charset="UTF-8"> http-equiv="X-UA-Compatible" content="IE=edge"> name="viewport" content="width=device-width, initial-scale=1"> Wisconsin State Symbols href="css/bootstrap.css" rel="stylesheet" type="text/css"> href="css/custom.css" rel="stylesheet" type="text/css">  class="text-center"> 
class="cover-container d-flex h-100 p-3 mx-auto flex-column">
class="masthead mb-auto">
class="inner">

class="masthead-brand">Quiz

role="main" class="inner cover">

class="cover-heading">- Quiz Time -

class="lead">Bacon ipsum dolor amet strip steak pork ground round, short loin tri-tip doner kielbasa. Cupim pastrami sausage short ribs jowl swine, beef pancetta pork belly ribeye kielbasa. Pork meatloaf ground round chuck.


$stateSymbols = array (); $stateSymbols[] = [ 'question' => 'What is the state bird for Wisconsin?', 'related' => ('Cardinal', 'Sparrow', 'Robin', 'Eagle', 'Barn Owl'), 'answer' => 'Robin', ]; $stateSymbols[] = [ 'question' => 'What is the state rock for Wisconsin?', 'related' => ('Alabaster', 'Galena', 'Limestone', 'Shale', 'Red Granite'), 'answer' => 'Red Granite', ]; $stateSymbols[] = [ 'question' => 'What is Wisconsin\'s grain?', 'related' => ('Rice', 'Wheat', 'Corn', 'Oats', 'Rye'), 'answer' => 'Corn', ]; $stateSymbols[] = [ 'question' => 'What is Wisconsin\'s state insect?', 'related' => ('Honey Bee', 'Moth', 'Mosquito', 'Botfly', 'Katydid'), 'answer' => 'Honey Bee', ]; $stateSymbols[] = [ 'question' => 'What is Wisconsin\'s beverage?', 'related' => ('Water', 'Beer', 'Orange Juice', 'Milk', 'Cranberry Juice'), 'answer' => 'Milk', ]; var_dump($stateSymbols); ?>
class="mastfoot mt-auto">
class="inner">

Footer Here!

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!