Course Exercise Example

Example Question types for Exercises
  1. Gap fills
  2. Multiple Choice
  3. Link submission - (For essay assignments)
The questions can be inserted into any page using the following PHP function calls below. See the bottom of this page for the rendered result of the sample exercise.
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

Pages with questions to attempt will post the submitted attempts back to the same page, which detects posted answers.

  1. Start the MC question or questions
    This code
     $render->MCstart(); 

    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?
    options
    0crocodile
    1ant
    2whale
    3penguin
    namewhich-is-mammal
    correctwhale
     $render->MCquestion($mcq.); 

    Produces this HTML - ONE MULTIPLE CHOICE QUESTION
    <p><b>Multiple Choice </b> Which one of these living creatures is a mammal?</p>
    <ol class="alpha">
    <li>
    <input type="radio" name="which-is-mammal"  value="a"/>crocodile
    <li>
    <input type="radio" name="which-is-mammal"  value="b"/>ant
    <li>
    <input type="radio" name="which-is-mammal"  value="c"/>whale
    <li>
    <input type="radio" name="which-is-mammal"  value="d"/>penguin
    </ol>
  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.