Coder Social home page Coder Social logo

Test that would allow open text about rtutor HOT 6 CLOSED

skranz avatar skranz commented on May 9, 2024
Test that would allow open text

from rtutor.

Comments (6)

skranz avatar skranz commented on May 9, 2024 1

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.

djourd1 avatar djourd1 commented on May 9, 2024 1

Sorry, I made a mistake. Just realized I forgot to close the chunk. When closing it, it works.

from rtutor.

skranz avatar skranz commented on May 9, 2024

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.

djourd1 avatar djourd1 commented on May 9, 2024

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.

skranz avatar skranz commented on May 9, 2024

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.

djourd1 avatar djourd1 commented on May 9, 2024

Thank you.

from rtutor.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.