Assuming the quiz is a simple question/answer style quiz, use a map to associate question strings with answer strings. In order to prevent people from simply examining the program resources to get the answers, you should also consider encrypting the map.
For multiple choice quizzes, use a structure containing the question string, a vector of strings for the possible answers and an unsigned integer to identify the correct answer (as an index into the vector).
#include
#include
#include
#include
struct multi_choice
{
std::string question;
std::vector< std::string> choices;
unsigned answer;
multi_choice (
std::string q,
std::string c1,
std::string c2,
std::string c3,
std::string c4,
unsigned a);
const std::string& get_answer () const { return choices[answer-1]; }
};
// default constructor
multi_choice::multi_choice (
std::string q,
std::string c1,
std::string c2,
std::string c3,
std::string c4,
unsigned a)
: question (q), choices(), answer (a)
{
choices.push_back (c1);
choices.push_back (c2);
choices.push_back (c3);
choices.push_back (c4);
}
std::ostream& operator<< (std::ostream& os, const multi_choice& q)
{
os << q.question << '\n' << std::endl;
for (unsigned c=0; c<4; ++c)
os << c+1 << ") " << q.choices[c] << std::endl;
return os;
}
unsigned input_answer ()
{
unsigned num = 0;
while (1)
{
std::cout << "Your answer: ";
std::string input = "";
std::getline (std::cin, input);
std::stringstream ss (input);
if (ss >> num && num >= 1 && num <= 4)
break;
std::cout << "Invalid input.\n";
}
return (num);
}
int main()
{
std::vector
questions.push_back ( multi_choice (
"In which direction does the sun rise in the morning?",
"East", "West", "North", "South", 1));
questions.push_back ( multi_choice (
"How long does a fortnight last?",
"A day", "A week", "Two weeks", "A month", 3));
// add other questions here....
unsigned points = 0;
for (unsigned q=0; q { std::cout << "Question " << q+1 << '\n' << std::endl; std::cout << questions[q] << std::endl; if (input_answer() == questions[q].answer) { std::cout << "Correct!" << std::endl; ++points; } else { std::cout << "Wrong!\nThe correct answer is "; std::cout << questions[q].answer << ", "; std::cout << questions[q].get_answer(); std::cout << std::endl; } std::cout << std::endl; } std::cout << "Quiz completed!\n" << std::endl; std::cout << "You scored " << points; std::cout << (points>1?" points!\n":" point!\n") << std::endl; } Example Output Question 1 In which direction does the sun rise in the morning? 1) East 2) West 3) North 4) South Your answer: 1 Correct! Question 2 How long does a fortnight last? 1) A day 2) A week 3) Two weeks 4) A month Your answer: 2 Wrong! The correct answer is 3, Two weeks Quiz completed! You scored 1 point!
there could be many ways to make a quiz in vb before you do anything you have to become advanced at buttons like literally advancedRECEMy own Edit:you could useForm.showalso you could useform.hide
quibblo.com quizrocket.com they are both fun
2gb good luck on your quiz lol
Yes, although the script is rather long. Try the quiz in the related links section, which looks quite good. It uses AJAX (Asynchronous Javascript And XML) and PHP.Quizzes with AJAX look impressive because the page doesn't have to reload. The content changes dynamically.
Your final grade would depend on how the teacher grades. For example, how many points is the quiz? How many points are possible for the semester? What are the weights for homework, quizzes, essays, and projects? The information you provide is not sufficient enough to answer the question. Your best bet would be to ask the teacher him/herself.
Sir Derek O'Brien is the quiz host of the CADBUARY BOURNVITA QUIZ CONTEST .And he is also the quiz master of the Asia.
Quiz Master
Quiz Master
Quiz Master
_a_o
Jeremy paxman
Inspector Gadget - 1983 Quiz Master 1-65 was released on: USA: 9 December 1983
The word "master" can be added as a suffix to those words. Other words that create one-word forms, sometimes with idiomatic meanings, are load(master), scout(master), ring(master), and post(master).
Inspector Gadget - 1983 Quiz Master 1-65 is rated/received certificates of: Australia:G USA:TV-Y
The quiz is easy to make with quiz maker software and 12 free online quiz makers. You can have a try through the folloing related links.
Make sure you have the quiz module on your bebo page On your profile scroll down to the quiz module Click "Create Quiz"
The most important part is to just try to make the quiz really hard!