[Moved to openedx/frontend-app-course-authoring] A library of high-level components for content handling (viewing, editing, etc. of HTML, video, problems, etc.), to be shared by multiple MFEs.
GNU Affero General Public License v3.0
11
stars
33
forks
source link
fix: removal of content after problem type tags #479
Reporting that a pre-existing problem containing a linked image is missing when they go to edit the problem in the visual editor, and also missing if they switch to the advanced editor.
This PR fixes the intermittent problem where there is OLX after the problem type tags, (multiplechoiceresponse, numericalresponse, etc.) for simple problems. Currently the parser will some times put the OLX inside the question section; other times the parser will remove the OLX. When the OLX is removed, the user switches to the advanced editor expecting to see it, but it is not present. This PR updates the parser to check if there is OLX content after the problem type tags, and if found, redirect to the advanced editor. This change removes the possibility that previous OLX will be blindly removed and that content will be rearranged blindly.
Testing
Create a new problem block
Choose one of the simple problem types
Add content to the problem
Click "Show advanced settings"
Click "Switch to advanced editor"
Before the closing problem tag (</problem>) add <p>content after problem type tags</p>
Click "Save"
Click "Edit" for the problem that you just created
Should automatically open the problem in the advanced editor
Remove <p>content after problem type tags</p>
Click "Save"
Click "Edit" for the problem that you just created
Should automatically open the problem in the visual editor
@jesperhodge I think your proposed solution makes sense. I think that is what we were trying to do initially, but as new visual editor exceptions appears, we re-oriented the code to look for the exceptions.
JIRA Ticket: TNL-10674
This PR fixes the intermittent problem where there is OLX after the problem type tags, (
multiplechoiceresponse
,numericalresponse
, etc.) for simple problems. Currently the parser will some times put the OLX inside the question section; other times the parser will remove the OLX. When the OLX is removed, the user switches to the advanced editor expecting to see it, but it is not present. This PR updates the parser to check if there is OLX content after the problem type tags, and if found, redirect to the advanced editor. This change removes the possibility that previous OLX will be blindly removed and that content will be rearranged blindly.Testing
</problem>
) add<p>content after problem type tags</p>
<p>content after problem type tags</p>