Skip to main content

A flexible mixed integer program for automated 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.10.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.10-py3-none-any.whl (270.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: flexata-0.0.10.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.10.tar.gz
Algorithm Hash digest
SHA256 caeed38b0c3c8c9baf991ae5f198b4ea59b09765c5f9ade93506c15937503eb2
MD5 ca9ce1543865ff6d61cecce8c34ae191
BLAKE2b-256 53dfea7b7812b2d1edb5be863e6c59e338145b230c74c104e66a032d7b434336

See more details on using hashes here.

File details

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

File metadata

  • Download URL: flexata-0.0.10-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.10-py3-none-any.whl
Algorithm Hash digest
SHA256 ebc006eb9f2f4a222d24dc777f9ee6c1ac758849a25fb912d0f60dd3430421fc
MD5 2321a2be8e2ce8b73b378dc2f2ed2356
BLAKE2b-256 983cd30c91f068573b1856b5e5923945cd70e4640cf31f12402ddfe7a9dba197

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