Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9245973
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T09:23:07+00:00 2026-06-18T09:23:07+00:00

Hopefully someone can help! I successfully completed over the weekend my quiz which was

  • 0

Hopefully someone can help!

I successfully completed over the weekend my quiz which was a 10 question / multiple choice / multiple answer type scenario – however the brief changed this morning –

It turns out that Question 1 for example:

Q How do you make tea
A) Water
B) Teabag
C) Cup
D) Fish Tank

The client would like it that while A B C are the correct answers, there are other correct answers for example: –

A - Is correct + 1 to score
B - Is correct + 1 to score
C - Is Correct + 1 to score
A & B - Is correct  + 1 to score
A & C - Is correct + 1 to score
B & A - Is correct + 1 to score
B & C - Is correct + 1 to score
A & B & C - Is the Jackpot! + 1 to score

Before this ‘amendment’ I had stored the results into the Database for Question as A,B,C – so everything was working – so I believe I have to ‘explode’ the original array so they are individual array elements (I was assuming it would be easier to do it this way) – So my array now looks like this:

    Array ( [0] => A [1] => B [2] => C ) 

I tried to do a if nested if statement:

    if($vex['0'] == 'A')
    {
    echo "Yup, it equals A";
    if($vex['1'] == 'B')
    {
    echo "Yup, it equals B";
    } 

But I realised that the array might not always start with [0] => A etc.

Could help me and point me in the right direction?

Would it simpler for me to store the checkboxes as single values rather than an array and just do a check?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T09:23:08+00:00Added an answer on June 18, 2026 at 9:23 am

    Use arrays and intersect them to score things like this:

    $user_choices = array('A', 'C');
    $valid_choices = array('A', 'B', 'C');
    
    $common = array_intersect($user_choices, $valid_choices); // A,C
    $score = count($common); // 2
    

    And similarly:

    choices A     -> common = A     -> score = 1
    choices D     -> common =       -> score = 0
    choices A,B,C -> common = A,B,C -> score = 3
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Quick question hopefully someone can help out here. I'm trying to copy and paste
I have another beginner's question that hopefully someone can help with. I'm trying to
Slightly strange question, but hopefully someone can help. In essence, if the time was
everyone! i have a question about sessions hopefully someone can help me with. I
This issue is something which has me stumped, so hopefully someone can help. I
hopefully someone can help me with this odd problem. I have a database which
Hopefully someone can help with this, I can't find the answer anywhere! I'm currently
Hopefully someone can help out here; I am trying to write a function which
Hopefully someone can help me out. Been all over google now. I'm doing some
Hi I have a simple question using html and css... hopefully someone can help

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.