v1

latestSwagger 2.02026-07-173912.8 KB
srvr

evaluate exercise srvr

Evaluate an exercise in a given session

post/learnr/{session_id}

Path parameters

session_idstring required

The ID of session obtained during session initiation

Request body

checkstring

TODO

chunksstring

List of setup knitr code chunks for the exercise when using the exercise.setup option.

codestring required

The R code to execute

code_checkstring

TODO

enginestring

The knitr engine of the exercise.

global_setupstring

Setup code from the setup-global-exercise or setup chunk that should be run before every exercise

labelstring

Label of the exercise.

optionsstring required

The exercise options

restoreboolean

TODO

setupstring

Setup code associated with this specific exercise

solutionstring

Unused, the solution code for this exercise

versionstring

Version of the exercise structure.

Example request

{
  "check": "Est dignissimos suscipit quis voluptate quo.",
  "chunks": "Ab qui consectetur.",
  "code": "rnorm(5)",
  "code_check": "Officia quis praesentium voluptatem.",
  "engine": "Aperiam necessitatibus aut dolorem deleniti quis.",
  "global_setup": "library(ggplot2)",
  "label": "Non in id laboriosam nam.",
  "options": "Esse quas unde voluptas sed.",
  "restore": true,
  "setup": "dataset <- iris",
  "solution": "rnorm(1)",
  "version": "Distinctio et officia."
}

Response

The server was able to fulfill the request. This does not imply that the provided R code didn't produce an error -- just that we were able to run it through to completion.

error_messagestring required

If an error occurred, the plain-text representation

html_outputstring required

The output of the given command

timeout_exceededboolean required

True if the time limit was exceeded; otherwise false

Example response

{
  "error_message": "object 'x' not found",
  "feedback": {
    "correct": true,
    "location": "Dolorem quidem sapiente esse consequatur blanditiis.",
    "message": "Laudantium similique.",
    "type": "In officiis consequatur omnis repellendus dolorum."
  },
  "html_output": "\n\n\n<pre><code>[1] -0.78207928  0.70263075 -0.08438296 -0.06020523  1.97638361</code></pre>\n",
  "timeout_exceeded": false
}