Page MenuHomePhabricator

Be able to hide/show numbers and apply style to numbers in Quiz
Open, MediumPublic

Description

We should be able to apply styles or hide/show all of the numbers in the Quiz.

Is there a reason the numbers are in spans instead of a <ol> tag? It would be a fairly simply matter to just do .myclass .ol or .myclass .li and apply styles to the list in the enclosed quiz. (If you do that to span, then it would change a lot of different things)

Alternatively we can add the class to the <span> i.e. <span class = 'enumeration'> I guess.

Doing this in <ol> would also fix T170798, but I wonder if the original author had a reason for doing it this way.

Event Timeline

Change 368338 had a related patch set uploaded (by Harjotsingh; owner: Harjotsingh):
[mediawiki/extensions/Quiz@master] Add enumeration class to question id field

https://gerrit.wikimedia.org/r/368338

Each question is separately called using parseQuestion function.
Inside parseQuestion the number is added inside span by keeping track Question Id.
It would not be possible in this setup to use ol tags.

I've added enumeraton class to the span.

I think you mentioned this for passing style

questionID="display:none";

for disabling question numbering for particular questions.

Where should we pass this ?

Current quiz format being

<quiz >

// Individual questions 

</quiz>

I think you mentioned this for passing style

questionID="display:none";

for disabling question numbering for particular questions.

Where should we pass this ?

Current quiz format being

<quiz >

// Individual questions 

</quiz>

In the quiz tag, i.e. <quiz questionID="display:none;" words="color:red;" > etc but I'm not 100% on this.

Before we talked about just included a block of CSS, but as you mentioned before there are security implications for the rest of the page from doing that... but maybe we could parse it?

So like <quiz
css ="

.questionID {

color:red;

}

"

But we'd have to validate it and it might get very complicated to do that.

As we're passing classnames with styles , can all this be combined into 1 attribute having these values as key-value pair
(this can extend functionality of T172593 ) or do we simply add these as individual parameters ?

Currently there are 2 classes in this example, but if we add want more classes to be configurable then having different quiz attribute for each can be long :)

Change 368338 abandoned by Harjotsingh:
Add enumeration class to question id field

Reason:
Abandoning this patch as this needs discussion

https://gerrit.wikimedia.org/r/368338

Mvolz added a subscriber: Harjotsingh.