@patch-adams/core 1.4.10 → 1.4.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -2898,7 +2898,8 @@ function generateLrsBridgeCode(options) {
2898
2898
  sendStatement(statement);
2899
2899
  };
2900
2900
 
2901
- // Content/Page viewed - uses document as object for Bravais aggregation
2901
+ // Content/Page viewed - uses page-specific object for human-readable display
2902
+ // Object shows page/lesson title, parent context maintains document aggregation
2902
2903
  LRS.contentOpened = function(data) {
2903
2904
  if (!TRACK_NAVIGATION) return;
2904
2905
 
@@ -2918,31 +2919,31 @@ function generateLrsBridgeCode(options) {
2918
2919
  lessonId = lessonId.substring(2); // Remove '#/'
2919
2920
  }
2920
2921
 
2921
- // Add page info to context extensions (not as main object)
2922
+ // Get the page title - prefer lesson name from DOM
2923
+ var pageTitle = data.title || lessonInfo.name || 'Page';
2924
+
2925
+ // Build page activity object with human-readable name
2926
+ // This shows the page/lesson title in the Object column
2927
+ var pageObject = buildPageActivityObject({
2928
+ pageGuid: lessonId,
2929
+ name: pageTitle,
2930
+ resourceType: 'Lesson'
2931
+ });
2932
+
2933
+ // Add page info to context extensions
2922
2934
  var additionalContext = {
2923
2935
  extensions: {
2924
2936
  pageId: lessonId || 'home',
2925
- pageTitle: data.title || lessonInfo.name || 'Page',
2937
+ pageTitle: pageTitle,
2926
2938
  lessonName: lessonInfo.name,
2927
2939
  sectionName: lessonInfo.sectionName,
2928
2940
  pageUrl: data.url || window.location.href
2929
2941
  }
2930
2942
  };
2931
2943
 
2932
- // Use document as main object (required for Bravais aggregation)
2933
- // Use 'experienced' verb which is standard xAPI for viewing content
2934
- var statement = buildStatement(
2935
- 'experienced',
2936
- 'http://xyleme.com/bravais/activities/document',
2937
- {
2938
- event: 'page_viewed',
2939
- pageId: lessonId,
2940
- lessonName: lessonInfo.name,
2941
- sectionName: lessonInfo.sectionName
2942
- },
2943
- result,
2944
- additionalContext
2945
- );
2944
+ // Use 'experienced' verb for viewing content
2945
+ // Parent course activity added by buildXylemeContext ensures document aggregation
2946
+ var statement = buildStatementXyleme('experienced', pageObject, result, additionalContext);
2946
2947
  sendStatement(statement);
2947
2948
  };
2948
2949