Hey @leonkiong!
Great use case and very interesting approach to reach out to other systems, external to Docebo but in the moment of learning, to create a dynamic experience. Fair warning, this reply will be a technical one for a course developer audience. Open of course to debate and open to your feedback as well as insights from the greater Community.
The native iFrame Training Material, for sure, is designed to auto-complete on first view/load by the learner. So that’s a non-starter for your requirements. What I’m thinking...
Using xAPI (Experience API)
Instead of using SCORM, leverage the xAPI standard for this scenario. This will give you a bit more flexibility and could yield some powerful results (and easy add-on’s in the future). Generally speaking, xAPI allows for more granular tracking of user interactions and can work seamlessly with the Docebo platform and most likely with your company database - via APIs.
Idea:
Approach Using xAPI with Docebo:
- xAPI Activity for Initial Training Material:
- Create and upload the xAPI package directly into the course on the Docebo platform.
- The HTML page within the package will include an iframe with a button. This button will trigger an xAPI statement to Docebo’s LRS.
- Verification Logic in Backend:
- Upon receiving the xAPI statement, your backend service will query the company database to check if the user has met the criteria (e.g., made 5 client appointments).
- If the criteria are met, the backend will send a completion xAPI statement back to Docebo’s LRS.
- Completion Handling in Docebo:
- Configure Docebo to recognize the xAPI completion statement and mark the course as complete.
Implementation Steps:
Create and Upload xAPI Activity:
- Ensure your HTML page is set up to send xAPI statements to Docebo’s LRS.
- Use the link format specified in the KBA for sending xAPI statements: https://www.lmsaddress.com/tcapi/.
- Example of xAPI (javascript) statement for the button click:
function sendXAPIStatement() {
const endpoint = 'https://www.lmsaddress.com/tcapi/';
const authToken = 'YOUR_AUTH_TOKEN'; // Replace with actual token
const statement = {
"actor": {
"mbox": "mailto:user@example.com",
"name": "User Name",
"objectType": "Agent"
},
"verb": {
"id": "http://adlnet.gov/expapi/verbs/interacted",
"display": {"en-US": "interacted"}
},
"object": {
"id": "http://example.com/activities/button-click",
"definition": {
"name": {"en-US": "Button Click"},
"description": {"en-US": "User clicked the verification button"}
},
"objectType": "Activity"
}
};
fetch(endpoint + 'statements', {
method: 'POST',
headers: {
'Authorization': 'Bearer ' + authToken,
'Content-Type': 'application/json'
},
body: JSON.stringify(statement)
}).then(response => {
if (response.ok) {
console.log("Statement sent successfully");
} else {
console.error("Failed to send statement");
}
}).catch(error => console.error("Error:", error));
}
document.getElementById("verifyButton").addEventListener("click", sendXAPIStatement);
Backend Verification Logic:
- Create an API endpoint in your backend to receive xAPI statements from Docebo’s LRS.
- Example pseudocode for the backend service:
from flask import Flask, request, jsonify
import requests
app = Flask(__name__)
@app.route('/verify', methods=r'POST'])
def verify_completion():
data = request.json
user_email = datar'actor']s'mbox']
# Check the company database for the completion criteria
if check_user_appointments(user_email):
# Send completion statement back to Docebo's LRS
completion_statement = {
"actor": data 'actor'],
"verb": {
"id": "http://adlnet.gov/expapi/verbs/completed",
"display": {"en-US": "completed"}
},
"object": {
"id": "http://example.com/activities/course",
"definition": {
"name": {"en-US": "Course"},
"description": {"en-US": "Course completion"}
},
"objectType": "Activity"
}
}
lrs_endpoint = 'https://www.lmsaddress.com/tcapi/statements'
headers = {
'Authorization': 'Bearer YOUR_AUTH_TOKEN',
'Content-Type': 'application/json'
}
requests.post(lrs_endpoint, json=completion_statement, headers=headers)
return jsonify({"status": "success"})
else:
return jsonify({"status": "incomplete"}), 400
def check_user_appointments(user_email):
# Query the company database to verify user appointments
return True # Replace with actual logic
if __name__ == '__main__':
app.run(debug=True)
Configure Docebo to Recognize xAPI Statements:
- Ensure Docebo is configured to use its built-in LRS and is set up to listen for specific xAPI verbs (e.g., “completed”) to mark course completion.
- Ensure users have valid email addresses associated with their accounts in Docebo.
Steps to Upload xAPI Package:
- Create the xAPI Package:
- Develop the xAPI package including the HTML file with the embedded JavaScript for sending xAPI statements.
- Upload to Docebo:
- Go to the course in Docebo where you want to upload the xAPI package.
- Upload the xAPI package directly into the course.
- Configure Tracking:
- Ensure the course is set to track completion based on the xAPI statements.
Benefits of This Approach:
- Integrated Tracking: All tracking is managed within Docebo’s LRS, ensuring consistency and security.
- Granular Insights: Detailed tracking of user interactions through xAPI.
- Simplified Workflow: Using Docebo’s built-in capabilities reduces the complexity of integrating external systems.
By following this approach, you can manage the training effectively in Docebo, leveraging its built-in LRS for seamless integration with your company database and API, without the need for SCORM files or other workarounds.
Fair Use Warning:
Disclaimer: The code examples provided are intended for educational and illustrative purposes only. They are designed to demonstrate general programming principles and to serve as a starting point for your own development efforts.
While efforts have been made to ensure the code is accurate and functional, it may not be suitable for all environments or use cases and is provided “as is” without any warranties or guarantees.
Limitations and Responsibilities:
- The code may require modifications to work in your specific environment or to meet your particular needs.
- You are responsible for thoroughly testing the code in your own environment before deploying it in a production setting.
- The author is not responsible for any errors, issues, or damages that may arise from the use or misuse of this code.
By using the provided code, you acknowledge that you understand and accept these limitations and responsibilities.
Hi @John,
Ah xAPI approach does look like a much more cleaner and straightforward approach to this use case. Will explore this in detail, thank you for the guidance!
Happy to help @leonkiong! Feel free to come back to this thread with any questions or your final outcomes. Would love to see the progress and ultimate solution you come up with. Good luck in your pursuit!