Globebyte Documentation
  • AI Agents for Learning
  • Assess for Learning
    • Creating the Assess Connected App
    • Setting up Assess for Learning
    • Viewing Assessments
    • Assessment Outcomes & Validation
    • Marking
    • Best Practices
  • Tutor for Learning
    • Setting up Tutor
    • Agent Actions
      • Tutor_Mark
      • Tutor_Task
      • Tutor_Criterion
      • Tutor_SenseMaking
      • Tutor_Instruction
    • Topics
      • Tutor_Assessment
      • Tutor_Knowledge
  • Data for Learning
  • Actions for Learning
    • Creating the xAPI Actions Connected App
    • Setting up xAPI Actions
    • Creating your first xAPI Action Flow
    • xAPI Statement Data explorer
      • Metadata
      • xapiActor
      • xapiVerb
        • Verb reference
      • xapiObject
      • authority
      • xapiResult
      • xapiContext
    • Filtering xAPI Statements
    • Viewing xAPI Statements
    • Viewing xAPI Usage
    • Setting a default statement language
    • Error messages and troubleshooting
  • Experience for Learning
    • Setting up xAPI for Salesforce
    • Send xAPI from a Flow
    • Form Action fields
    • Send xAPI from Apex
    • xApiStatement Class reference
      • Actor
      • Verb
      • Object
      • Context
      • Result
      • Authority
      • Version
      • Send methods
    • Logging and defaults
  • Learning Journey Model
    • Introduction
    • Curriculums & Pathways
    • Courses & Modules
    • Pedagogies & Objectives
    • Rubrics & Criteria
    • Learning Resources
    • Assessments & Tasks
    • Learning Groups
    • Step-by-step working example
    • Activity Tracking (Advanced)
    • Additional Pedagogies Reference
    • Best Practices
    • Assess for Learning Integration
    • Data for Learning Integration
    • Object References
      • Learning Curriculum
      • Learning Pathway
      • Learning Course
      • Learning Module
      • Learning Pedagogy
      • Learning Objective
      • Learning Objective Assignment
      • Learning Rubric
      • Learning Rubric Criterion
      • Learning Rubric Model Solution
      • Learning Resource Type
      • Learning Resource
      • Learning Assessment
      • Learning Text Task
      • Learner Text Attempt
      • Learner Text Criterion Score
      • Learning Choice Task
      • Learner Choice Attempt
      • Learner Mark
      • Learning Group
      • Learner Group Membership
      • Learner Activity
      • Learner Activity Instance
      • Learner XAPIStatement
      • Developer Cheat Sheet: Key LDM Objects
  • Globebyte.com
Powered by GitBook
On this page
  • Logging
  • Logging instructions
  • Defaults
  1. Experience for Learning

Logging and defaults

Logging

To manage xAPI statement send logging, navigate to "Custom Settings". Additionally, you have the option to include the complete JSON xAPI statement and your connect LRS response in the log for debugging purposes.

Logging is written to the custom object Globebyte__xAPI_Audit_Log__c, and can be accessed via SQL and/or Apex code. Its structure is:

Field
Data type
Description

Globebyte__DateSent__c

Date/Time

Timestamp when statement send was attempted

Globebyte__Response__c

Long Text Area

The response body from the LRS (if enabled in settings)

Globebyte__StatementId__c

Text

The statement id that was set in the statement

Globebyte__StatementJSON__c

Long Text Area

The JSON of the statement (if enabled in settings)

Globebyte__StatusCode__c

Number

The HTTP status code as returned by the LRS (note: 204 is a normal good response, as the response will typically contain no body)

Logging instructions

To view the output of the SOQL log using the Query Editor:

Open the Developer Console and click the Query Editor tab. Then paste the following code into the Query Editor and click the Execute button.

SELECT id, Globebyte__StatementId__c, Globebyte__DateSent__c, Globebyte__StatusCode__c, Globebyte__Response__c, Globebyte__StatementJSON__c, Name FROM Globebyte__xAPI_Audit_Log__c

To view the output of the SOQL log using APEX:

Add the following code to your APEX class:

Globebyte__xAPI_Audit_Log__c auditLog = [SELECT id, Globebyte__StatementId__c, Globebyte__DateSent__c, Globebyte__StatusCode__c, Globebyte__Response__c, Globebyte__StatementJSON__c FROM Globebyte__xAPI_Audit_Log__c ORDER BY Globebyte__DateSent__c DESC LIMIT 1];

System.debug('ID: ' + auditLog.Globebyte__StatementId__c);
System.debug('Date: ' + auditLog.Globebyte__DateSent__c);
System.debug('Status Code: ' + auditLog.Globebyte__StatusCode__c);
System.debug('Response: ' + auditLog.Globebyte__Response__c);
System.debug('JSON: ' + auditLog.Globebyte__StatementJSON__c);

Defaults

In Custom Settings, you have the flexibility to establish a default locale for usage in your xAPI statements where locale specification is necessary. This feature eliminates the need for repetitive manual setting of locale when defining your xAPI statements.

PreviousSend methodsNextLearning Journey Model

Last updated 6 months ago