Banner image
Content / help / exercise .. concise-view << previous next >>

Course Exercise Example

Multiple Choice HTML markup syntax

The new multiple choice questions can be inserted into any page using the PHP function calls below. See the bottom of this page for the rendered result of the sample exercise.
The following HTML produces a multiple choice exercise. This HTML is produced by PHP functions so that any future developments will take effect across all old content.
Note: Gap fill exercises and multiple choice exercise, submit back to the same page so that the DB updates are handled within the same page's PHP code.

Multiple Choice HTML produced by PHP functions

Use these PHP functions to generate multiple choice questions.
The form start and end should also work if they contain a mixture of question types. Eg: The same form can contain a mixture of gap fills and multiple choice questions
  1. Start the MC question or questions
    This code

    Produces this HTML - QUESTION FORM START
    File contents not found for source code display
    Full path to code was ""
  2. Insert a multiple choice question
    This function requires an array defining the multiple choice question.
    This array data can also be stored on the questions database.

    Example Multiple Choice Question array

    This code
    questionMultiple Choice Which one of these living creatures is a mammal?

    <p><b>Multiple Choice </b> Which one of these living creatures is a mammal?</p>
    <ol class="alpha">
    <input type="radio" name="which-is-mammal"  value="a"/>crocodile
    <input type="radio" name="which-is-mammal"  value="b"/>ant
    <input type="radio" name="which-is-mammal"  value="c"/>whale
    <input type="radio" name="which-is-mammal"  value="d"/>penguin
  3. Insert a gap fill question into the page.
    Gap fill questions will be given a default sequence number, but you may sequence the gapfill question yourself so that when the sequence is broken by inserting more questions, the submitted results still remain without a broken sequence.
  4. End the question set render->mcEnd();
    This code

    Produces this HTML - END OF QUESTION FORM
    <input type="hidden"  name="gapfill-qcount" id="gapfill-qcount" value="0" >
    <button type="submit" class="xsubmit-ready"> Submit </button>
    <h3> Your Score -   </h3> <div class="giant green">0 / 0</div><br>
    <ul class="nav nav-pills">
    <li> <a class="big fat orange"  href="/courses/recent-pages" target="_blank" >  Grade Report at the bottom of your work </a></ul></nav>

Here's the Actual Rendered HTML Exercise Form

Multiple Choice Which one of these living creatures is a mammal?

  1. crocodile
  2. ant
  3. whale
  4. penguin
What day of the week follows Tuesday? ____________

Your Score -

0 / 0

Rendered code end above
Website by Ibiscuits