Competent - iTrivio integration
Software to be installed
Unless stated otherwise, newer stable versions of the program should work.
iTrivio 2.9.017
Competent 622
Introduction
On this page we use the term "Course" for both: course and test in iTrivio.
The integration of Competent and iTrivio provides features from both softwares merged together and accessible through Competent.
When specific objects are created (and deleted) in Competent, they are automatically created (and deleted) in iTrivio as well. Competent stores the ID references to the iTrivio objects in it's database.
This applies to creation of:
- Users
- Courses (Activities with the specific launch type iTrivio)
- User-Course assignments
- User-Course attempts
iTrivio application is accessible only throught specific links in Competent when:
- editing a content of Course
- playing a Course
- displaying specific User-Course reports
The links to iTrivio contain a one time auto-login security token that approves the current user's action in iTrivio. There is no need for the user to log into iTrivio system manually.
By default the password of a user in iTrivio is different (random) from his password in Competent to prevent direct access to iTrivio. We recommend to disable iTrivio emailing and to keep iTrivio user's password secret to the user.
The configuration below describes the basic scenario where
- both iTrivio and Competent are fresh installations
- login with the default iTrivio and Competent admin accounts were successfully tested
- Competent will be the main platform to handle course creation/deletion, user management and user-course management.
Contact Educasoft for specific configuration procedure in other, more complex scenarios (e.g. Competent is going to use existing iTrivio application already filled with course/user data).
Systems preparation
In order for the two systems to work together, we first have to create the basic structures they will operate with - users, folders etc.
Competent
If you have both systems as a fresh installations and you will use them only throught the Competent system, you can skip this step and go to the iTrivio preparation.
- We need to decide what subtypes we want to use for new Users and new Activites in the use case, when we would need to synchronize users and courses from iTrivio into Competent. This will not typically happen if you will use the systems as described above.
- If you want new Users and Activities to be of default subtype, you don't need to create anything.
- If you want new Users and Activities to be of some other subtype
- Log into Competent as the admin user
- switch to the Admin view
- go to the page Settings, to the tab Subtypes and create new subtypes for User and Activity (click on the green plus icon, fill in the new subtype name and hit the Create button).
- Furthermore we need to create a folder, that would hold all the iTrivio courses in case of synchronization from iTrivio, so
- Log into Competent as the admin user and switch to the Admin view (if you didn't already)
- Go to the Competent page Activities and create a new folder named for example iTrivio Courses (click on the green plus icon, choose Folder, fill in it's name and click Save).
- If you want some other user than the default Competent admin to be able to edit the iTrivio courses, create this user. Note that this user should have appropriate admin rights. We recommend to use the default admin for now.
iTrivio
Here we need to create the users that will manipulate iTrivio courses and a folder to store them.
- Log into iTrivio as admin user and go to the Courses & Tests
- Create a new folder named for example Competent courses - this is where all your courses will be stored
- If you want the company default admin user to manage all the courses and users creation in iTrivio, skip to step 7), otherwise
- Go to Administration to the section Users
- Create new user that will be responsible for manipulating all objects in iTrivio (courses and users). Fill just his email, name and surename and assign him the role Administrator.
- Optionally you can create another new user that will be responsible only for creating new users in iTrivio
- Go to the Usergroups administration and create new usergroup (for example Competent users) - this is where all your new users will be assigned.
Databases info
Now we need to write down IDs of all the objects we just created (and some more). If you have both systems as fresh installations, you did not create any specific subtypes in Competent and users in iTrivio, you can just use the default values from brackets.
- Competent database, in the table subtype write down
- USER_SUBTYPE (by default 1) = subtype ID of the default_user (column "name") or if you created a specific subtype, find it by its name and write down it's ID
- ACTIVITY_SUBTYPE (by default 2) = subtype ID of the default_timeless_activity (column "name") that has "activity_type_id" = 1. If you created a specific subtype, find it by its name and write down it's ID
- Competent database, in the table activity_set write down
- ACTIVITY_FOLDER (by default 1) = ID of the folder you created for new itrivio courses (find by name in the column "name")
- iTrivio database, in the table company write down
- COMPANY_ID (by default 1) = ID of the company that will be synchronized with Competent (find by name in the column "name")
- COMPANY_URL (by default empty) = value from the column "urlContext" of the company that will be synchornized with Competent (find by name in the column "name")
- iTrivio database, in the table course write down
- COURSE_FOLDER (by default 1) = ID of the folder that you created for new courses created from Competent (find by name in the column "name")
- iTrivio database, in the table itrivio_user write down
- If you skipped the steps 4) - 6) in iTrivio preparation and you are using fresh iTrivio instalation, just write down the default values
- ADMIN_CREATOR (by default 2) = ID of the user that will be creating all the users and courses in iTrivio
- ADMIN_USER_CREATOR (by default 2) = ID of the user that will be creating all the users in iTrivio
- iTrivio database, in the table usergroup write down
- USERGROUP (by default 1) = ID of the usegroup that all your new users will be assigned to
Beside these ids from database you might need these two optional course ids:
- COURSE_TEMPLATE_ID - a course id that will be used as a template for newly created courses.
- TEST_TEMPLATE_ID - a test id for newly created tests
Configuration
Now you can modify the systems configuration files, use the values written down from databases.
Competent
First we need to manually connect the first two users:
- Go to the Competent database once more, to the table user_mt and find either the default Competent admin (by login "admin" and typically it will be the user with ID=1) or the other user you created in the Competent preparation step (for editing your iTrivio courses).
- Find the column external_id and instead of NULL fill in the <ADMIN_CREATOR> value.
- For now, this user will be the only one in your company that will be able to edit the iTrivio courses. Other users with appropriate rights can only create/delete/run them.
Now open the application.properties file and set the following propeties:
competentItrivioIntegration.enabled=true
#-# itrivio company url context, leave empty if company has no url context
competentItrivioIntegration.itrivioCompanyUrlContext=<COMPANY_URL>
#-# url of iTrivio app (for integration API communication -accessible from browser of users, rather use full eg: https://demo.competent.cz/)
competentItrivioIntegration.url=http://localhost:8080/
#-# url of iTrivio app (for generating user links - accessible from browser of users, rather use full eg: https://demo.competent.cz/)
competentItrivioIntegration.linkUrl=http://localhost:8080
#-# integrated iTrivio db company ID
competentItrivioIntegration.itrivioCompanyId=<COMPANY_ID>
#-# iTrivio db course ID, which will be used as a template for new test
# can be null, than the test will be empty
competentItrivioIntegration.itrivioTestTemplateId=<COURSE_TEMPLATE_ID or EMPTY>
#-# iTrivio db course ID, which will be used as a template for new course
# can be null, than the course will be empty
competentItrivioIntegration.itrivioCourseTemplateId=<TEST_TEMPLATE_ID or EMPTY>
#-# -------------- COMPETENT INTEGRATION ------------
#-# --- From Competent to iTrivio synchronization ---
#-# iTrivio db user ID, which will be used as a creator iTrivio ID when creating new users in iTrivio
competentItrivioIntegration.userCreatorItrivioUserId=<ADMIN_USER_CREATOR>
#-# iTrivio db user ID, which account will be used to perform actions in iTrivio (such as creating courses and users)
competentItrivioIntegration.auth.userId=<ADMIN_CREATOR>
#-# need to be same as "environment.id" property in iTrivio "settings.properties" file
competentItrivioIntegration.auth.environment=PROD
#-# need to be same as "jwt.key" property in iTrivio "settings.properties" file
competentItrivioIntegration.auth.key=SECRET_CODE_CHANGE_IT
#-# -------------- COMPETENT INTEGRATION ------------
#-# --- From iTrivio to Competent synchronization ---
#-# competent db subtype ID, which will be used when creating new Users in Competent
competentItrivioIntegration.newUserSubtypeId=<USER_SUBTYPE>
#-# competent db subtype ID, which will be used when creating new Activities in Competent
competentItrivioIntegration.newActivitySubtypeId=<ACTIVITY_SUBTYPE>
#-# competent db activitySet (folder) ID, which will be used when creating new Activities in Competent as parent folder ID
competentItrivioIntegration.newActivityTargetFolderId=<ACTIVITY_FOLDER>
iTrivio part
Run the url "http(s)://<yourdomain>:<port>/(companyUrl/)setCompanyConfig.html" on the domain and port your iTrivio runs and with the companyUrl of the company you are setting this for.
Fill in the settings COMPETENT_INTEGRATION_XXX:
- COMPETENT_INTEGRATION_ENABLED check the box to be set to true
- COMPETENT_INTEGRATION_TARGET_FOLDER_ID = <COURSE_FOLDER>
- COMPETENT_INTEGRATION_API_URL (url where Competent is running eg.: http://localhost:9000/)
- COMPETENT_INTEGRATION_USERGROUP_ID = <USERGROUP>
- COMPETENT_INTEGRATION_COURSE_TEMPLATE = leave this option blank, for now it has no effect on the system
Save the setting with the Odeslat button (nothing visible will happen, don't be worried, it was saved)
Now open the file "/com.itrivio/src/main/resources/settings.properties" and set the two following properties:
# (must match the competentItrivioIntegration.auth.environment property from Competent)
environment.id=PROD
# secret part of you JWT key - used for communication with the Competent system and creating auto-login links
# (must match the competentItrivioIntegration.auth.key property from Competent)
jwt.key=SECRET_CODE_CHANGE_IT
Final setting test
- Now run (or restart) both Systems, but from now on do not touch iTrivio apart from making changes in the course creator tool when redirected there from Competent.
- Log into Competent (as the user able to edit iTrivio courses), go to the Admin view to the Activities page.
- Create an Activity (of whatever subtype) and go to it's tab Details
- Edit the Launch type property, set it to iTrivio and hit the Save and Create in iTrivio button
- If you get any errors, check the configuration if all is set properly
- Click the Edit button, it should take you to the iTrivio course editor, so add one new slide here, save it and close the browser tab.
- Click the Start button, it should launch the iTrivio course for you.
- If all this works, everything is set correctly