openlab-at-city-tech / webworkqa

WeBWorK integration for WordPress and BuddyPress
GNU General Public License v2.0
4 stars 2 forks source link

Header elements in problem source are being rendered as yellow text #129

Closed boonebgorges closed 5 years ago

boonebgorges commented 6 years ago

See https://i.imgur.com/myTtQXt.png and http://mathww.citytech.cuny.edu/webwork2/MAT1375/Functions_-_Difference_Quotient/1/?user=bgorges&effectiveUser=bgorges&key=9lp4eIQHT6IT8iv6gLYYC6h4A0QyJnTs

The issue appears to be an overapplication of the .canopen styling. See #32 89aa6239bc7524e2dc65e0360f9d15dc776324d5 The h3 selector here is too broad https://github.com/livinglab/webwork-for-wordpress/blob/423ccb17ec6bfddfb0b130fc657adc96832027af/assets/js/webwork-scaffold.js#L49. We'll have to go back and find a more precise way of figuring out when a problem contains "scaffolding" markup. @drdrew42 If you have any ideas off the top of your head about how the latter might be done, any suggestions would be great.

drdrew42 commented 6 years ago

What does OL see in the post data with regards to problems that contain "scaffolding"?

We started using header styling within problems (to distinguish the expository content from the practice content), so is that what's causing the h3 collision in the logic?

boonebgorges commented 6 years ago

It looks to me like sections of scaffolded problems start like this:

<div class="section-div"><h3 id="Prob-1_SC-1_SECT-3" class="iscorrect">Step 3: Complete the Square</h3>

So perhaps the "scaffolding" styling should apply only to those items that appear inside of .section-div. Does this seem accurate to you? Do you build the scaffolded markup by hand, or does WeBWorK do it for you?

drdrew42 commented 6 years ago

WeBWorK does indeed handle the styling. Within the PG markup, we have Scaffold::Begin() and Section::Begin("title") - it would make sense that each section of the scaffold have its own div class.

boonebgorges commented 6 years ago

Sounds good. We'll go with the section-div sniff, then. But we should keep in mind that this is the sort of thing that is subject to breakage if the WW devs decide to change the markup.

boonebgorges commented 6 years ago

@drdrew42 I believe I have a fix for this in place, but I won't be able to test fully until the WW-Dev course is populated with the necessary content. When you've got a chance, would you mind loading (a meaningful subset of) the new 1275 and 1375 content into WW-Dev?

drdrew42 commented 6 years ago

Do you mean a problem set that contains instances of Header + Scaffolding in the same problem?

boonebgorges commented 6 years ago

If that sort of thing might occur in the real world, then yes. Mainly I just mean: can we have the content from http://mathww.citytech.cuny.edu/webwork2/MAT1375/Functions_-_Difference_Quotient/1/ and the rest of that course put into WW-Dev, so that we'll have a complete-ish set to work with.

drdrew42 commented 6 years ago

I've imported the Functions - Difference Quotient set into the WW-Dev (for testing of tables) And also Polynomials - Inequalities (for testing of scaffolding), and Polynomials - Division (for tables, scaffolding, and headers)

boonebgorges commented 6 years ago

Excellent, thanks!

boonebgorges commented 6 years ago

I've made the changes. Headers within the problem text are now rendered as in the screenshot:

screenshot_2018-09-25_14-12-07

It seems to me that these longer problems (especially those with internal formatting) mean that we should no longer be boldfacing all text in the problem summaries, so I've gone ahead and done that, though the decision probably needs design signoff.

bree-z commented 5 years ago

Hi Boone,

I still see the yellow headers, e.g. here:

WW: http://mathww.citytech.cuny.edu/webwork2/WW-Dev/Polynomials_-_Inequalities/1/?user=student1&key=VYKlNLYNiiOn8eSkR5GcGwItwPMTjs52&effectiveUser=student1 OL-WW: http://openlabdev.org/webwork-playground/#:problemId=local2/setPolynomials_-_Inequalities/intro-poly-ineq.pg

yellowheaders

boonebgorges commented 5 years ago

I believe that those specific headers ("Identify roots" etc) are supposed to be rendered in yellow, because they are clickable accordions ("scaffolded problems"). Can you confirm @drdrew42 ?

bree-z commented 5 years ago

Oh, yes, sorry, I misunderstood. I'll wait for @drdrew42 to confirm, but I'm pretty sure we can close this one. Thanks!

drdrew42 commented 5 years ago

Oh yes, those are supposed to be yellow, they are collapsible parts of the problem.

bree-z commented 5 years ago

Thanks, @drdrew42 . We can close this one.