Function upload2opal() takes full prepared zip archive of QTI-test or
QTI-task and uploads it to the OPAL.
Usage
upload2opal(
test,
display_name = NULL,
access = 4,
overwrite = TRUE,
endpoint = NULL,
open_in_browser = TRUE,
as_survey = FALSE,
api_user = NULL,
credential_id = NULL,
task_names = NULL,
qti_version = NULL
)Arguments
- test
A length one character vector of AssessmentTest, AssessmentTestOpal or AssessmentItem objects, Rmd/md or XML files; required.
- display_name
A length-one character vector naming the resource in OPAL. The default is the exported title under the selected naming policy.
- access
An integer value, optional; it controls publication status, where 1 - only those responsible for this learning resource; 2 - responsible and other authors; 3 - all registered users; 4 - registered users and guests. Default is 4.
- overwrite
A boolean value; if
TRUEand exactly one file with the specified display name is found, it will be overwritten. Default isTRUE.- endpoint
A string containing the OPAL LMS endpoint; by default, it is read from environment variable
RQTI_API_ENDPOINT. To set a global environment variable, you need to callSys.setenv(RQTI_API_ENDPOINT='xxxxxxxxxxxxxxx')or put this command into .Renviron.- open_in_browser
A boolean value, optional; controls whether to open a URL in the default browser. Default is
TRUE.- as_survey
A boolean value, optional; controls the resource type (test or survey). Default is
FALSE.- api_user
A character value of the username in the OPAL.
- credential_id
An optional name for the credential set. If omitted, the credential service is derived from
endpoint, with the legacyrqtiopalservice retained as a fallback.RQTI_API_CREDENTIAL_IDoverrides the automatic name when set.- task_names
Display naming policy:
"title","filename","both", or"hidden".NULLuses optionrqti.task_names, falling back to"title". See task_names.- qti_version
QTI version of the export:
"2.1"or"2.2".NULLuses optionrqti.qti_version, falling back to"2.1".
Examples
if (FALSE) { # interactive()
file <- system.file(
"rmarkdown/templates/singlechoice-simple/skeleton/skeleton.Rmd",
package='rqti'
)
upload2opal(file, "task 1", open_in_browser = FALSE)
}