program to create quizzes and test

You are asked to create a program that will be used to create quizzes and test users based on these quizzes.

1. Prompt a secret word and proceed if it matches a secret code.

2. Your program should have two modules: quiz creation mode and test mode. User will be prompted in the beginning to choose from these two modes. For example:

 

“Welcome to the quiz master: please enter 1 if you want to manage questions, 2 if you want to take a quiz, 3 if you want to exit”

 

If wrong number/option entered show the message and ask again.

 

3. If user chose to enter quiz creation module

a. Application then asks user 1) to add new question, 2) to delete existing question, 3) to list all available questions 4) to go to the main module selection menu.

We do not need to have edit capability, this can be done by deleting and adding it back.

b. If user wants to add a new question.

i. Prompt the following information

1. Question Code.

2. Question text.

3. Number of possible answers

a. Loop as many times as there should be answers and prompt to enter answer text

4. Correct answer

ii. IN PHASE 1 NO NEED TO SAVE THIS

iii. Once a new question entered show the “manage questions“ menu

c. If user wants to delete a question, prompt the user to enter Question Code.

i. Show the message that question is deleted

d. If user wants to list all questions then

i. Show the message “Printing questions”

ii. show “manage questions“ menu

4. If user choses to enter quiz taking module

a. Prompt to enter test taker information

i. First Name

ii. Last Name

iii. Number of questions

b. Show message “Starting quiz”

 

c. Show main menu

 

Here is the test output

 

Welcome to the quiz master.

Please enter the secret code or enter -1 to exit: Blabla

Secret word is incorrect

Please enter the secret code or enter -1 to exit: Blablabla

Secret word is correct

Please choose from the following options

1) Manage questions

2) Take a quiz

3) Exit

4

You have selected option 4, which is invalid, please select again

1) Manage questions

2) Take a quiz

3) Exit

1

You have selected option 1 – manage questions

Please choose from the following options

1) Add new question

2) Delete Existing question

3) Print all questions

4) Main menu

5

You have selected option 5, which is invalid, please select again

1) Add new question

2) Delete Existing question

3) Print all questions

4) Main menu

1

You have selected option 1 – Add new question

Please enter question code:

Question code cannot be empty

Please enter question code: Q0001

Please enter question text:

Question text cannot be empty

Please enter question text: What 1 + 1?

Please enter number of possible answers:

Number of possible answers cannot be empty

Please enter number of possible answers: 4

Please enter answer 1 to the Q0001:

Answer cannot be empty

Please enter answer 1 to the Q0001: 2

Please enter answer 2 to the Q0001: 3

Please enter answer 3 to the Q0001: 4

Please enter answer 4 to the Q0001: n/a

Please enter the number corresponding to a correct answer:

Number corresponding to a correct answer cannot be empty

Please enter the number corresponding to a correct answer: 5

You have selected 5, which is invalid number corresponding to a correct answer

Please enter the number corresponding to a correct answer: 1

Question Q0001 is saved! // just a message no need to save it anywhere

Please choose from the following options

1) Add new question

2) Delete Existing question

3) Print all questions

4) Main menu

1

You have selected option 1 – Add new question

Please enter question code: Q0002

Please enter question text: What 1 + 2?

Please enter number of possible answers: 4

Please enter answer 1 to the Q0002: 2

Please enter answer 2 to the Q0002: 3

Please enter answer 3 to the Q0002: 4

Please enter answer 4 to the Q0002: 5

Please enter the number corresponding to a correct answer: 2

Question Q0002 is saved!

Please choose from the following options

1) Add new question

2) Delete Existing question

3) Print all questions

4) Main menu

2

You have selected option 2 – Delete Existing question

Please enter the code for the question you want to delete:

The code for the question you want to delete cannot be empty

Please enter the code for the question you want to delete: Q0003

Question Q0003 is deleted! // nothing needs to be deleted just a message at this moment

Please choose from the following options

1) Add new question

2) Delete Existing question

3) Print all questions

4) Main menu

You have selected option 3 – Print all questions

 

// no need to print anything yet

Please choose from the following options

1) Add new question

2) Delete Existing question

3) Print all questions

4) Main menu

You have selected option 4 – Main menu

 

Please choose from the following options

1) Manage questions

2) Take a quiz

3) Exit

2

You have selected option 2 – Take a quiz

Please enter your first name:

First name should not be empty

Please enter your first name:Faig

Please enter your last name:

Last name should not be empty

Please enter your last name:Garayev

Please enter number of questions:

Number of questions should not be empty

Please enter number of questions: 2

 

Starting quiz

// no need to do anything here yet

Quiz is now complete.

Here are the results

Faig Garayev

// no need to do anything here yet

 

Please choose from the following options

1) Manage questions

2) Take a quiz

3) Exit

3

Bye!!!

CustomEssayMasters

Ready To Get Started

The Exertio is a Premium WordPress Theme, you can create your own market place website using this theme. It allows you to get a commission for hiring a freelancer or for each service sold.