GIFTr function is the main function of 'GIFTr' package.
You provide it dataframe and select question_type
column
where a more specialized functions can process the file. See Details and Examples
GIFTr(data, output, questions, answers, question_type, categories = NULL,
question_names = NULL, mcq_answer_column = FALSE, verbose = TRUE)
dataframe or tibble of the questions data
directory of .txt file name the questions will be exported to.
name(string) or index(integer) of the questions column
a vector of names(strings) or indices of answers column(s)
name(string) or index(integer) of the questions type column.
name(string) or index(integer) of categories column if available, Default: NULL
name(string) or index(integer) of the questions names column. If NULL, it will be the first 40 letters of the question title, Default: NULL
If TRUE, the first column of answers columns will be set as the right answer, Default: FALSE
If TRUE, the functions will print to the console the statistics of writing the output, Default: TRUE
None
A guideline for creating you questions data can be found below. Check the data GIFTrData
and GIFTrData_2
as example for formatted questions.
'MOODLE' itself supports basic markdown and HTML for questions formatting. So when formatting your data you can use HTML tags like <sub> and <sup>. Also you can use markdown **bold** or __bold__ and *italic* or _italic_ ...etc. However it is better a better practice to avoid using asterisk to avoid confusion with MCQ format. For more about the supported markdown see 'MOODLE' documentation.
GIFTrData[11,3]
for an example. For further details on LATEX, check 'MOODLE' docs.
a column contains question. This cannot contain empty values
answer(s) column(s). This may be multiple columns if you have multiple answers. If you mix single and multiple answer it is better to write the single answer in the first column. If you have only single answer MCQ and NO multiple answer MCQ, you can set the answers without asterisk in the first column of the answers columns. More details in the vignette and below.
a column specifying the type of question. The current supported questions are multiple choices, numerical entry, true or false and short answer questions. The should be named 'mcq' , 'num_q' , 'tf_q' and 'short_ans' respectively.
a column specifying categories and subcategories in the 'MOODLE' categories are important when you are preparing a quiz as you may want to specify certain proportions of inclusions. Categories and subcategories are spaced by forward slash like Categ1/subcateg1/subsubcateg1 ...etc.
a column specifying question names. So you can easily enter a certain question names by like certain ID or keyword to make the questions easily on the system. however you don't need to worry about that as automatically if not set, the first 40 letter are set a question name.
Numeric Answer can be in single column or multiple columns. You can also format it as range or interval limit for the answer and partial credit. For further illustration, check the vignette.
True or False answers is to be set in 1 column with letter 'T' or 'F' insensitive to the case. For further illustration, check GIFTrData.
Short answer question answers can be in single column or multiple columns. If an answer has not credit it will be given 100% credit automatically. For example if the answer is 'statistics', it will be equivalent to '%100%statistics'. While '%80%Data Science' answer will take 80% of the credit For further illustration, check GIFTrData.
'GIFTr' package is intended to reduce the time a course creator would
take to make input question on 'MOODLE' without the pain of writing markup.
'GIFTr' package is build on 'MOODLE' guidelines. The idea is simple, you create a spreadsheet in a special format, call GIFTr
function, get a GIFT formatted file that can be imported by 'MOODLE' and other LMS systems.
GIFTr
function is unique in that it gives you detailed statistics and can work with the 4 question types supported by 'GIFTr' package. question_type
argument is unique for GIFTr
function in this package and must be passed to map the questions. The current supported question types are mcq{multiple choices question}
, num_q{numeric entry}
, tf_q{true or talse}
, and short_ans{short answer}
questions.You can find more details on the individual functions details. 'GIFTr' supports basic markdown and GIFT syntax. See the vignette and sections below for complete documentation of formatting your data.
# NOT RUN {
#' load Data and Check structure
data(GIFTrData)
str(GIFTrData)
GIFTr::GIFTr(data = GIFTrData, questions = 3,
answers = c(4:8), categories = 1,
question_type = 9,
output = file.path(tempdir(), "quiz.txt"))
#write file"quiz.txt" in tempdir()
GIFTr::GIFTr(data = GIFTrData, question_names = 2,
questions = 3, answers = c(4:8),
categories = 1, question_type = 9,
output = file.path(tempdir(), "quiz2.txt"))
#write file"quiz2.txt" in tempdir()
# }
Run the code above in your browser using DataLab