# Loading the 'tcals' parameters 
 data(tcals)
 
 # Item bank creation with 'tcals' item parameters
 bank <- createItemBank(tcals)
 ## MFI criterion
 # Selecting the next item, current ability estimate is 0
 nextItem(bank, 0) # item 63 is selected
 # Selecting the next item, current ability estimate is 0
 # and item 63 is removed
 nextItem(bank, 0, out=63) # item 10 is selected
 # Selecting the next item, current ability estimate is 0
 # and items 63 and 10 are removed
 nextItem(bank, 0, out=c(63,10)) # item 62 is selected
 # Item exposure control by selecting three items
 # (selected item will be either 10, 62 or 63)
 nextItem(bank, 0, randomesque = 3)
 ## Urry's method
 # Selecting the next item, current ability estimate is 0
 nextItem(bank, 0, criterion="Urry") # item 24 is selected
 # Selecting the next item, current ability estimate is 0
 # and item 24 is removed
 nextItem(bank, 0, out=24, criterion="Urry")
 
 ## MLWI and MPWI methods
 # Selecting the next item, current response pattern is 0
 # and item 63 was administered first
 nextItem(bank, x=0, out=63, criterion="MLWI") 
 nextItem(bank, x=0, out=63, criterion="MPWI")
 # Selecting the next item, current response pattern is
 # (0,1) and item 19 is removed
 nextItem(bank, x=c(0,1), out=c(63, 19), criterion="MLWI")
 nextItem(bank, x=c(0,1), out=c(63, 19), criterion="MPWI")
 ## MEI method
 # Selecting the next item, current response pattern is 0
 # and item 63 was administered first
 nextItem(bank, x=0, out=63, criterion="MEI") 
 # With Fisher information
 nextItem(bank, x=0, out=63, criterion="MEI", infoType="Fisher")
 ## MEPV method
 # Selecting the next item, current response pattern is 0
 # and item 63 was administered first
 nextItem(bank, x=0, out=63, criterion="MEPV") 
 ## Random method
 # Selecting the next item, item 63 was administered first
 nextItem(bank, out=63, criterion="random") 
 nextItem(bank, out=63, criterion="random")  # may produce a 
                                             # different result
 # Item bank creation for content balancing
 bank2 <- createItemBank(tcals, cb=TRUE)
 # Creation of the 'cbList' list with arbitrary proportions
 cbList <- list(names=c("Audio1","Audio2","Written1","Written2",
                "Written3"), props=c(0.1,0.2,0.2,0.2,0.3))
 # Selecting the next item, MFI criterion, current ability 
 # estimate is 0, items 12,33,46 and 63 previously administered
 nextItem(bank2, 0, out=c(12,33,46,63), cbControl=cbList) 
                                        # item 70 is selectedRun the code above in your browser using DataLab