# Example 1: From Brancaccio,de Chiusole, Stefanutti (2023)
# Consider the knowledge space and the parameters used in Brancaccio,
# de Chiusole, Stefanutti (2023) in Example 1
states<-matrix(c( 0,0,0,0,0,
0,0,0,0,1,
0,0,1,0,1,
0,0,0,1,1,
0,0,1,1,1,
1,0,1,0,1,
0,1,0,1,1,
1,0,1,1,1,
0,1,1,1,1,
1,1,0,1,1,
1,1,1,1,1), byrow=TRUE, ncol=5)
beta <-c(.004,.03,.02,.01,.007)
eta <-c(5e-06, 5e-05, 4e-05,.007,.08)
likelihood <-rep(1,nrow(states))/nrow(states)
assessment(likelihood,states,beta,eta)
# Example 2: Random items presentation
assessment(N_items = 5 ,adaptive = FALSE)
# Example 3: Interactive mode on in the console
TextQuestion<-c("I frequently use computers.",
"I know how to build an assessment instrument (i.e., a paper-and-pencil questionnaire).",
"I can code and implement a 'for' loop (independently of its purpose).",
"When you administer an adaptive assessment, each question: ",
"I usually programme or code my assessment tools ",
"I add my assessment in a programme (i.e , google form) ")
TextResponse<-list(
correct=list("Yes","Yes","Yes","depend from the previous questions","Yes","Yes"),
incorrect=list(c("No"),c("No"),c("No"),c("is independent from the others questions",
"depend from the gender of the interviewed"),c("No"),c("No"))
)
map <- matrix(c(1,0,0,0,
0,1,0,0,
1,0,1,0,
0,1,0,1,
1,1,1,0,
1,1,0,0), ncol=4)
skillmap<-cbind(1:6,map)
states<-pks::delineate(skillmap)$K
rownames(states)<-NULL
eta <- rep(0.1,ncol(states))
beta <- rep(0.1,ncol(states))
likelihood <-rep(1,nrow(states))/nrow(states)
if(interactive()){token <- assessment(likelihood,states,beta,eta,textq=TextQuestion,
textr=TextResponse,simulation=FALSE)}
Run the code above in your browser using DataLab