Skip to main content

A flexible mixed integer toll for automatic test assembly (ATA) in Python.

Project description

FlexATA

FlexATA is a Python package designed for automated test assembly (ATA). It provides a flexible and efficient way to assemble test forms from an item pool while satisfying various constraints, such as content balancing, information targets, item usage, and more. The package leverages linear programming to solve the test assembly problem and supports multiple solvers, including CBC and CPLEX.

Features

  • Content Constraints: Control the distribution of items based on attributes like domain, difficulty, etc.
  • Information Constraints: Ensure forms meet specific information targets at given theta points.
  • Enemy Constraints: Prevent specific pairs of items from appearing together in the same form.
  • Set Constraints: Handle item sets and ensure a fixed number of items from each set are included.
  • Form Pair Constraints: Control the overlap of items between forms.
  • Item Usage Constraints: Limit the number of times an item can be used across forms.

Installation

To install the package, clone the repository and install the dependencies:

git clone https://github.com/frankyanfu/FlexATA.git
cd FlexATA
pip install -r requirements.txt

Getting Started

Example Usage Here is a basic example of how to use the FlexATA package:

import pandas as pd
from FlexATA.form_builder import FormBuilder
from FlexATA.utility import read_in_data

# Load the item pool
item_pool = read_in_data(data_name="pool")

# Initialize the FormBuilder
sp = FormBuilder(minimize=True)
sp.pool = item_pool.head(1000)
sp.number_of_forms = 3
sp.number_of_items_per_form = 10
# create item by pool variables
sp.create_item_by_form_variables()

# Add content constraints
domain_values_range = {"Domain_A":[7,7],
                    "Domain_B":[3,3]}
sp.add_content_constraints_by_column(
    column_name="Domain", 
    values_range=domain_values_range)


# Solve the problem
sp.solve_problem(timeLimit=60, solver="CBC")

# Check the solution status
print("Solution Status:", sp.status)

Examples

The package includes several example scripts to demonstrate its functionality:

  • example_form_pair.py: Demonstrates form pair constraints.
  • example_information.py: Shows how to add information constraints.
  • example_enemy.py: Illustrates enemy constraints.
  • example_set.py: Handles set constraints.
  • example_content.py: Demonstrates content balancing.

You can find these examples in the examples directory.

API Reference

Core Classes

FormBuilder

The main class for defining and solving the test assembly problem.

Attributes:

  • number_of_forms: Number of forms to assemble.
  • number_of_items_per_form: Number of items per form.
  • pool: The item pool as a pandas DataFrame.
  • item_id_column: Column name for item IDs.
  • irt_a_column, irt_b_column, irt_c_column: Columns for IRT parameters.

Methods:

  • create_item_by_form_variables(): Creates decision variables for item selection.
  • add_content_constraints_by_column(column_name, values_range): Adds content constraints.
  • add_information_based_on_theta_points(theta_points, info_targets): Adds information constraints.
  • add_enemy_constraints(enemy_pairs, itemid_column, enemyid_column): Adds enemy constraints.
  • solve_problem(timeLimit, solver): Solves the problem using the specified solver.

Data Requirements

Item Pool

The item pool should be a pandas DataFrame with the following columns:

  • ItemID: Unique identifier for each item.
  • Domain: Content domain of the item.
  • IRT_a, IRT_b, IRT_c: IRT parameters for the item.
  • SetID (optional): Identifier for item sets.
  • Difficulty (optional): Difficulty level of the item.

Enemy Pairs

A pandas DataFrame with two columns:

  • ItemID: The first item in the enemy pair.
  • EnemyID: The second item in the enemy pair.

Contributing

Contributions are welcome! Please follow these steps:

  1. Fork the repository.
  2. Create a new branch for your feature or bug fix.
  3. Submit a pull request with a detailed description of your changes.

License

This project is licensed under the MIT License. See the LICENSE file for details.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

flexata-0.0.9.tar.gz (298.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

flexata-0.0.9-py3-none-any.whl (270.4 kB view details)

Uploaded Python 3

File details

Details for the file flexata-0.0.9.tar.gz.

File metadata

  • Download URL: flexata-0.0.9.tar.gz
  • Upload date:
  • Size: 298.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for flexata-0.0.9.tar.gz
Algorithm Hash digest
SHA256 d05bfd6e2aa7c1c7f57c26fd3964f8fb19aacd9c40db69794a64ff2b5e6a622e
MD5 758ac64ba46d3ea68867a7b711ced2ef
BLAKE2b-256 024cbbc44b7914ae192370b7b9ab8853b37f782e49e9a93bb19206b52f8749d1

See more details on using hashes here.

File details

Details for the file flexata-0.0.9-py3-none-any.whl.

File metadata

  • Download URL: flexata-0.0.9-py3-none-any.whl
  • Upload date:
  • Size: 270.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for flexata-0.0.9-py3-none-any.whl
Algorithm Hash digest
SHA256 6f36f5ee1407c691aa26d6310f9ba683b9d62583e04bb6b9bb2878d9503e2014
MD5 e0e060ca5b35312f03f6b70319cbc3cd
BLAKE2b-256 f5575462750258b3037655793fc1ce3dc7c4b00c553e3aaa0bb746592ab9ede0

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page