-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: keep style
attribute intact when importing QTI
#2683
fix: keep style
attribute intact when importing QTI
#2683
Conversation
Front-end summary Node 18
|
helpers/Authoring.php
Outdated
foreach ($xpath->query("//*[local-name() = 'itemBody']//*[@style]") as $elementWithStyle) { | ||
$elementWithStyle->removeAttribute('style'); | ||
} | ||
// foreach ($xpath->query("//*[local-name() = 'itemBody']//*[@style]") as $elementWithStyle) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch @wazelin . IF you feel we may have trouble disabling it, since it is enabled for 10y, we may add a FF for that and enable it only for the client that wants to use this:
if ($featureFlagChecker->isEnabled('FEATURE_FLAG_ALLOW_QTI_STYLE_ATTR')) {
...
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That restriction is very superficial: it only removes the attribute on import. We support it throughout the rest of the flow: export, publication, compilation, runtime.
Both Terre UI and Solar UI work fine.
That does not make our item bank QTI incompliant – we still support the strict QTI items.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks for the quick fix, @wazelin
Left a small comment about using a feature flag, since inline styles are not QTI compliant.
- New code is covered by tests (if applicable)
- Tests are running successfully (old and new ones) on my local machine (if applicable)
- New code is respecting code style rules
- New code is respecting best practices
- New code is not subject to concurrency issues (if applicable)
- Feature is working correctly on my local machine (if applicable)
- Acceptance criteria are respected
- Pull request title and description are meaningful
c6cf893
to
daa200b
Compare
Version
There are 0 BREAKING CHANGE, 0 feature, 1 fix |
COECDP25-1009
This PR partially reverts #343 in an attempt to keep the
style
attributes intact when importing QTI.