In the learnr tutorial, the exercise block allows you to view the solution and then click "copy to clipboard". For some reason, when the user selects "copy to clipboard" and then pastes it in the exercise block, an error is introduced. I want to just remove the "copy to clipboard" button option, so the user can manually copy it. Is that possible?
Asked
Active
Viewed 55 times
1
-
Not exactly what you want but I think it can bring you some ideas: https://community.rstudio.com/t/learnr-clipboard-extension/107812 – Eilia Jul 15 '22 at 06:57
-
what error is produced? – r2evans Jul 15 '22 at 13:07
-
@r2evans: it copies fine, but when you paste in the exercise window and run, the error is "unexpected input" – FG120 Jul 15 '22 at 14:01
-
Which version of learnr are you using? Is the tutorial hosted or viewed locally and what version of R is used to serve the tutorial? When this error occurs, which browser and operating system are being used? These would all be helpful to trace the cause of the bug and if you’d like to open an issue, we’ll take a look. https://github.com/rstudio/learnr/issues – grrrck Jul 16 '22 at 01:10
1 Answers
0
No, at this time it’s not possible to disable the Copy to Clipboard button in learnr.
You could use CSS to hide the button, however, with a rule like this:
.btn-tutorial-copy-solution {
display: none;
}

grrrck
- 1,066
- 6
- 7