<commit_before>.. _mtraining-module:

================
mTraining Module
================

.. contents::
    :depth: 3

###########
Description
###########

The module provides data containers and APIs for defining training courses. The module gives possibility to track user enrollments
and course progress. Courses structure can be very diverse thanks to the flexibility of the mTraining entities. Structure of the
Course may be created through the API or using the user interface.

################
Course Structure
################

Introduction
############

Course structure consists of units that will meet the objectives specified by the implementations. Every element of the
structure besides ``Questions`` contains following fields.

+------------+---------------------------------------------------------------------------------+--------------------+
|Field       |Description                                                                      |Type                |
+============+=================================================================================+====================+
|name        |Name of the course unit.                                                         |String              |
+------------+---------------------------------------------------------------------------------+--------------------+
|state       |Status of the course unit. It can take one of the values ``Active``,             |CourseUnitState     |
|            |``Inactive`` or ``Pending``.                                                     |                    |
+------------+---------------------------------------------------------------------------------+--------------------+
|content     |The content for the course unit. For example this could be an url to the audio   |String              |
|            |file.                                                                            |                    |
+------------+---------------------------------------------------------------------------------+--------------------+
|description |Description of the unit.                                                         |String              |
+------------+---------------------------------------------------------------------------------+--------------------+
|properties  |The additional properties which can be used with the unit. For example language, |Map<String, String> |
|            |version or district                                                              |                    |
+------------+---------------------------------------------------------------------------------+--------------------+

Course
######

``Course`` is a top level container which contains list of ``Chapters``.

Chapter
#######

``Chapters`` are the second level of the structure. Each ``Chapter`` can contain one ``Quiz`` and list of ``Lessons``.
``Chapters`` represent phase of the ``Course``.

Lesson
######

``Lesson`` object forms the leaf node of the ``Chapter``. For example it can contain information that help passing the ``Quiz``.

Quiz
####

``Quiz`` is used to store list of the ``Questions``. It also contains pass percentage(``passPercentage`` field of type
``double``) to pass the ``Chapter``;

Question
########

``Question`` contains two fields which link with the content in external system.

+----------+------------------------------------------------------------------------------------+--------------------+
|Field     |Description                                                                         |Type                |
+==========+====================================================================================+====================+
|question  |The question resource identifier in the external system, for example audio file.    |String              |
+----------+------------------------------------------------------------------------------------+--------------------+
|answer    |The answer resource identifier in the external system, for example audio file.      |String              |
|          |This field can also store the correct answer.                                       |                    |
+----------+------------------------------------------------------------------------------------+--------------------+

Bookmark
########

``Bookmark`` entity is used to store the user progress in the individual course units.

+------------------+------------------------------------------------------------------------------------+--------------------+
|Field             |Description                                                                         |Type                |
+==================+====================================================================================+====================+
|externalId        |The external id used by implementation to track user.                               |String              |
+------------------+------------------------------------------------------------------------------------+--------------------+
|courseIdentifier  |The identifier of the course.                                                       |String              |
+------------------+------------------------------------------------------------------------------------+--------------------+
|chapterIdentifier |The identifier of the chapter.                                                      |String              |
+------------------+------------------------------------------------------------------------------------+--------------------+
|lessonIdentifier  |The identifier of the lesson.                                                       |String              |
+------------------+------------------------------------------------------------------------------------+--------------------+
|progress          |The user progress. It allows to store more details relevant for the implementation. |Map<String, Object> |
+------------------+------------------------------------------------------------------------------------+--------------------+


Activity Record
###############
<commit_msg>MOTECH-1912 Docs update (#325)<commit_after>.. _mtraining-module:

================
mTraining Module
================

.. contents::
    :depth: 3

###########
Description
###########

The module provides data containers and APIs for defining training courses. The module gives possibility to track user enrollments
and course progress. Courses structure can be very diverse thanks to the flexibility of the mTraining entities. Structure of the
Course may be created through the API or using the user interface.

################
Course Structure
################

Introduction
############

Course structure consists of units that will meet the objectives specified by the implementations. Every element of the
structure besides ``Questions`` contains following fields.

+------------+---------------------------------------------------------------------------------+--------------------+
|Field       |Description                                                                      |Type                |
+============+=================================================================================+====================+
|name        |Name of the course unit.                                                         |String              |
+------------+---------------------------------------------------------------------------------+--------------------+
|state       |Status of the course unit. It can take one of the values ``Active``,             |CourseUnitState     |
|            |``Inactive`` or ``Pending``.                                                     |                    |
+------------+---------------------------------------------------------------------------------+--------------------+
|content     |The content for the course unit. For example this could be an url to the audio   |String              |
|            |file.                                                                            |                    |
+------------+---------------------------------------------------------------------------------+--------------------+
|description |Description of the unit.                                                         |String              |
+------------+---------------------------------------------------------------------------------+--------------------+
|properties  |The additional properties which can be used with the unit. For example language, |Map<String, String> |
|            |version or district                                                              |                    |
+------------+---------------------------------------------------------------------------------+--------------------+

Course
######

``Course`` is a top level container which contains list of ``Chapters``.

Chapter
#######

``Chapters`` are the second level of the structure. Each ``Chapter`` can contain one ``Quiz`` and list of ``Lessons``.
``Chapters`` represent phase of the ``Course``.

Lesson
######

``Lesson`` object forms the leaf node of the ``Chapter``. For example it can contain information that help passing the ``Quiz``.

Quiz
####

``Quiz`` is used to store list of the ``Questions``. It also contains pass percentage(``passPercentage`` field of type
``double``) to pass the ``Chapter``;

Question
########

``Question`` contains fields which link with the content in external system.

+----------+------------------------------------------------------------------------------------+--------------------+
|Field     |Description                                                                         |Type                |
+==========+====================================================================================+====================+
|question  |The question resource identifier in the external system, for example audio file.    |String              |
+----------+------------------------------------------------------------------------------------+--------------------+
|answers   |The list of answers for the question                                                |List<Answer>        |
+----------+------------------------------------------------------------------------------------+--------------------+

Answer
######

``Answer`` can store explicit value or reference to resource in the external system, for example audio file.

Bookmark
########

``Bookmark`` entity is used to store the user progress in the individual course units.

+------------------+------------------------------------------------------------------------------------+--------------------+
|Field             |Description                                                                         |Type                |
+==================+====================================================================================+====================+
|externalId        |The external id used by implementation to track user.                               |String              |
+------------------+------------------------------------------------------------------------------------+--------------------+
|courseIdentifier  |The identifier of the course.                                                       |String              |
+------------------+------------------------------------------------------------------------------------+--------------------+
|chapterIdentifier |The identifier of the chapter.                                                      |String              |
+------------------+------------------------------------------------------------------------------------+--------------------+
|lessonIdentifier  |The identifier of the lesson.                                                       |String              |
+------------------+------------------------------------------------------------------------------------+--------------------+
|progress          |The user progress. It allows to store more details relevant for the implementation. |Map<String, Object> |
+------------------+------------------------------------------------------------------------------------+--------------------+


Activity Record
###############

{'fraction_non_alphanumeric': 0.41920644048303624, 'fraction_numerical': 0.0007393411648730797, 'mean_word_length': 0.8260086995650218, 'pattern_counts': {'":': 0, '<': 8, '<?xml version=': 0, '>': 8, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 62, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4088497', 'n_tokens_mistral': 1766, 'n_tokens_neox': 1621, 'n_words': 725}