Skip to content

Conversation

@hermannakos
Copy link
Collaborator

Summary

Adds a "Retry" parameter to all Pendo submission tracking events (both SUCCEEDED and FAILED) to distinguish between first-time submission attempts and retry attempts after failures. This enables product managers to accurately analyze submission success rates and understand whether high failure counts include multiple retry attempts from the same user.

Changes

  • Added RETRY constant to AnalyticsParamConstants in canvas-api-2 library
  • Updated all 13 submission analytics events in SubmissionWorker to include retry parameter:
    • Value = 1 if retryCount > 0 (retry attempt)
    • Value = 0 if retryCount == 0 (first attempt)
  • Leverages existing retryCount field from CreateSubmissionEntity added in MBL-19546

Events Updated

All submission analytics events now include the retry parameter:

  • SUBMIT_MEDIARECORDING_SUCCEEDED / FAILED (3 events)
  • SUBMIT_FILEUPLOAD_SUCCEEDED / FAILED (2 events)
  • SUBMIT_TEXTENTRY_SUCCEEDED / FAILED (2 events)
  • SUBMIT_URL_SUCCEEDED / FAILED (2 events)
  • SUBMIT_STUDIO_SUCCEEDED / FAILED (2 events)
  • SUBMIT_ANNOTATION_SUCCEEDED / FAILED (2 events)

Test Plan

Manual Testing

  1. Create an assignment requiring any submission type (text, file, URL, etc.)
  2. As a student, submit to the assignment
  3. Verify submission succeeds and check Pendo analytics event includes retry: 0
  4. Simulate a network failure during submission (airplane mode or network throttling)
  5. Retry the submission after the failure
  6. Verify the retry attempt includes retry: 1 in the Pendo analytics event

Verification

  • Pendo analytics events for successful first-time submissions should have retry: 0
  • Pendo analytics events for retry attempts (after WorkManager retries) should have retry: 1
  • All 13 submission events should include the retry parameter

refs: MBL-19563
affects: Student
release note: Improved analytics tracking for submission attempts to better distinguish between first attempts and retries

  • Dark/light mode testing - N/A (analytics only, no UI changes)
  • Landscape/tablet testing - N/A (analytics only, no UI changes)
  • Accessibility testing - N/A (analytics only, no UI changes)
  • Product approval - Not required (analytics enhancement)

🤖 Generated with Claude Code

Add retry tracking to all submission analytics events to distinguish
between first-time submission attempts and retry attempts after failures.

This allows product managers to accurately analyze submission success
rates and understand whether high failure counts include multiple retry
attempts from the same submission.

## Changes

- Add RETRY constant to AnalyticsParamConstants in canvas-api-2
- Update all 13 submission analytics events in SubmissionWorker to include
  retry parameter (1 if retryCount > 0, 0 if first attempt)
- Leverages existing retryCount field from CreateSubmissionEntity added
  in MBL-19546

## Events Updated

- SUBMIT_MEDIARECORDING_SUCCEEDED/FAILED (3 events)
- SUBMIT_FILEUPLOAD_SUCCEEDED/FAILED (2 events)
- SUBMIT_TEXTENTRY_SUCCEEDED/FAILED (2 events)
- SUBMIT_URL_SUCCEEDED/FAILED (2 events)
- SUBMIT_STUDIO_SUCCEEDED/FAILED (2 events)
- SUBMIT_ANNOTATION_SUCCEEDED/FAILED (2 events)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
Copy link

@claude claude bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review Summary

This PR adds retry tracking to analytics events across submission operations. The implementation is straightforward and adds the RETRY parameter to all submission-related analytics events.

Positive Aspects

Consistent implementation: The retry parameter is added to all relevant analytics events (success and failure cases) across different submission types (media, file upload, text entry, URL, Studio, annotation)
Uses existing infrastructure: Leverages the existing retryCount field from CreateSubmissionEntity (line 49-50)
Proper constant definition: The new RETRY constant is properly added to AnalyticsParamConstants

Issues Found

  • Code duplication (SubmissionWorker.kt:252 and 13 other locations): The same line of code is repeated 14 times throughout the file. Consider extracting to a helper function for better maintainability.

  • Potential data loss (SubmissionWorker.kt:252): The implementation converts the retry count to a binary flag (0 or 1) instead of tracking the actual count. This loses valuable data about whether submissions succeed on retry 1 vs retry 2 vs retry 3. Consider tracking the actual retryCount value or documenting why binary tracking is preferred.

Additional Observations

Test Coverage: No test files were found for SubmissionWorker or analytics tracking. Consider adding tests to verify:

  • The retry parameter is correctly set to 0 for first attempts
  • The retry parameter is correctly set to 1 for retried submissions
  • Analytics events are properly logged for all submission types

Analytics Consistency: All 14 analytics events now consistently include the retry parameter, which is good for data analysis completeness.

The changes are functionally correct but would benefit from the refactoring suggestions to improve code quality and data granularity.

@github-actions
Copy link

🧪 Unit Test Results

✅ 📱 Student App

  • Tests: 1226 total, 0 failed, 0 skipped
  • Duration: 0.000s
  • Success Rate: 100%

✅ 🌅 Horizon

  • Tests: 449 total, 0 failed, 0 skipped
  • Duration: 28.157s
  • Success Rate: 100%

✅ 📦 Submodules

  • Tests: 2418 total, 0 failed, 0 skipped
  • Duration: 46.175s
  • Success Rate: 100%

📊 Summary

  • Total Tests: 4093
  • Failed: 0
  • Skipped: 0
  • Status: ✅ All tests passed!

Last updated: Fri, 28 Nov 2025 14:27:25 GMT

@github-actions
Copy link

📊 Code Coverage Report

✅ Student

  • PR Coverage: 42.77%
  • Master Coverage: 42.77%
  • Delta: +0.00%

✅ Teacher

  • PR Coverage: 25.45%
  • Master Coverage: 25.45%
  • Delta: +0.00%

✅ Pandautils

  • PR Coverage: 22.56%
  • Master Coverage: 22.56%
  • Delta: +0.00%

📈 Overall Average

  • PR Coverage: 30.26%
  • Master Coverage: 30.26%
  • Delta: +0.00%

@github-actions
Copy link

Student Install Page

@hermannakos hermannakos merged commit b2bb0ca into master Nov 28, 2025
30 checks passed
@hermannakos hermannakos deleted the MBL-19563-pendo-submission-extensions branch November 28, 2025 15:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants