rr-exams

`exams2forms()` in quarto reveal.js


I love engaging students into active retrieval practice using the {exams} and {exams2forms} packages. Embedding webquizzes into quarto html works seamlessly using e.g.

---
format: 
  html:
    embed-resources: true
    css: webex.css
    include-after-body: webex.js
---

# Task
```{r}
#| label: quiz2
#| echo: false
#| message: false
#| results: "asis"
#| warning: false

library("exams2forms")
exm <- list(c("swisscapital.Rmd"))
exams2forms(exm, n = 3)
```

with the webex.css and webex.js files provided here. However, if I change the format from html: to revealjs: the reveals .js seems to interfere with the webex.js and I don't know how to avoid this.


Solution

  • Just had about 1h today, trying to adjust our package to work with revealjs. I have updated webex.css and wrote a demo quarto document.

    Version

    I am using the latest development version of our package, if you try it yourself:

    Demo file (qmd) and rendered output

    I have uploaded the .qmd I am using as a gist on GitHub:

    Rendered via quarto render devslides.qmd (Quarto 1.5.55, R 4.4.2, Ubuntu 24.04.2 LTS) this is what I get:

    I've tested it locally with Chromium, Firefox, and Brave and everything seems to work fine. Except the word "Solution." on the last slide.

    Look and feel

    This is just a quick fix (proof of concept); we will need to adjust a few things to make it fit the revealjs format (tbd).