3

I am developing tutorials with the learnr package. During the iterative testing process, I would need to invalidate the tutorial file.

I followed the explanation from Preserving Work, added ID and version to the yaml header.

But whenever I changed ID and/or the version number, I always got my last exercise trial.

When you change the ID or version of a tutorial all stored work associated with the tutorial is invalidated and users of the tutorial will start fresh when accessing it again. (from Preserving Work)

The above quote did not work for me: Even if I restarted RStudio and/or used Clear Rendered Output … resp. Clear Knitr Cache …. But I did succeed in changing the label of the chunk header(s) and I know I could use the "Start Over" button at the tutorial page.

Could it be that ID and version do not work locally? (BTW: Where are the files with the stored work associated with the tutorial on my computer?)

My yaml header looks like:

---
title: "Tutorial"
tutorial:
  id: "b4e9e9b1-02b1-45c7-b35e-64ff6fbf0a0e"
  version: 2.9
output: 
    learnr::tutorial:
        progressive: true
        allow_skip: true
runtime: shiny_prerendered
---

I am using the uuid package to generate IDs - as mentioned in the learnr tutorial under Tutorial Identifiers.

I start a new trial always with the command rmarkdown::run("<path-to-filename/filname>").


This question should tagged with learnr, but I do not have the privileges to create a new tag.

Dataman
  • 3,457
  • 3
  • 19
  • 31
petzi
  • 1,430
  • 1
  • 17
  • 32

2 Answers2

1

@jjallaire answered my question on Github:

Locally stored work doesn't use the ID unfortunately. Local tutorial storage can be found at:

file.path(rappdirs::user_data_dir(), "R", "learnr", "tutorial", "storage")

petzi
  • 1,430
  • 1
  • 17
  • 32
0

This does not answer the exact question, but if one wants to start fresh after each change to the tutorial (to see the new changes in the tutorial), one way would be to add a file called restart.txt in the directory where the tutorial's .Rmd file is and after each change to the tutorial before loading the tutorial, one needs to run touch restart.txt to update restart.txt's the modification time. This tells the shiny server to start fresh.

Dataman
  • 3,457
  • 3
  • 19
  • 31