Skip to content

[QTI/RTE] QTI package build fails when RTE content contains absolute URLs #5959

@AlexVelezLl

Description

@AlexVelezLl

This issue is not open for contribution. Visit Contributing guidelines to learn about the contributing process and how to find suitable issues.

Observed behavior

The RTE in Studio allows users to add absolute external URLs as links in content. However, when building a QTI package, any RTE content containing an absolute URL causes the build to fail with a validation error.

This is because QTI packages are bundled content and absolute URLs are not allowed — but the editor does not enforce this restriction, so users can author invalid content without any warning, only discovering the issue at build time.

Errors and logs

ValidationError
1 validation error for A
href
  Value error, Absolute URLs not allowed in bundled content: https://studio.learningequality.org/es-es/channels/4f5a35a6f67040e285fe675828ca1075/#/e9ae3052b737401d9f90176bc5e0db37/details/694db41d3d134905841179a6f8166921/questions [type=value_error, input_value='https://studio.learninge...179a6f8166921/questions', input_type=str]

Sentry issue: https://learningequality.sentry.io/issues/7518188687/

Expected behavior

Either the RTE should prevent users from adding absolute URLs when editing content that will be exported as a QTI package, or the build process should handle absolute URLs gracefully (e.g. by stripping them or surfacing a clear user-facing error before the build fails).

User-facing consequences

  • Users can author content with absolute URLs in the RTE without any warning, but the QTI package build fails silently at export time with a technical validation error.
  • There is no way for users to identify which piece of content contains the offending URL without inspecting error logs.

Steps to reproduce

  1. Create an exercise in Studio. Set completion to Survey and add a free response question.
  2. In any RTE field, add a link with an absolute URL (e.g. https://example.com).
  3. Attempt to publish the exercise as a QTI package.
  4. Observe that the build fails with a ValidationError indicating absolute URLs are not allowed in bundled content.

Context

  • The validation is enforced in the QTI export backend (contentcuration/utils/assessment/qti/), which correctly rejects absolute URLs in bundled content.
  • The RTE has no awareness of the QTI export context and applies no such restriction at authoring time.

AI usage

Drafted with Claude Code. Reproduction steps and acceptance criteria were reviewed and confirmed manually.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions