Interface for generating interactive sessions in the JSON format of the audience response system ARSnova.
exams2arsnova(file, n = 1L, dir = ".",
name = "R/exams", sname = NULL, qname = NULL,
quiet = TRUE, resolution = 100, width = 4, height = 4, svg = FALSE, encoding = "",
url = "https://arsnova.eu/api", sessionkey = NULL, jsessionid = NULL,
active = TRUE, votingdisabled = FALSE, showstatistic = FALSE, showanswer = FALSE,
abstention = TRUE, variant = "lecture", ssl.verifypeer = TRUE,
fix_choice = FALSE, …)make_exams_write_arsnova(url = "https://arsnova.eu/api", sessionkey = NULL,
jsessionid = NULL, name = "R/exams", sname = NULL, qname = NULL,
active = TRUE, votingdisabled = FALSE, showstatistic = FALSE, showanswer = FALSE,
abstention = TRUE, variant = "lecture", ssl.verifypeer = TRUE, fix_choice = FALSE)
character. A specification of a (list of) exercise files.
integer. The number of copies to be compiled from file
.
character. The default is either display on the screen or the current working directory.
character. A name prefix for resulting exercises and RDS file.
character. A vector of length 2 with the session name (maximum of 50
characters) and its abbreviation (maximum of 8 characters). Ignored if the sessionkey
of an existing session is supplied and otherwise copied by default from name
.
character. A vector of names for each question/exercise in file
.
By default, the name
is used.
numeric, passed to xweave
.
logical. Should graphics be rendered in SVG or PNG (default)?
character, passed to xweave
.
character specifying (1) the base URL of the ARSnova API, (2) the 8-digit ARSnova session key, (3) the JSESSIONID cookie of an active ARSnova session. If all are provided all questions are imported directly into the existing ARSnova session. Otherwise, a JSON import file is generated.
logical. Should the question be active (i.e., released for students) or locked?
logical. Should voting be disabled?
logical. Should statistics be shown?
logical. Should answers be shown?
logical. Are abstentions allowed?
character. Should the question be a "lecture"
or
a "preparation"
questions?
logical. Should SSL certificates be validated when connecting via https?
logical. Should math markup be removed in single and multiple choice lists? (This is may be needed for older ARSnova versions where math markup is rendered in the question itself but not the choice list.)
arguments passed on to xexams
.
A list of exams as generated by xexams
is
returned invisibly.
exams2arsnova
generates exams in the JSON format for ARSnova
using xexams
. It proceeds by (1) calling xweave
on each exercise, (2) reading the resulting LaTeX code, (3) transforming
the LaTeX code to Markdown, and (4) embedding the Markdown code into the
JSON format for ARSnova (and optionally imports it into a running
ARSnova session).
For steps (1) and (2) the standard drivers in xexams
are used.
For step (3) a suitable transformation function is set up on the fly
using make_exercise_transform_pandoc
.
For step (4) a simple writer function is set up on the fly that
embeds the transformed Markdown code into a hard-coded JSON template
using toJSON
and either writes a single JSON
file for each exam or imports these directly into an ARSnova session.
When url
, sessionkey
, and jsessionid
are all supplied,
curlPerform
is used to import tall questions directly into
the existing ARSnova session. Otherwise, a file is written to the disk and
then needs to be imported manually into an ARSnova server. This file
is either a JSON file for a whole new session (if sessionkey
is
NULL
, the default) or a CSV file with the questions only.
# NOT RUN {
## load package and enforce par(ask = FALSE)
library("exams")
options(device.ask.default = FALSE)
# }
# NOT RUN {
## exams2arsnova can either create text files with JSON data
exams2arsnova("tstat2")
## or directly post this to an active ARSnova session (for which the
## server URL, the 8-digit session key, and the JSESSIONID cookie are needed)
exams2arsnova("tstat2", url = "https://arsnova.eu/api",
sessionkey = "49061284", jsessionid = "A5BEFDA4141816BB425F2204A602E4B3")
# }
Run the code above in your browser using DataLab