Skip to main content

Hi everyone, 

I’m looking at creating a course that marks completion only via API (using the endpoint PUT /learn/v1/enrollments), all in the name of performance based learning.

 

Appreciate any advice on the intended approach to achieve this:

  1. The first training material in the course contains a html page to an iframe that contains primarily the description of what is needed for completion and a button (eg. check if user has made 5 client appointments). On click, the button sends a call to the company database to verify and if true, sets the course to complete via the above API endpoint. 
  2. Problem is html page is set to complete once viewed, so I have to add a second training asset that can never be completed and set that as the end object marker. I’ve scanned the help and community pages, so far my assumption is that a broken SCORM file (that never communicates completion status) is the only asset that fits the bill. 

 

Is the above approach ideal for this use case? If yes, then where/how can I construct a broken SCORM file? Any other more optimal approaches?

 

Thank you all in advance for your kind attention.  

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! 


Reply