Copy link to clipboard
Copied
I am interested in using Javascript to access the Prime database via the APIs from within a Cp2017 project playing in the fluidic player.
Here is the scenario. We have a course with 3 modules:
M1: A training video (Required)
M2: a final Exam (Required)
M3: a certificate, which is locked until the final exam is passed. (Optional)
From the certificate we want to pull data from the Prime database and populate variables in Cp2017. Specifically:
UserName
UserEmail
Date of passing the Final Exam
Course Title
Has anyone done this? Or have a working example?
Thanks in advance.
Copy link to clipboard
Copied
create a course with modules M1 and M2 as order enforced.
Get the course id of this course.
make the learner api call as: GET /learningObjects/course:12345?include=enrollment.
Here course:12345 is api course id where 12345 is the prime coursed. These course ids can be directly fetched using the below api:
GET /learningObjects?sort=-date (to list recently created courses)
The response of GET /learningObjects/course:12345?include=enrollment api will be containing learningObject information and enrollment information if user has enrollment in this course.
enrollment information will be under include[] and this enrollment model will have one of the field as dateCompleted. This will tell us whether learner has completed the course or not.
Also, if you need to know when user has finished a specific module in a course -> change the above api as below:
GET /learningObjects/course:12345?include=enrollment.loResourceGrades
loResourceGrade model has one of the field as dateCompleted which tells when user has finished this module in the course.
Since we have this information, later decision to unfold new course can be taken.
user information can be retrieved using GET /user api for learner api.