Skip to content

HTML-Javascript Code generator to put Multiple choice questions in your website.

License

Notifications You must be signed in to change notification settings

thesophile/MCQGenerator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MCQGenerator

HTML Code generator to display interactive Multiple choice questions in your website.

Just Type the question and options, mark the correct one and enter. An Html code will be given which can be copied and pasted to your website.

Features

  • Multiple questions can be added
  • Custom text can be displayed depending on whether the answer is right or wrong
  • If the user clicks on the wrong answer, the correct answer will be immediately displayed with green.

Working

I wrote this code a few years ago when I just starting to learn Javascript. So there will be unnecessary parts in the code. But it works, so I haven't changed it.

The output is an HTML code to produce an MCQ, and the questions and options are changed according to the user input via innerHTML.

When the user clicks on the radio with the label "Option A is correct", we change the id of the option A to indicate that it is right and change the value of else to indicate that it is wrong. With the code provided to the user, the option with the "correct Id" is changed to green and the one with the "wrong Id" will be changed to red upon clicking.

Finally, the div with the Id "Correct_explanation" is shown if the selected answer is correct, and if it wrong the div with the Id "Wrong_explanation" is shown.

About

HTML-Javascript Code generator to put Multiple choice questions in your website.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published