Comments (6)
If you create shiny based problem sets that run in the browser it is a bit more complex. First, of all students should always show the problem set using the argument auto.save.code=TRUE
in their call to show.ps
. (You should always set this option anyway if students solve shiny based problem sets at home and shall submit their solution.)
You can create a chunk in which students should write their solution into an R string and make a custom test that always evaluates TRUE
. For example as here:
Write your answer text inside the quotes "" as an R String and press `Check`.
(Note that you always see afterwards the message "Great, solved correctly."
But your answer will in fact be graded after you submit your problem set.)
```{r results='hide'}
#< task_notest
"
Insert your answer here in those quotes
"
#>
""
#< test
holds.true(TRUE)
#>
When you load a submission file sub=load.submission(filename)
, you should find the student's code for every chunk in sub$cu$stud.code
. I have not fully tested whether the code is always there, but I it works robustly.
from rtutor.
Sorry, I made a mistake. Just realized I forgot to close the chunk. When closing it, it works.
from rtutor.
This is not a feature of RTutor, but there is a workaround.
Let me first write what you can do if students solve the problem set in RStudio (not in the webbrowser). You can just ask them two write their answer somewhere in the Rmd file.
You get the code of a students Rmd file as following. You can manually load a submission file that was generated with make.submission
via sub=load.submission(filename)
.
sub
is an R environment. You access the Rmd text by sub$rmd.code
. It is best if you somehow mark the place where students write their answer with a header and footer line, so that you can write a short program that extracts the answers, e.g. like
--- Answer 1
Write your answer here.
--- End Answer 1
from rtutor.
I tried the second solution. It does not throw any error, but when I launch the browser, that test does not show ... I thought it was because of the results='hide' option, but it does not appear even when that option is taken out.
We can check the code I've made at https://github.com/djourd1/RTutorLogit
from rtutor.
Yeah, that was also my mistake since I omitted the closing three backticks from the example. (It is indeed somewhat tricky to include three backticks in an example in Github, since Github often recognizes it as end or start of a code section.). I hope everything works robustly. If not, please let me know.
from rtutor.
Thank you.
from rtutor.
Related Issues (20)
- Duplicated exercise names cause errors HOT 1
- Pre-run code chunks? HOT 4
- Installation issue; HOT 6
- Running example chunk HOT 5
- Controlling the width of the quizzes HOT 2
- Window Position when clicking on "Go to next exercise..." HOT 2
- Executing invisible code HOT 4
- Deletion of columns deletes more columns than expected HOT 3
- New Options regarding rtutor.app.skel HOT 4
- "Go to next exercise" Button does not trigger generation of code chunks HOT 2
- Desired behavior of check.assign HOT 1
- Width of Quizzes HOT 2
- Cutoff for Exercisename HOT 3
- Major update Branch LeverageData (mostly regarding quizzes) HOT 4
- hints based on check.call HOT 9
- highlight boxes HOT 5
- Updates in RTutor Main Branch HOT 5
- Question regarding mark_utf8 HOT 1
- Warning: Error in : colourInput() has been moved to the 'colourpicker' package. HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rtutor.