Using your CAT
Now you've created your cat according to Creating a CAT, there are a number of ways you can use it. This section covers a few. See also the Examples.
When you've set up your CAT using CatRules, you can wrap it in a CatLoopConfig and run it with run_cat.
ComputerAdaptiveTesting.CatConfig.CatLoopConfig
— Typestruct CatLoopConfig
CatLoopConfig(; rules=..., get_response=..., new_response_callback=...)
rules::Any
: An object which implements the CAT engine. Implementations exist for:
get_response::Any
: The function(index, label) -> Int8
` which obtains the testee's response for a given question, e.g. by prompting or simulation from data.
new_response_callback::Any
: A callback called each time there is a new responses. If provided, it is passed(responses::TrackedResponses, terminating)
. Default: nothing
Configuration for a simulatable CAT.
ComputerAdaptiveTesting.Sim.run_cat
— Functionrun_cat(cat_config::CatLoopConfig, item_bank::AbstractItemBank; ib_labels=nothing)
Run a given CatLoopConfig cat_config
on the given item_bank
. If ib_labels
is not given, default labels of the form <<item #$index>>
are passed to the callback.
Run a given CatLoopConfig with a MaterializedDecisionTree
Simulating CATs
You might like to use a response memory or simulated responses to simulate your CAT using auto_responder
:
ComputerAdaptiveTesting.Sim.auto_responder
— Functionauto_responder(
responses
) -> ComputerAdaptiveTesting.Sim.var"#1#2"
This function constructs a next item function which automatically responds according to responses
.
In case your data is different you might like to modify the implementation:
function auto_responder(responses)
function (index, label_)
responses[index]
end
end
auto_responder (generic function with 1 method)
Integrating into a user-facing applications
A simple interactive implementation of get_response(...)
is prompt_response
:
ComputerAdaptiveTesting.Sim.prompt_response
— Functionprompt_response(index_, label) -> Int8
This response callback simply prompts the user for the response using the console
For other types of interactivity you can modify the implementation:
function prompt_response(index_, label)
println("Response for $label > ")
parse(Int8, readline())
end
prompt_response (generic function with 1 method)