Skip to contents

Why

Small quizes in lectures can help gauge how well the students have understood the material.

Commercial services exist, for example Mentimeter. Mentimeter is focused on asking single questions rather than a batch of questions, so isn’t ideal for making a quiz.

classquiz is designed to use google forms to ask questions, google sheets to store the responses, observable to download the results from google sheets, process and plot them in lecture slides which have been rendered with quarto. Other services for hosting the forms and results could be used instead.

Preparation

  1. Make and publish google form. The following types of question are supported.
  • multiple-choice grid (one per form)
  • multiple-choice (several questions per form if they have the same set of answers) Only one type of question is allowed per form.
  1. Have google form save results in google sheets.
  2. Share read access to google sheet with anyone who has link.
  3. Remember to delete old responses from the google sheet before class (There must be at least one, possibly blank row or ojs is upset).

Add questions to quarto document

  1. Add question form to quarto with cq_add_form(). This function displays the URL provided in an iframe.
```{r}
cq_add_form(
  form_url = "https://docs.google.com/forms/d/e/1FAIpQLSeLIUnzdTfBUqjr_X0MvF7JBDQgy_mndeZVsjgW4JR3tFRHSw/viewform?usp=sharing&ouid=107915462972182704713"
)
```

Add plot of results to quarto document

  1. Add the results of the quiz to quarto with cq_add_results(). This function makes a set of observable code chunks that download the data, process it and plot it. You need to use the type argument to give the type of question. Only “multiple_choice_grid” is currently properly supported. You must use the #| output: asis code block option so that the generated observable chunks are correctly interpreted.
```{r}
#| output: asis
cq_add_results(
  sheet_url = "https://docs.google.com/spreadsheets/d/1v3jF5jzbd4bpsmf1x-cZpX1NmL4FAsR0tGIh-a5I_RU/edit?resourcekey=&gid=24040024#gid=24040024", 
  type = "multiple_choice_grid"
)
```

Customise appearance of the plots

  1. You can customise the appearance of the plots. The height can be changed with the height argument. Unless the question text is very short, you will need to increase the leftMargin. domain gives the possible responses, and range specifies the colours to be used.
```{r}
#| output: asis

cq_add_results(
  sheet_url = "https://docs.google.com/spreadsheets/d/1v3jF5jzbd4bpsmf1x-cZpX1NmL4FAsR0tGIh-a5I_RU/edit?resourcekey=&gid=24040024#gid=24040024", 
  type = "multiple_choice_grid", 
  height = 500, 
  marginLeft = 170,
  domain = c("Yes", "No"),
  range = c("green", "orange")
)
```