Skip to content
This repository has been archived by the owner on Feb 14, 2025. It is now read-only.

fix editor deleting description #444

Merged
merged 2 commits into from
Dec 20, 2023
Merged

Conversation

jesperhodge
Copy link
Contributor

@jesperhodge jesperhodge commented Dec 19, 2023

internal issue: https://2u-internal.atlassian.net/browse/TNL-11311

This fixes a bug where the editor was deleting the OLX tag when editing in the simple editor and then saving.
Also the description was being converted to em for the simple editor, but then not converted back. However, the xblock renders label and then em in reverse order for some reason.
To fix it, the em gets converted back to description now, but not for every em tag (added a class "olx_description" for the tags that should be converted).

Testing:

  • Copy the OLX below to a new advanced blank problem and save.
  • The description should be visible in the course outline.
  • Open problem again in simple editor. The content of the description tag should be visible as italics.
  • save and check course outline. The content of the description tag should be visible and in the right order.
  • open problem again. convert to advanced problem. The description tag should be back.
  • Test a few other things concerning converting OLX that you expect to be working with advanced and simple editor. We want to do our best to make sure that we don't break anything else with this.
<problem>
  <choiceresponse>
    <label>Learning about the benefits of preventative health care can be
    particularly difficult.</label>
    <description>Check all of the options below that might be reasons why.</description>
    <checkboxgroup>
      <choice correct="true">A large amount of time passes between
       undertaking a preventative measure and seeing the result.</choice>
      <choice correct="false">Non-immunized people will always fall sick.</choice>
      <choice correct="true">If others are immunized, fewer people will fall
       sick regardless of a particular individual's choice to get immunized
       or not.</choice>
      <choice correct="true">Trust in health care professionals and
       government officials is fragile.</choice>
    </checkboxgroup>
    <solution>
      <div class="detailed-solution">
        <p>Explanation</p>
        <p>People who are not immunized against a disease might still not
         fall sick from the disease. If someone is trying to learn whether
         or not preventative measures against the disease have any impact,
         he or she might see these people and conclude, since they have
         remained healthy despite not being immunized, that immunizations
         have no effect. Consequently, he or she would tend to believe that
         immunization (or other preventative measures) have fewer benefits
         than they actually do.</p>
      </div>
    </solution>
  </choiceresponse>
</problem>

Copy link

codecov bot commented Dec 19, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (287cc23) 90.55% compared to head (1df1a5a) 90.58%.
Report is 5 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #444      +/-   ##
==========================================
+ Coverage   90.55%   90.58%   +0.02%     
==========================================
  Files         227      227              
  Lines        4120     4130      +10     
  Branches      831      831              
==========================================
+ Hits         3731     3741      +10     
  Misses        369      369              
  Partials       20       20              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

@connorhaugh connorhaugh left a comment

Choose a reason for hiding this comment

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

Local testing didn't raise any issues. LGTM

@jesperhodge jesperhodge merged commit 50c580c into main Dec 20, 2023
7 checks passed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants