Menu

Exercise

Nicolas Hainaux

The organization of the classes is analog to the one of sheets.

X_Structure contains the to_str() method which writes the texts and answers of the Exercise to the output.

The instanciable Exercises should all be a copy of X_Model. They just need to reimplement __init__() (which first calls X_Structure.__init__() to set properly some fields) to define the Questions that will be embedded in the field questions_list.

Finally, each Exercise has also some global variables which should be defined. More details about them: (this should be checked again...)

  • AVAILABLE_X_KIND_VALUES will define which kinds (and subkinds) of Exercises are handled by this class. Extract from the code:

    # Here the list of available values for the parameter x_kind='' and the
    # matching x_subkind values
    # Note : the bypass value allows to give the value of *x_subkind* directly to
    # the matching question Constructor, bypassing the action of the present class
    AVAILABLE_X_KIND_VALUES = \
        {'short_test' : ['x_subkind1', 'x_subkind2'],
         'preformatted' : [''],
         'bypass' : ['']
        }
    
  • X_LAYOUT_UNIT: will define the unit used in X_LAYOUTS

  • X_LAYOUTS: will define the layout of the Questions inside the Exercise

The instructions for use are all written in X_Model.py
X_Structure in the doc
X_Model in the doc


Related

Doc for dev: Home

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.