-
-
Notifications
You must be signed in to change notification settings - Fork 76
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
move Hint and Solution knowls to details/summary disclosure #941
Conversation
I didn't look into it, but perhaps the |
I think is a start. A couple of things.
|
@Alex-Jordan: I added a pull request to this branch that adds animation of the button icon and body text expansion and contraction. I am in favor of eliminating knowls completely. However, I do not think that this will work for knowls in general. The problem with knowls in general is how they are used, and that usage presupposes this approach from working. That is the placement of knowl links inline or in tables or lists. That won't work for this or accordions in general in any nice way. So, basically, the only way to eliminate knowls will be to rewrite all problems that use them to not place them in those settings, and insist that they are placed in a place that will work for |
… a bootstrap collapse.
Add javascript to animate expanding and collapsing the solution/hint details and button icon.
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.
This looks mostly good. One contrast issue needs to be fixed though.
I applied the changes from this morning about the font color, font weight, and padding. |
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.
Looks good.
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.
Looks great.
…onflict resoluation.
Revert local changes accidentally added to #941 in merge conflict resolution.
This is certainly not ready for a merge. But read on.
This moves "Hint" and "Solution" away from knowls that need the knowl js, and instead uses the HTML5 native disclosure widget that is a
details
element with asummary
child. The advantage of the move is that something fancy with js is now supported mostly with just HTML and CSS.For now, there are a bunch of default bootstrap classes that get the styling started.
At minimum, it needs much better styling, and I think @drgrice1's expertise is needed here. The styling may need a level of bootstrap understanding that you have better than I do. Also since the current knows are styled using
pg/htdocs/js/Knowls/knowl.css
, I am wondering if some CSS file insidepg
is where styling for this should happen (as opposed to inwebwork2/.../math4.scss
). And I'm unsure where that should be and if it would be a new (s)css file, how to introduce that.There is a chevron next to each "Hint" or "Solution" and it is possible to animate that to rotate it as you open/close the item. And it is possible to have a little js to animate the expansion/retraction of the hidden content. Here is one page demonstrating an approach for both of these: https://christianoliff.com/blog/building-a-bootstrap-accordion-with-the-details/summary-html-tags/
Again since it may involve a new CSS file, and especially if it involves new js, I am wondering if @drgrice1 is interested in handling the cosmetic touches for this. PTX has moved to using details/summary for many of its (former) knowls, but does not use bootstrap.