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 8191341
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T03:53:50+00:00 2026-06-07T03:53:50+00:00

I am doing an assignment involving the creation of a simple Quiz type form

  • 0

I am doing an assignment involving the creation of a simple Quiz type form application. However, whenever I run the program, only the first answer shows for a multiple question and I cannot for the life of me figure out why.

This is the contstructor:

MultipleChoice dlg =
    new MultipleChoice(
        new Question("What is the capital of Zimbabwe?",
            new Answer("Paris", false),
            new Answer("Washington D.C.", false),
            new Answer("Harare", true),
            new Answer("Cairo", false),
            new Answer("N'Djamena", false)));
if (dlg.ShowDialog() == DialogResult.OK)
{
   if (dlg.Correct) MessageBox.Show("You got something right!");
   else MessageBox.Show("You couldn't be more wrong");
}

And this is the Question Form Code:

private Question Q;
public MultipleChoice (Question q)
{
    Q = q;
    InitializeComponent();
    textPrompt.Text = Q.Prompt;
    if (Q.A != null)
    {
        radioA.Text = Q.A.Prompt;
    }
    else radioA.Hide();
    if (Q.B != null)
    {
        radioB.Text = Q.B.Prompt;
    }
    radioB.Hide();
    if (Q.C != null)
    {
        radioC.Text = Q.C.Prompt;
    }
    radioC.Hide();
    if (Q.D != null)
    {
        radioD.Text = Q.D.Prompt;
    }
    radioD.Hide();
    if (Q.E != null)
    {
        radioE.Text = Q.E.Prompt;
    }
    radioE.Hide();
}
public bool Correct
{
    get
    {
        if (Q == null) return false;
        if (Q.A != null && Q.A.Correct && radioA.Checked) return true;
        if (Q.B != null && Q.B.Correct && radioB.Checked) return true;
        if (Q.C != null && Q.C.Correct && radioC.Checked) return true;
        if (Q.D != null && Q.D.Correct && radioD.Checked) return true;
        if (Q.E != null && Q.E.Correct && radioE.Checked) return true;
        return false;
    }
}

Where have I gone wrong?

  • 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-07T03:53:51+00:00Added an answer on June 7, 2026 at 3:53 am

    There is no else for any option after A:

    if (Q.B != null) 
    { 
        radioB.Text = Q.B.Prompt; 
    } 
    radioB.Hide();  //This is **always** going to be called - hiding radioB :)
    

    Should be:

    if (Q.B != null) 
        radioB.Text = Q.B.Prompt; 
    else
        radioB.Hide(); 
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm doing a homework assignment for my course in C (first programming course). Part
I am doing an assignment with pyGame, a very simple one, we have to
I'm studying via Head First's Servlets and JSPs, and doing the assignment on the
I am doing an assignment, which require to develop a simple text editor using
I am doing this assignment, make a program that solves sudoku. I have a
I am doing a homework assignment that reads in a book. First, a line
I'm doing an assignment learning embedded SQL in C. The first five queries work
I am doing a homework assignment that involves writing a program to draw shapes
I'm doing an assignment for Uni and in my VB.NET form I have some
I am doing an assignment for an information systems class and the professor decided

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.