Quizzes in bookdown

Hi everyone

I am creating a "textbook" using R Markdown. What a fantastic resource!

It works really well (so far!), but I have two questions (I will post one here, and one in a new thread).

My first question: I would really like to be able to do is include interactive quizzes like that used in package learnr. I don't mind if it is learnr or not... but learnr look fantastic: multiple choice, multiple options, feedback, timing, etc.

I can happily create a learnr tutorial. But I would like that functionality in my bookdown document.

I have tried loading the learnr package, and including quizzes, but I cannot get anything to work: The quizzes never show, and including the required runtime: shiny_prerendered in the YAML header makes the whole bookdown document rendered incorrectly (and still no quizzes anyway).

So: Is it possible to include quizzes in a bookdown document (using `learnr1 or otherwise)? If so, how? It's all new to me, so details would be appreciated. Searches haven't helped me. Maybe it is just not possible.

(Of course,I am mainly thinking or HTML output.)

Thanks for help.

BSP

1 Like

Hi,

Bookdown and LearnR do not have the same goal. Read the dedicated section in the online rmarkdown book,

It is possible to do a lot of bookdown stuff in learnR. Out of memory, doing references is not possible in learnR.

Regards,

jm

Thanks jm. I understand that bookdown and learnr don't have the same goal, and I'm not attached to learnr, but it has some of the functionality I was seeking.

I was just seeking quiz functionality, using learnr or otherwise.

However, since learnr has that functionality, I thought perhaps it was possible that the required functionality could be used, or the tricks adopted, or code extracted, for wider use in bookdown docs.

Just out of interest, is it feasible to include quizzes in a bookdown document? Or is there a technical reason why that won't work?

For the record, I can add quiz functionality by embedding a quiz created in Google Forms, or MS Forms, or even H5P (though it seems H5P.org is moving to H5P.com...). So while they work, with compromises, it would be far better to have a R solution.

Thanks. BSP.

Hello,

My understanding is that bookdown has no server side r session attached when browsed. The R is there to compile and produce a static html / PDF. On the other hand, learnR is a shiny app with server side r session attached for all interactive part.

What is possible to do in bookdown is to embed a shiny app. It means that quizzes would come from an external app but appear within an iframe in bookdown html rendering.

This is my understanding based on my own exploration, I guess others are more literate than me on this topic.

Regards,

jm

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.