-
Notifications
You must be signed in to change notification settings - Fork 20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
create training basics --> Add create training from admin console by uploading json #1950
create training basics --> Add create training from admin console by uploading json #1950
Conversation
1b3e9dd
to
54f8325
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've taken a quick look and added some comments. I didn't get all of the way through the changes, so will need to take another look later. It would be good to chat more about the approach, perhaps at our Tuesday meeting.
physionet-django/console/templates/console/training_type/index.html
Outdated
Show resolved
Hide resolved
physionet-django/console/templates/console/training_type/index.html
Outdated
Show resolved
Hide resolved
physionet-django/console/templates/console/training_type/index.html
Outdated
Show resolved
Hide resolved
physionet-django/console/templates/console/training_type/index.html
Outdated
Show resolved
Hide resolved
physionet-django/training/fixtures/example-training-create.json
Outdated
Show resolved
Hide resolved
Could we rename it from Training to Course for clarity/mental separation from other parts of the platform? |
Thank you @tompollard @alistairewj working on the feedback |
298170f
to
657ac5c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Have some brief organizational comments. Haven't reviewed the models yet but I plan to!
physionet-django/console/templates/console/training_type/index.html
Outdated
Show resolved
Hide resolved
physionet-django/console/templates/console/training_type/index.html
Outdated
Show resolved
Hide resolved
657ac5c
to
b304d1b
Compare
Thanks @alistairewj , i addressed the comments. Brief summary of updates,
|
b304d1b
to
a369d8e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is really great! I've made some comments on refactoring / rewriting some bits.
physionet-django/console/templates/console/training_type/index.html
Outdated
Show resolved
Hide resolved
physionet-django/console/templates/console/guidelines_course.html
Outdated
Show resolved
Hide resolved
physionet-django/console/templates/console/guidelines_course.html
Outdated
Show resolved
Hide resolved
Thanks @alistairewj , just saw this. Weirdly it was in my spam(Gmail thought there was some dangerous link in the email, 😆 ) |
probably the links to physionet-build ;) |
@Rutvikrj26 Try running |
Tests just failing on a style issue in the migration now (E501 line too long):
|
67f0afa
to
644c99c
Compare
@tompollard This has been implemented and is ready for testing. |
I took a look this morning and have added a few thoughts below: Minor formatting things:
Usability:
If you haven't already, I'd suggest running through the design of this new feature with January. I think the page would benefit from some tweaks to layout and content. Perhaps also add some short explanatory sentences to the page to help guide the user? TypeError when trying to update a course:When attempting to update a course using the following JSON (!) (taken from the suggested example), I receive a TypeError:
|
Some things that jump out at me:
How would these three states be represented in terms of the Course model? (Note that |
Please checkup the following workflow for new training addition and an old training expiry. Let me know if they sound okay. Admin adds a new training-type & a user wants to get credentialed
Admin adds another course (a new version) for an existing training-type
|
The type for version has changed to |
As per our discussion, I have most of the changes implemented except two :
This is the only way as the trainings does not have any other field that can be updated to implement the change in validity.
The current navigation uses trainingtype id and currently, Please provide your thoughts on these two. |
As discussed during the tuesday standup, a good idea will be use django-slugify for bacfilling the slugs in training type. |
…rate a unique slug on save, and removed the leftover code using slug ratherthan training_slug
…y & is_expired() logic in training.
@@ -92,6 +93,8 @@ | |||
|
|||
# guidelines | |||
path('guidelines/review/', views.guidelines_review, name='guidelines_review'), | |||
path('guidelines/course/', views.guidelines_course, name='guidelines_course'), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This page is not currently listed in the admin console (not sure if this is intentional).
… training feature for user (#1951) ## What? Here i have added a feature that will allow users to take the training from settings. User can choose from a list of available trainings and take the onplatform training. Users can also see the progress of the training and can resume the training from where they left off. ## Why? This is a follow up PR for #1950 ## How? Here we create 3 new views to handle the training. **1. `training.views.take_training`** This view will take care of training homepage. It will show progress of the training if the user has already started the training, show them details of the training and allow them to start/resume and review the training. **2. `training.views.take_module_training`** This view will take care of letting users take individual modules of the training. It will allow users to take the module from where they left off. Users will need to finish module1 before they can start module2 and so on. Here we have used a considerable amount of javascript to make the training interactive. How it works is when the user loads the module page, we initially load all the content, quizzes and order them based on the `order` field, and initially we hide all the content and quizzes. Then we show either the first content,quiz or the next one after a content, quiz that they had completed last time. and we keep doing this until the user has completed the module. **3. `training.views.update_module_progress`** This view uses a simple post request and expects an ajax request from the client. It will update the progress of the module and the progress of the training. ## Testing? [WIP] Following tests will be added 1. Check access to the training homepage 2. Check access to the training module page 3. Check valid and invalid submission of the training module 4. Check valid and invalid submission of the training ## Screenshots (optional) ![image](https://user-images.githubusercontent.com/24412619/228581570-568f28bc-28d3-4e22-a699-bd05092f77f2.png) ![image](https://user-images.githubusercontent.com/24412619/228581290-4615bc2e-8fbe-4aaf-9706-e19f34e7e1e0.png) ![image](https://user-images.githubusercontent.com/24412619/228581693-d42ab459-9563-49ee-98a0-bb5b61dfce2f.png) ![image](https://user-images.githubusercontent.com/24412619/228581764-e4368b6d-755c-460e-9496-0252c109a449.png) ## Anything Else? ### How to take a training as a user? 1. Login as user 2. Navigate to `Settings` 3. Select the training from the dropdown 4. Start the training
What?
Here i have added a feature that will allow admin to create training from admin console by uploading json file. This also lays foundation to implement take training feature and resume training feature for user later.
Why?
A training feature was desired by HDN so that we can build/customize a onplatform training for users which will ultimately be used to control access to projects.
The new onplatform training will work just like the existing Trainings and work with projects without any additional changes, Currently users take training outside the platform and then upload the certificate to the platform.
How?
We created a separate app called Training. This app will be used to create/manage training courses, and allow users to take onplatform training.
We created two major types of Models in training.models
1. Platform Training (
training.models.OnPlatformTraining
)The idea here is that a new Training Course will be defined with
user.models.TrainingType
. This is the ultimate(top) model for a training course.The training content for
TrainingType
model will be implemented by the new training app. On Training app,OnPlatformTraining
instance can be created for each TrainingType. For different versions of the same training course, we can create as manyOnPlatformTraining
models as we want as long as the version is different.A training is divided into modules. Each module has a description and a list of contents and quizzes. Modules are like chapters in a book. Each module has a list of contents and quizzes. Contents are like paragraphs in a chapter. Quizzes are like questions in a chapter. Contents and quizes can be organized in any order which is controlled by
order
field. For ordering the modules, contents and quizzes, we have usedorder
field. The ordering is unique for each instance of the parent model.For example : Under Module 1, we have content 1(order=1), content 2(order=2), content 3(order=4) and quiz 1(order=3). Then the ordering of the contents and quizzes will be content 1, content 2, quiz 1, content 3.
It is expected that the order will start from 1 and will be incremented by 1 with no gaps.
2. Tracking User Progress during training (
training.models.OnPlatformTrainingProgress
)When a user starts a training, a
OnPlatformTrainingProgress
instance should be created for that user and the version of the training type that they are taking. This model tracks the progress of the user during the training. Similarly, when a user starts a module, aModuleProgress
model should be created for each module in the training. For quiz, content progress, we should create a instance ofCompletedContent
orCompletedQuiz
model when the user completes a content or quiz.I don't think we need to track when someone started a content or quiz as these are expected to complete in few minutes.
Testing?
Next PR #1951
Screenshots (optional)
Anything Else?
How to create a training from admin console?
Training
tab in admin consoleCreate/Update OP Training
buttonCreate New Training
from the dropdowntraining/fixtures/example-training-create.json
How to edit a training from admin console?
training/fixtures/example-training-update.json
Notes:
This is the first part of Training PR, there is another PR #1951 which is rebased on this PR.