7.1 Quick-Start: Assessments using R (and Shiny)
To follow this quick-start tutorial, download and install R and, for instance, R-Studio.75 After this installation open R and install the packages: shiny, remotes, knitr and ShinyItemBuilder:
install.packages("shiny")
install.packages("remotes")
install.packages("knitr")
remotes::install_github("kroehne/ShinyItemBuilder", build_vignettes = TRUE)When both packages are installed, the CBA ItemBuilder projects are required. The project files are expected in the folder provided as argument to the function call getPool(). Additional arguments are possible to define the order if tasks within the item pool (by default, all files and tasks are included, ordered by name).
In the following example, we use the function getDemoPool("demo01")to illustrate the use of the package with example items:
# app.R
library(shiny)
library(ShinyItemBuilder)
# demo items
item_pool <- getDemoPool("demo01")
# your items would be loaded via
# item_pool <- getPool(path="PATH-TO-YOUR-IB-PROJECTS")
assessment_config <- getConfig()
shinyApp(assessmentOutput(pool = item_pool,
config = assessment_config,
overwrite=T),
renderAssessment)
The assessment is started by executing the complete file app.R.
The items can be answered in a browser using the URL either started automatically or displayed by R / Shiny (e.g., http://127.0.0.1:PORT)76. More configurations are possible (see section 7.3). If you have an account for shinyapps.io, the assessment can be published directly from RStudio and used for data collections online (see section 7.3 for details).77
Alternatively, Visual Studio Code could be used.↩︎
PORT is the port assigned by shiny and shown in the R console window as follows:
Listening on http://127.0.0.1:4723. In this example, 4723 is the PORT.↩︎Note: The number of parallel test takers that can use the online assessment simultaneously depends on the hosting of the Shiny application.↩︎