Skip to content
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

enable completion tracking for a user in multiple companies #1339

Open
wants to merge 1 commit into
base: IOMAD_38_STABLE
Choose a base branch
from

Conversation

jamiechapmanbrn
Copy link

This PR enables course tracking for a user in multiple companies.

For our use case we automatically add users to a company when they are created through some custom scripts. There is a possibility for our clients to have workers that are part of more than one company, so we need to support them in meeting those audit requirements.

This adds a function which will get all companies a userid is part of, and then processes those events for each company on enrolment and completion events

@turf212
Copy link
Collaborator

turf212 commented May 4, 2020

Interesting! How does the user's interface change with them being in multiple companies? I can see that the courses which are displayed depend on the company but do they have to switch companies or do they get all of the courses from all of the companies or?

I can see that you have made changes to the local/iomad_track event listeners. Have you done the corresponding changes to the admin tools (admin/tool/redocerts/ and admin/tool/checklearningrecords - which is new as of the end of last week)? (I am also assuming that these will need updating too, but possibly not?) Do the report's "just work"?

@jamiechapmanbrn
Copy link
Author

We have a custom url per customer, so we've made some minor changes that effectively disable changing the editing company unless you use their url, and you are always editing the company selected by the url.

As far as redo certs and learning methods I haven't gone and updated them yet, but will.

@jamiechapmanbrn
Copy link
Author

The user should only see courses that are in their active company in the iomad view, but I suspect there are some corner cases where you can enroll in a course that your editing company hasn't added.

@turf212
Copy link
Collaborator

turf212 commented May 4, 2020

There is also a potential issue with shared courses. Scenario -
Company A and Company B both have Manual Handling course assigned to them
User 1 does casual work for both companies and needs to undertake the Manual Handling course to be allowed on the site.
User 1 is allocated a license to the MH course from both companies.
User 1 logs in and starts the course.

1 - Which company course group do they get put into (shared course)?
2 - Which license does it count against?
3 - How can the educator/manager in each company view User 1 in the course reports?
4 - What happens with course recycling so the user can resit the course? Who gets the emails? Which manager can remove the enrolment?
5 - What happens with training events when User 1 signs up for them? (These are not designed to be in shared courses, but the get my manager calls would pull out people from other companies who don't have access to these)

I can see possible fixes for a few of these:
1 - User get's put into both company course groups
2 - All of them but what if the user is allocated a license for a course from Company b when they are part way through the same course for Company A? Check and mark as in use immediately?
3 - If user is in all of the same groups as the educator/company manager then no issue.
5 - Check which company the course is in and then filter managers by that.

I know I will have missed a number of scenarios here but the complexity of this is why it's not in the current core code :)

@jamiechapmanbrn
Copy link
Author

jamiechapmanbrn commented May 4, 2020

Yeah that's the reason I didn't enable adding a user to multiple companies in the dashboard. It simply can't realistically work for all use cases in a unsurprising way with the way moodle works internally. For the most part I expect the use case at agilicus to be compliance training with potentially shared courses so the use case I started with is relatively simple.

As for solving the problems:

  1. Sounds good to me.

  2. afaict the license is tracked on enrollment/completion, so right now if a course is added to company B part way through a student going through the same course in Company A they will have to complete it twice, as there's won't be a completion track created for company B. Considering that having to complete the training separately in both companies is one of the two reasonable ways to handle a user being in multiple companies it doesn't seem like a deal breaker to me.

  3. seems reasonable to me.

  4. Is this two separate problems or one problem? For the first part are you talking about training expiration?
    I haven't worked with the license/approval system yet so I can't say I'm 100% clear on how it works. The easiest way to implement it would be that when a course is requested it would email both managers to approve the course. Whatever manager approves first would have control of the enrollment and be able to unenroll. If that happens I would assume the user would be dropped from the course and would have to request approval again to enter the course. The other option for licensed/approval material is the user has to pick a company if they are in more than one.

  5. Should be able to add that.

I would like to get something merged even if it's mostly disabled from most user's point of view because the code changes end up being a lot of lines, and even editing week old source I had merge conflicts. Another option might be some refactoring to put more behavior into functions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants