tests/testthat/test.diffDistro.R

context("Distribution of difficulties")

test_that("Difficulties are normally-distributed", {
  item.parms <- genTrueItems(C = 0, J = 1000, num.forms = 1)
  expect_true(min(item.parms$t1[, "1b"]) <= -2)
  expect_true(max(item.parms$t1[, "1b"]) >=  2)
})

test_that("Difficulties are truncated", {
  item.parms <- genTrueItems(C = 0, J = 1000, num.forms = 1, truncate.b = c(-2, 2))
  expect_true(min(item.parms$t1[, "1b"]) >= -2)
  expect_true(max(item.parms$t1[, "1b"]) <=  2)
})

Try the simExam package in your browser

Any scripts or data that you put into this service are public.

simExam documentation built on Aug. 2, 2019, 5:05 p.m.