Questionat0r
Posts: 0
Joined: Tue Mar 10, 2015 10:48 pm

quiz app - "if/case statement"

Hello,
I am trying to build a simple multiple choice quiz app.
I'm stuck at the part where i need the app to give feedback on whether the question was answered correctly directly after it has been answered.

I need an IF statement or something to accomplish this:
if clicked item = [correct_item(located in dabase)] then show "Correct" on the feedback page...

can anyone please point me in the right direction?

thanks!

Bruce Stuart
Posts: 0
Joined: Fri Oct 24, 2014 4:42 am

quiz app - "if/case statement"

As a quick place to look ... Go to w3schoolscom

The syntax, and capitalization IS important is

If ( some logical expression)
{ some group of statements all separated by ; }
else { some group of statements }

A case statement is called a switch statement ... And it's rough syntax is :

switch ( on some value ) {

case value1:
statement 1;
Statement 2;
break;

case value2-n:
erc

Code: Select all

default: 

}

Look at the w3schools.com for examples and exact syntax

Best,
Bruce

Questionat0r
Posts: 0
Joined: Tue Mar 10, 2015 10:48 pm

quiz app - "if/case statement"

thanks bruice

Return to “Issues”