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

Style multi-choice answers more like multi-part questions #562

Merged
merged 1 commit into from
Dec 12, 2024

Conversation

TylerZeroMaster
Copy link
Contributor

@TylerZeroMaster TylerZeroMaster commented Nov 20, 2024

https://openstax.atlassian.net/browse/CORE-602

This seemed like the safest way to make the change. There was no styling on multi-choice answers before: they were using the default ordered list style. I did not want to modify the markup in cookbook because that could cause unintended changes in other build types (particularly docx/pptx since they use pandoc).

Effectively, this recreates the alphabetical list with some additional styling that makes it look more like multi-part questions (which is depicted in the Critical Thinking part of the PDF screenshot).

Web

Before

Screenshot 2024-12-05 at 4 58 37 PM

vs Critical Thinking

Screenshot 2024-12-05 at 5 00 58 PM

After

Screenshot 2024-11-20 at 3 59 52 PM

PDF

Before

Screenshot 2024-12-05 at 5 00 06 PM

After

Screenshot 2024-11-20 at 4 54 44 PM

@TomWoodward TomWoodward requested a review from jivey December 3, 2024 16:09

$InjectedExercise__Question__MultiChoiceAnswers: (
_name: "InjectedQuestionAnswers",
_subselector: " ol[data-type=question-answers][type=a]",
Copy link
Member

Choose a reason for hiding this comment

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

Are there other types?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No, only type a at the moment. Right now there is a hard requirement that these lists are type a here when solutions are being moved around. I mostly added this to be explicit about which type of list to target.

_subselector: " > li[data-type=question-answer]::before",
_properties: (
font-weight: bold,
color: enum('ValueSet:::REQUIRED'),
Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, you can override properties elsewhere if they are required or optional. If they are set here like the font-weight, however, they cannot be changed.

_properties: (
font-weight: bold,
color: enum('ValueSet:::REQUIRED'),
content: 'counter(multi-choice-index, lower-latin) "."',
Copy link
Member

Choose a reason for hiding this comment

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

I'm not very familiar with this repo, so just trying to wrap my head around how stuff works - if we only need to bold the markup, why do we need to recreate the counters?

Copy link
Contributor Author

@TylerZeroMaster TylerZeroMaster Dec 5, 2024

Choose a reason for hiding this comment

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

That's a good question. While this could potentially be as easy as setting ol[type=a] > li::marker font-weight, this PR is part of a saga of making all other lists look more like multi-part questions (which are depicted in the Critical Thinking part of the PDF screenshot). There have been four other issues going in this direction and they always ask for one thing at a time.

If you look at the screenshots I added, the letters line up with the beginning of the question in Critical Thinking but not in Chapter Review. To replicate this in Chapter Review, I needed to change the display of the lists and list items to table and table-cell, respectively. Changing the display of a list item meant that I needed to recreate the list myself. Maybe there's another way, but I could not find one that yielded lists that looked identical to the ones in Critical Thinking.

Side note: I just noticed that the PDF letters were oddly spaced before as well. I think that is more related to my pdf reader, but it looks like the updated style fixed that as well.

I should probably have a screenshot of what these looked like before in the PR (will add). Edit: PR updated with screenshots

@TylerZeroMaster TylerZeroMaster requested a review from jivey December 5, 2024 23:11
@TylerZeroMaster TylerZeroMaster merged commit 58aeea1 into main Dec 12, 2024
2 checks passed
@TylerZeroMaster TylerZeroMaster deleted the core-602-list-marker-style branch December 12, 2024 16:33
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.

2 participants