Exercises

Author
Affiliation

Peninsula Collaboration for Health Operational Research and Data Science (PenCHORD), University of Exeter Medical School

This page demonstrates the functionality available in pywebexercises:

First, you need to have followed the set-up instructions in the “Setup” page.

Then, import the exercise functions we are going to use…

# pylint: disable=missing-module-docstring
from pywebexercises.exercises import mcq, longmcq, torf


Important: When using these functions, set #| echo: false to prevent the code from showing in your document.


MCQ

The mcq() function will produce a drop-down box.

How many legs does a spider have?

This was generated by running:

mcq({
    '1': 0,
    '3': 0,
    '8': 1,
    '200': 0
})


LongMCQ

The longmcq() function will produce radio buttons.

How many legs does a spider have?

This was generated by running:

longmcq({
    '1': 0,
    '3': 0,
    '8': 1,
    '200': 0
})


True or false

The torf() function can be used to create a drop-down with options of True or False.

We live on the planet Mars.

That was generated by running:

torf(False)


Checked sections

These are created by making a webex-check section, which will add a button that will only display feedback when pressed.

You can also include .webex-box to draw a box around the section.

:::{.webex-check .webex-box}

# Question/s here

:::

For example…


Using webex-check and webex-box

What is a baby dog called?

What is a baby sheep called?


Just using webex-check

What is a baby dog called?

What is a baby sheep called?


Just using webex-box

What is a baby dog called?