Skip to content
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 html entities bug for question answers. #5414

Merged
merged 1 commit into from
Aug 8, 2022

Conversation

dadish
Copy link
Contributor

@dadish dadish commented Aug 4, 2022

Fixes #5321

Changes proposed in this Pull Request

  • Applies esc_html to question answers so users can use html entities in question answers and titles.

Testing instructions

  • Create a multi-choice question and a gap question.
  • Use html entities for the answers. E.g.: <head>, <script>, <tag>.
  • Take the quiz and answer correctly.
  • Confirm that the answers are accepted.
  • Confirm that the question titles correctly displays the text with html entitites in them.
  • Take the quiz and answer incorrectly.
  • Confirm that the question answer feedback shows up correctly.

Screenshot / Video

Screen Shot 2022-08-04 at 13 35 32

Screen Shot 2022-08-04 at 13 35 56

@dadish dadish requested a review from a team August 4, 2022 09:36
@codecov
Copy link

codecov bot commented Aug 4, 2022

Codecov Report

Merging #5414 (40073d3) into trunk (9346351) will increase coverage by 1.69%.
The diff coverage is 0.00%.

Impacted file tree graph

@@             Coverage Diff              @@
##              trunk    #5414      +/-   ##
============================================
+ Coverage     42.86%   44.56%   +1.69%     
- Complexity     8687     8728      +41     
============================================
  Files           412      412              
  Lines         31053    31115      +62     
  Branches        234      234              
============================================
+ Hits          13311    13865     +554     
+ Misses        17569    17077     -492     
  Partials        173      173              
Impacted Files Coverage Δ
includes/class-sensei-question.php 12.10% <0.00%> (ø)
...ss-sensei-reports-overview-list-table-abstract.php 64.66% <0.00%> (-4.90%) ⬇️
.../class-sensei-learners-admin-bulk-actions-view.php 54.71% <0.00%> (-3.37%) ⬇️
includes/class-sensei-list-table.php 9.09% <0.00%> (-0.59%) ⬇️
includes/class-sensei-grading.php 11.72% <0.00%> (-0.10%) ⬇️
includes/admin/class-sensei-learners-main.php 4.96% <0.00%> (-0.09%) ⬇️
includes/class-sensei-grading-main.php 0.00% <0.00%> (ø)
...cludes/class-sensei-analysis-lesson-list-table.php 0.00% <0.00%> (ø)
.../class-sensei-analysis-user-profile-list-table.php 0.00% <0.00%> (ø)
includes/class-sensei-quiz.php 59.18% <0.00%> (+0.13%) ⬆️
... and 20 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 6128d5b...40073d3. Read the comment docs.

@dadish dadish merged commit cf974e2 into trunk Aug 8, 2022
@dadish dadish deleted the fix/escaped-characters-in-answers branch August 8, 2022 11:39
@onubrooks onubrooks added this to the 4.6.1 milestone Aug 9, 2022
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.

Quiz: Says the answer is wrong when it's correct
2 participants