Concerto R package

general concept

Since Concerto v4 has a code auto-complete function and an R function documentation (available for any R package installed on your system) available for users writing code, we decided to include Concerto built-in functions also as an R package.


Concerto session variables list

This list consist of chosen Concerto session internal variables. The list should NOT be modified by test logic. However there are some variables which can prove helpful for user and can be read.

Please keep in mind that when the Concerto session is initialized, your working directory is set to your workspace private directory. You can check what is the full path to directory by typing:

getwd()


concerto.qti.get

Retrieves specific QTI object info.

arguments

returns

List with QTI object properties:

example

qti <- concerto.qti.get(1)

qti <- concerto.qti.get("second_qti")


concerto.qti.initialize

Initializes QTI object.

arguments

returns

Named list with QTI session state and:

example

ini <- concerto.qti.initialize(1)

ini <- concerto.qti.initialize("first_qti")


concerto.qti.responseProcessing

QTI response processing.

arguments

return

Named list with elements declared in QTI XML.

example

qti_init <- concerto.qti.initialize(1)

response <- concerto.template.show(1, params = list(qti = qti_init$QTI_HTML))

qti_proc <- concerto.qti.responseProcessing(1, qti_init, response)


concerto.table.fillSQL

Fills SQL code with given parameters.

arguments

return

SQL code with inserted parameters.

example

id <- 123

sql <- "SELECT * FROM `db`.`table` WHERE `id`={{id_value}}"

sql <- concerto.table.fillSQL(sql, list(id_value = id))


concerto.table.get

Retrieves specific table object info.

arguments

returns

List with table object properties:

example

table <- concerto.table.get(1)

table <- concerto.table.get("second_table")


concerto.table.query

Perform query on Concerto database.

arguments

return

Returns result set.

example

sql <- "SELECT * FROM `itam_bank`"

items <- concerto.table.query(sql)


concerto.template.fillHTML

Fills HTML code with given parameters.

arguments

return

HTML code with inserted parameters.

example

index <- 12

html <- "<input type='text' name='inp{{index}}' />"

html <- concerto.template.fillHTML(html , list(index = index))


concerto.template.get

Retrieves specific template object info.

arguments

returns

List with template object properties:

example

template <- concerto.template.get(1)

template <- concerto.template.get("second_template")


concerto.template.loader

Sets a template that will be shown when the proper templates are loaded.

arguments

example

response1 <- concerto.template.loader(1)

response2 <- concerto.template.loader(HTML="<div align="center">loading ... please wait ...</div>")


concerto.template.show

The most important of all functions in the package. It informs your test logic that it's time to show a specific HTML template to test participants.

arguments

returns

Returns named list with the variable gathered from the template and:

example

response <- concerto.template.show(1)

response <- concerto.template.show("first_template")

response <- concerto.template.show(HTML="Please click the button: <button>click me</button>")


concerto.test.get

Retrieves specific test object info.

arguments

returns

List with test object properties:

example

test <- concerto.test.get(1)

test <- concerto.test.get("second_test")


concerto.test.run

Runs Concerto test.

arguments

return

Named list with the test specific return variables.

example

result <- concerto.test.run(1)


concerto.workspace.get

Gets workspace name.

arguments

return

Name of the workspace.

example

dbName <- concerto.workspace.get(1)