Suppressing question numbering in a quiz when only one question on a page
Open, Needs TriagePublic


Considering the following comment about question numbering when there is only one question on a page followed by a Submit button, is it possible to suppress the automatic question numbering?

Iverina created this task.Apr 12 2017, 1:14 PM
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptApr 12 2017, 1:14 PM
Iverina updated the task description. (Show Details)Apr 12 2017, 1:17 PM

Here is a visual representation of the question numbering if there is a submit button after each question. Can I remove the automatic numbering and add numbers manually?

As specified on the extension page, rather than adding an attribute to the quiz tag, It would be better that if there is only 1 question, it should not be numbered.

Change 356983 had a related patch set uploaded (by Harjotsingh; owner: Harjotsingh):
[mediawiki/extensions/Quiz@master] Suppressing question numbering in a quiz when only one question in a quiz

Change 356983 merged by jenkins-bot:
[mediawiki/extensions/Quiz@master] Suppressing question numbering in a quiz when only one question in a quiz

Mvolz added a subscriber: Mvolz.Jun 19 2017, 8:54 AM

I'm having buyer's regret on how we did this one; I think rather than automatically removing the numbering for only one question, we should do this with CSS ala T148624. That way people can choose to hide or not the numbering. We could still set the CSS ourselves to do this automatically then, but the way it is done now there is no way to show numbering for one question if you want it.

i.e. if there is only one question in the quiz, we could give it a class "onlyQuestion" and then you could hide or show based on that class in the CSS.

This can be achieved as you said by giving class "onlyQuestion" and it can be toggled with button via JS.
But if a quiz has only one question, it would make sense to not number it as it is the only question.Also this would not work on mobile devices as currently the js is not loaded in mobile.

Mvolz added a comment.Jun 19 2017, 1:45 PM

I don't think we would bring JS into this. Rather maybe we could allow people to basically add a style sheet somewhere in the quiz, then the stylessheet could set the style to display or not display the class.