Metadata-Version: 2.4
Name: NEMO-online-training
Version: 0.9.0
Summary: Plugin for NEMO to allow users to complete online training even before they have a NEMO account
Author-email: Center for Nanoscale Science and Technology <CNSTapplications@nist.gov>
License: # NIST Software Licensing Statement
        NIST-developed software is provided by NIST as a public service. You may use, copy, and distribute copies of the software in any medium, provided that you keep intact this entire notice. You may improve, modify, and create derivative works of the software or any portion of the software, and you may copy and distribute such modifications or works. Modified works should carry a notice stating that you changed the software and should note the date and nature of any such change. Please explicitly acknowledge the National Institute of Standards and Technology as the source of the software.
        
        NIST-developed software is expressly provided "AS IS." NIST MAKES NO WARRANTY OF ANY KIND, EXPRESS, IMPLIED, IN FACT, OR ARISING BY OPERATION OF LAW, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NON-INFRINGEMENT, AND DATA ACCURACY. NIST NEITHER REPRESENTS NOR WARRANTS THAT THE OPERATION OF THE SOFTWARE WILL BE UNINTERRUPTED OR ERROR-FREE, OR THAT ANY DEFECTS WILL BE CORRECTED. NIST DOES NOT WARRANT OR MAKE ANY REPRESENTATIONS REGARDING THE USE OF THE SOFTWARE OR THE RESULTS THEREOF, INCLUDING BUT NOT LIMITED TO THE CORRECTNESS, ACCURACY, RELIABILITY, OR USEFULNESS OF THE SOFTWARE.
        
        You are solely responsible for determining the appropriateness of using and distributing the software and you assume all risks associated with its use, including but not limited to the risks and costs of program errors, compliance with applicable laws, damage to or loss of data, programs or equipment, and the unavailability or interruption of operation. This software is not intended to be used in any situation where a failure could cause risk of injury or damage to property. The software developed by NIST employees is not subject to copyright protection within the United States.
        
Project-URL: Homepage, https://github.com/usnistgov/NEMO-online-training
Project-URL: Changelog, https://github.com/usnistgov/NEMO-online-training/releases
Project-URL: Issues, https://github.com/usnistgov/NEMO-online-training/issues
Keywords: NEMO
Classifier: Development Status :: 5 - Production/Stable
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Framework :: Django :: 4.2
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: django
Provides-Extra: nemo-ce
Requires-Dist: NEMO-CE>=7.4.0; extra == "nemo-ce"
Provides-Extra: nemo
Requires-Dist: NEMO>=7.4.0; extra == "nemo"
Provides-Extra: dev-tools
Requires-Dist: pre-commit; extra == "dev-tools"
Requires-Dist: djlint; extra == "dev-tools"
Requires-Dist: black; extra == "dev-tools"
Dynamic: license-file

# NEMO-online-training

[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)
[![PyPI - Python Version](https://img.shields.io/pypi/pyversions/NEMO-online-training?label=python)](https://www.python.org/downloads/release/python-3110/)
[![PyPI](https://img.shields.io/pypi/v/nemo-online-training?label=pypi%20version)](https://pypi.org/project/NEMO-online-training/)
[![Changelog](https://img.shields.io/github/v/releaseusnistgov/NEMO-online-training?include_prereleases&label=changelog)](https://github.com/usnistgov/NEMO-online-training/releases)

Plugin for NEMO to allow users to complete online training even before they have a NEMO account

## Installation

```bash
python -m install nemo-online-training
```

in `settings.py` add to `INSTALLED_APPS`:

```python
INSTALLED_APPS = [
    '...',
    'NEMO_online_training',
    '...'
]
```

## Usage

Add online trainings in Administration -> Detailed administration -> Online trainings

For each training, you can optionally add an action to be performed when the user completes the training.

The following actions are available:
- extend the user's access expiration date (if the user is already a NEMO user):
  - in the configuration, you can specify the number of days to extend the access expiration date by using `extend_by_days`
- remove the training_required flag from the user
- send an email 
  - in the configuration, you can specify the email subject, message and recipients by using `subject` (django template syntax allowed), `message` (django template syntax allowed) and `recipients` (list of email addresses or `user` to send to the user)
  - in the subject and message, the following variables are available:
    - `training_user`: the user who is completing the training
    - `training`: the training being completed
    - `record`: the record of the training being completed
    - `action`: the action being performed (send email action)



# Tests

To run the tests:
```bash
python run_tests.py
```
