module activities.base_classes

Inheritance diagram of mathenjeu.activities.base_classes

Short summary

module mathenjeu.activities.base_classes

Base classes.

source on GitHub

Classes

class

truncated documentation

Activity

Defines an activity, a question, a game…

ActivityGroup

Defines a set of activities.

Base

Base class.

Display

Defines how an activity should be displayed.

LanguageBase

Base class for language specific content.

Notion

Defines what an activity intents to introduce.

Properties

property

truncated documentation

Fields

Returns all the fields.

Fields

Returns all the fields.

Fields

Returns all the fields.

Fields

Returns all the fields.

Fields

Returns all the fields.

Fields

Returns all the fields.

Id

Returns the identifier.

Id

Returns the identifier.

Id

Returns the identifier.

Id

Returns the identifier.

Id

Returns the identifier.

Id

Returns the identifier.

Static Methods

staticmethod

truncated documentation

_format_value

_format_value

_format_value

_format_value

_format_value

_format_value

Methods

method

truncated documentation

__getitem__

Returns the value associated to a field.

__getitem__

Retrieves the question.

__getitem__

Returns the value associated to a field.

__getitem__

Returns the value associated to a field.

__getitem__

Returns the value associated to a field.

__getitem__

Returns the value associated to a field.

__init__

__init__

__init__

__init__

__init__

__init__

__iter__

To iterate on activities.

__len__

Returns the number of activities.

__repr__

Usual

__repr__

Usual

__repr__

Usual

__repr__

Usual

__repr__

Usual

__repr__

Usual

get_display_item

Returns a displayable number.

get_next

Computes the next question or returns None if does not exist.

get_previous

Computes the previous question or returns None if does not exist.

to_dict

Returns all values as a dictionary.

to_dict

Returns all values as a dictionary.

to_dict

Returns all values as a dictionary.

to_dict

Returns all values as a dictionary.

to_dict

Returns all values as a dictionary.

to_dict

Returns all values as a dictionary.

Documentation

Base classes.

source on GitHub

class mathenjeu.activities.base_classes.Activity(eid, name, lang, title, notion=None, description=None, content=None)[source]

Bases : mathenjeu.activities.base_classes.LanguageBase

Defines an activity, a question, a game…

source on GitHub

Paramètres
  • eid – identifier

  • name – unique name

  • lang – language

  • title – display name

  • notion – notion (Notion)

  • description – description

  • content – content

source on GitHub

__init__(eid, name, lang, title, notion=None, description=None, content=None)[source]
Paramètres
  • eid – identifier

  • name – unique name

  • lang – language

  • title – display name

  • notion – notion (Notion)

  • description – description

  • content – content

source on GitHub

class mathenjeu.activities.base_classes.ActivityGroup(eid, name, acts=None)[source]

Bases : mathenjeu.activities.base_classes.Base

Defines a set of activities.

source on GitHub

Paramètres
  • eid – identifier

  • name – unique name

  • acts – set of activities

source on GitHub

__getitem__(item)[source]

Retrieves the question.

Paramètres

item – item

Renvoie

Activity

source on GitHub

__init__(eid, name, acts=None)[source]
Paramètres
  • eid – identifier

  • name – unique name

  • acts – set of activities

source on GitHub

__iter__()[source]

To iterate on activities.

source on GitHub

__len__()[source]

Returns the number of activities.

source on GitHub

get_display_item(item)[source]

Returns a displayable number.

Paramètres

item – item number

Renvoie

string

source on GitHub

get_next(current)[source]

Computes the next question or returns None if does not exist.

Paramètres

current – current question

Renvoie

next question or None

source on GitHub

get_previous(current)[source]

Computes the previous question or returns None if does not exist.

Paramètres

current – previous question

Renvoie

next question or None

source on GitHub

class mathenjeu.activities.base_classes.Base(eid, name)[source]

Bases : object

Base class.

source on GitHub

Paramètres
  • eid – entity id

  • name – unique name (mostly for logging)

source on GitHub

Fields

Returns all the fields.

source on GitHub

Id

Returns the identifier.

source on GitHub

__getitem__(field)[source]

Returns the value associated to a field.

Paramètres

field – field

Renvoie

value

source on GitHub

__init__(eid, name)[source]
Paramètres
  • eid – entity id

  • name – unique name (mostly for logging)

source on GitHub

__repr__()[source]

Usual

source on GitHub

static _format_value(v)[source]
to_dict()[source]

Returns all values as a dictionary.

source on GitHub

class mathenjeu.activities.base_classes.Display(eid, name)[source]

Bases : mathenjeu.activities.base_classes.Base

Defines how an activity should be displayed.

source on GitHub

Paramètres
  • eid – unique identifier

  • name – name

source on GitHub

__init__(eid, name)[source]
Paramètres
  • eid – unique identifier

  • name – name

source on GitHub

class mathenjeu.activities.base_classes.LanguageBase(eid, name, lang)[source]

Bases : mathenjeu.activities.base_classes.Base

Base class for language specific content.

source on GitHub

Paramètres
  • eid – entity id

  • name – unique name (mostly for logging)

  • lang – language

source on GitHub

__init__(eid, name, lang)[source]
Paramètres
  • eid – entity id

  • name – unique name (mostly for logging)

  • lang – language

source on GitHub

class mathenjeu.activities.base_classes.Notion(eid, name, lang, domain=None, level=None, depends=None, content=None)[source]

Bases : mathenjeu.activities.base_classes.LanguageBase

Defines what an activity intents to introduce.

source on GitHub

Paramètres
  • eid – identifier

  • name – unique name

  • domain – domain (maths, …)

  • lang – language

  • level – level, grade…

  • depends – is there any needed notion to know before knowing this one?, should be a list of Notion.

  • content – data

source on GitHub

__init__(eid, name, lang, domain=None, level=None, depends=None, content=None)[source]
Paramètres
  • eid – identifier

  • name – unique name

  • domain – domain (maths, …)

  • lang – language

  • level – level, grade…

  • depends – is there any needed notion to know before knowing this one?, should be a list of Notion.

  • content – data

source on GitHub