Skip to main content

A maths test

Project description

Matt

Matt is a free software (licensed under the GNU GPL v3 (or later)) maths test program. "Matt" (or "MATT") is a recursive acronym for "MATT Arithmetic Training Test".

Installation

Matt depends on:

There are 2 methods of installation: via poetry and via pip:

Installation via poetry

Poetry should handle the installation of dependencies. To install, first clone the git repository, then run:

poetry install

Installation via pip

Pip should handle the installation of dependencies. To install, run:

python3 -m pip install matt

Usage

Run python3 -m matt -h for help. Matt accepts the following arguments:

  • --difficulty or -d to set the difficulty (in the format ":"). The default namespace is reserved for the default difficulties. If unspecified the default is default:1.
  • --operations or -o to set the available operations. Operations are seperated by commas, the available operations are:
    • +: Addition
    • -: Subtraction
    • *: Multiplication
    • /: Division Example: -o +,- to enable only addition and subtraction.
  • --minimum or -m to set the minumum, default (if not specified in difficulty): 0.
  • --maximum or -M to set the maximum, default (if not specified in difficulty): 10. NOTE: The maximum must not be equivalent to the minimum.

Config

Matt has a configuration file, it is written in Python, and located at $XDG_CONFIG_HOME/matt/config.py. By default $XDG_CONFIG_HOME is set to ~/.config, so if you have not set it then it is probably ~/.config/matt/config.py.

The configuration must provide a difficulty function that accepts 2 parameters:

  • namespace (str): The namespace of the difficulty.
  • number (int): The number of the difficulty.

The difficulty function must return a dict.

A simple example is:

def difficulty(namespace: str, number: int) -> dict:
    if namespace == "manual":
       if number == 1:
           return {
               "operations": ["+", "-"],
               "maximum": 20,
               "minimum": 10
           }

Due to the config file being written in Python, it is extemely configurable, for example:

def difficulty(namespace: str, number: int) -> dict:
    if namespace == "automatic":
        return {
            "operations": ["+", "-", "*", "/"],
            "maximum": number * 10
        }

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

matt-0.1.1.post4.tar.gz (16.7 kB view hashes)

Uploaded Source

Built Distribution

matt-0.1.1.post4-py3-none-any.whl (17.6 kB view hashes)

Uploaded Python 3

Supported by

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