read_config: Read a Configuration File

View source: R/config.R

read_configR Documentation

Read a Configuration File

Description

Read WordBox configuration from a file.

Usage

read_config(file)

get_default_config_file()

Arguments

file

character giving the path to the file

Details

The configuration file must be a JSON file containing a single object with three fields:

"boxes"

a single integer indicating the number of boxes to be used.

"counts"

an integer array with one less elements than there are boxes. The numbers indicate for each box, how often the word must be correctly answered before it is moved to the next box. For the last box, the value is automatically set to Inf, since a word cannot be moved further than the last box.

"days"

an integer array with one element per box. For each box, this gives the number of days that a word is not quizzed, after it has been correctly answered.

"counts_new"

a single integer. Words in box 1 with count less than counts_new are considered to be new and are thus quizzed when quiz_type = "newwords" is used in prepare_quiz.

"n_new"

a single integer that defines how many words are quizzed at a time when quiz_type = "newwords".

get_default_config_file() returns the path to the default configuration file. To look at its contents, run

file.show(get_default_config_file())

Value

a list containing the configuration data.


stibu81/WordBox documentation built on Nov. 28, 2024, 2:29 p.m.