Description Usage Arguments Details Value
View source: R/assembleMultiTab.R
Takes parameterized inputs from multiple script and HTML files to make one complete file containing multiple tabs. This function is great for making multiple training HITs within one file to be placed on a server. Answers are scored but grades are not retained, and feedback can be given with the dynamic checkAnswers.js
script and answer justification elements users can add to the HTML.
1 2 3 4 5 6 7 8 9 10 11 12 |
ansVars |
the variable names to use for the honey pot. |
inputLoc |
the input file location for the input files. Not needed if files or code is directly entered into the function. Directory name should be only the string with no terminal slash (e.g., the default is |
quiet |
|
write.to |
a |
content |
named |
innerHTML.html |
HTML containing the inner body of the HIT. This code will be the same as used for intsance in |
exampleShell.html |
HTML containing the code that surrounds the HIT within a given tab. This is useful for locating check answers button, as well as navigation buttons. See details below. |
exampleTab.html |
Simple HTML code to add Bootstrap tabs for each separate training HIT. See details below. |
multiTabShell.html |
HTML containing the outer shell the HIT. This serves as the backbone into which all of the other code is assembled. See details below. |
skipPattern.js |
Javascript or jQuery that defines a skip pattern for questions. Optional. This is useful if some questions are irrelevant if a particular answer is given (e.g., if a study is not a randomized controlled trial, questions on randomization would be irrelevant). See details below. |
outerScript.js |
Javascript or jQuery for overall behavior of the HIT. The default script comes with helper functions for selecting cells in tables, enabling Bootstrap popovers, and enabling Bootstrap tooltips. See details below. |
checkAnswers.js |
Javascript or jQuery that enables answer checking and instant feedback. See details below. |
For any of the required files, input can take three forms.
The default is NULL
, which signals to the function that all required files will be found in the folder specified by inputLoc
(e.g., honeyButton.html
is expected, by default, to be in the subfolder input
).
Files can be specified if defined in with the file
function. For instance, if the innerHTML.html
file was named hitHTML.txt
in the current working directory, the input would be innerHTML.html = file("hitHTML.txt")
.
Finally, the input can be created and inserted as objects. This is particularly useful for the content
object. For instance, if one wanted to input the content from a file as well as additional parameters, one could assemble the content object and pass it to the function (e.g., one could read an file with gold-standard answers in to R, append additional columns containing the title and abstract, and pass this complete object to the function).
The returned object is either a long string
that contains the assembled HTML code (if quiet
is FALSE
), or is output to a file if write.to
is defined.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.