@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/cli.cjs CHANGED
@@ -3234,7 +3234,8 @@ function generateLrsBridgeCode(options) {
3234
3234
  sendStatement(statement);
3235
3235
  };
3236
3236
 
3237
- // Content/Page viewed - uses document as object for Bravais aggregation
3237
+ // Content/Page viewed - uses page-specific object for human-readable display
3238
+ // Object shows page/lesson title, parent context maintains document aggregation
3238
3239
  LRS.contentOpened = function(data) {
3239
3240
  if (!TRACK_NAVIGATION) return;
3240
3241
 
@@ -3254,31 +3255,31 @@ function generateLrsBridgeCode(options) {
3254
3255
  lessonId = lessonId.substring(2); // Remove '#/'
3255
3256
  }
3256
3257
 
3257
- // Add page info to context extensions (not as main object)
3258
+ // Get the page title - prefer lesson name from DOM
3259
+ var pageTitle = data.title || lessonInfo.name || 'Page';
3260
+
3261
+ // Build page activity object with human-readable name
3262
+ // This shows the page/lesson title in the Object column
3263
+ var pageObject = buildPageActivityObject({
3264
+ pageGuid: lessonId,
3265
+ name: pageTitle,
3266
+ resourceType: 'Lesson'
3267
+ });
3268
+
3269
+ // Add page info to context extensions
3258
3270
  var additionalContext = {
3259
3271
  extensions: {
3260
3272
  pageId: lessonId || 'home',
3261
- pageTitle: data.title || lessonInfo.name || 'Page',
3273
+ pageTitle: pageTitle,
3262
3274
  lessonName: lessonInfo.name,
3263
3275
  sectionName: lessonInfo.sectionName,
3264
3276
  pageUrl: data.url || window.location.href
3265
3277
  }
3266
3278
  };
3267
3279
 
3268
- // Use document as main object (required for Bravais aggregation)
3269
- // Use 'experienced' verb which is standard xAPI for viewing content
3270
- var statement = buildStatement(
3271
- 'experienced',
3272
- 'http://xyleme.com/bravais/activities/document',
3273
- {
3274
- event: 'page_viewed',
3275
- pageId: lessonId,
3276
- lessonName: lessonInfo.name,
3277
- sectionName: lessonInfo.sectionName
3278
- },
3279
- result,
3280
- additionalContext
3281
- );
3280
+ // Use 'experienced' verb for viewing content
3281
+ // Parent course activity added by buildXylemeContext ensures document aggregation
3282
+ var statement = buildStatementXyleme('experienced', pageObject, result, additionalContext);
3282
3283
  sendStatement(statement);
3283
3284
  };
3284
3285