-
Notifications
You must be signed in to change notification settings - Fork 0
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
Conversation
Cardboard and webview
|
||
$InjectedExercise__Question__MultiChoiceAnswers: ( | ||
_name: "InjectedQuestionAnswers", | ||
_subselector: " ol[data-type=question-answers][type=a]", |
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.
Are there other types?
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.
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'), |
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.
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.
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) "."', |
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.
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?
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'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
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
vs
Critical Thinking
After
PDF
Before
After