示例#1
0
文件: ex02.php 项目: laiello/oscats
    return $bank;
}
## main()
$test_names = array("A-opt", "D-opt", "KL");
$grid = array(-1, 0, 1);
# Create the latent space for the test: 2 continuous dimensions
$space = new OscatsSpace('OscatsSpace', array("numCont" => 2));
# Fetch the first and second continuous dimensions via the default names
$dims = array($space->get_dim_by_name("Cont.1"), $space->get_dim_by_name("Cont.2"));
# Create the covariate
$covariate = new OscatsCovariates();
$covariate->set_by_name($COVARIATE_NAME, 0);
# "covariate" variable now includes one covariate called "MyCovariate"
# It's current value is 0.
print "Creating items.\n";
$bank = gen_items($space, $covariate);
print "Creating tests.\n";
# Create new tests with the given properties
# In this case, we know what the length of the test will be (20),
# so, we set length_hint for allocation efficiency.
# Any good/reasonable guess will do---the size will be adjusted
# automatically as necessary.
$tests = array();
$err_sums = array();
foreach ($test_names as $name) {
    $tests[] = new OscatsTest('OscatsTest', array("id" => $name, "itembank" => $bank, "length_hint" => $LEN));
    $err_sums[] = array();
}
# Register the CAT algorithms for each test
# A test must have at minimum a selection algorithm, and administration
# algorithm, and a stoping critierion.
示例#2
0
文件: ex01.php 项目: laiello/oscats
        $e = new OscatsExaminee();
        # Set the examinee's true (simulated) ability
        $e->set_sim_theta($theta);
        $ret[] = $e;
    }
    return $ret;
}
## main()
$test_names = array("random", "matched", "match.5", "match.10");
# Create the latent space for the test: continuous unidimensional
$space = new OscatsSpace('OscatsSpace', array("numCont" => 1));
$dim = $space->get_dim_by_name("Cont.1");
print "Creating examinees.\n";
$examinees = gen_examinees($space);
print "Creating items.\n";
$bank = gen_items($space);
print "Creating tests.\n";
# Create new tests with the given properties
# In this case, we know what the length of the test will be (30),
# so, we set length_hint for allocation efficiency.
# Any good/reasonable guess will do---the size will be adjusted
# automatically as necessary.
$tests = array();
foreach ($test_names as $name) {
    $tests[] = new OscatsTest('OscatsTest', array("id" => $name, "itembank" => $bank, "length_hint" => $LEN));
}
# Register the CAT algorithms for each test
# A test must have at minimum a selection algorithm, and administration
# algorithm, and a stoping critierion.
$exposures = array();
foreach ($tests as $test) {