Windows Form Application
Well, I have this project for school and Im working with my teacher to make a Nomenclature Test in C++
Well, I have two forms
Form1.h : Will ask for name of the student and display a "Start Test" button
Form2.h : Will display the question in a label, a textbox for the answer, and a button for the next question
This is the code:
Does anyone know how I can do this but in a simpler manner? Im asking because there going to be 50 questions in each test version and there are going to be 5 versions in the program.
Well, I have two forms
Form1.h : Will ask for name of the student and display a "Start Test" button
Form2.h : Will display the question in a label, a textbox for the answer, and a button for the next question
This is the code:
Code:
Form2::"replace with name of label for question"->Text = "Question 1: NaCl";
{
////////////////////Question 1////////////////////
if (Form2::Answer->Text == "sodium")
{
MessageBox::Show("Correct","Correct");
Form2::grade->Text = "Grade: 10 points";
Form2::Stuff->Text = "Question 2";
}
else
{
////////////////////Try 1////////////////////
MessageBox::Show("Incorrect","Incorrect");
Form2::Stuff->Text = "Question 1: NaCl";
if (Form2::Answer->Text == "sodium")
{
MessageBox::Show("Correct","Correct");
Form2::grade->Text = "Grade: 10 points";
Form2::Stuff->Text = "Question 2";
}
else
{
////////////////////Try 2////////////////////
MessageBox::Show("Incorrect","Incorrect");
Form2::Stuff->Text = "Question 1: NaCl";
if (Form2::Answer->Text == "sodium")
{
MessageBox::Show("Correct","Correct");
Form2::grade->Text = "Grade: 10 points";
Form2::Stuff->Text = "Question 2";
}
else
{
Form2::Stuff->Text = "Question 1: NaCl";
}
}
}
}