Open main menu

Changes

Template:Q

682 bytes added, 11:13, 26 February 2021
Continuation of question to another column
<code>q</code> - stands for '''Question'''<br>
This template is recommended to be used whenever a literature question is needed.
In order to have the possibility to differentiate between multiple paragraphs with the same number, an "id" variable can be introduced as shown in the bellow examples. Note that the same id must be used also for the linked paragraph in order the jump from paragraph to question (and vice verse) to function properly.
== Parameters ==
| <code><nowiki>{{q|1|Isn't this nice?}}</nowiki></code> || <div id="question1">[[#paragraph1|1 Isn't this nice?]]</div>
|| {{q|1|Isn't this nice?}}
|-
| <code><nowiki>{{q|1|id=something|Isn't this nice?}}</nowiki></code> || <div id="question1">[[#paragraph1|1 Isn't this nice?]]</div>
|| {{q|1|id=something|Isn't this nice?}}
|-
| <code><nowiki>{{q|25|Isn't this nice?}}</nowiki></code> || <div id="question25">[[#paragraph25|25 Isn't this nice?]]</div>
|-
| <code><nowiki>{{q|7-9|Isn't this nice?}}</nowiki></code> || <div id="question7-9">[[#paragraph7|7-9 Isn't this nice?]]</div> || {{q|7-9|Isn't this nice?}}
|-| <code><nowiki>{{q|7-9|id=something|Isn't this nice?}}</nowiki></code> || <div id="question7-9">[[#paragraph7|7-9 Isn't this nice?]]</div> || {{q|7-9|id=something|Isn't this nice?}}
|-
| <code><nowiki>{{q|7-10|Isn't this nice?}}</nowiki></code> || <div id="question7-10">[[#paragraph7|7-10 Isn't this nice?]]</div>
! Code !! Expected !! Actual
|-
| <code><nowiki>{{q|1||c|Isn't this nice?}}</nowiki></code> || <div id="question1">[[#paragraph1|Isn't this nice?]]</div>
|| {{q|1|c|Isn't this nice?}}
|}
</noinclude>
<includeonly>{{#ifeq:{{{id|}}}|{{{id}}}|{{#ifeq:{{{2|}}}|c|<div id="question{{{1}}}{{{id}}}" style="text-align:justify">[[#paragraph{{#invoke:stringHelpers|getParagraphFromQuestion|{{{1}}}}}{{{id}}}|{{{3}}}]]</div>|{{#ifeq:{{{3|}}}|r|<div id="question{{{1}}}{{{id}}}" style="text-align:justify">[[#paragraph{{#invoke:stringHelpers|getParagraphFromQuestion|{{{1}}}}}{{{id}}}|{{{2}}} {{{1}}}]]</div>|<div id="question{{{1}}}{{{id}}}" style="text-align:justify">[[#paragraph{{#invoke:stringHelpers|getParagraphFromQuestion|{{{1}}}}}{{{id}}}|{{{1}}} {{{2}}}]]</div>}}}}|{{#ifeq:{{{2|}}}|c|<div id="question{{{1}}}" style="text-align:justify">[[#paragraph{{#invoke:stringHelpers|getParagraphFromQuestion|{{{1}}}}}|{{{3}}}]]</div>|{{#ifeq:{{{3|}}}|r|<div id="question{{{1}}}" style="text-align:justify">[[#paragraph{{#invoke:stringHelpers|getParagraphFromQuestion|{{{1}}}}}|{{{2}}} {{{1}}}]]</div>|<div id="question{{{1}}}" style="text-align:justify">[[#paragraph{{#invoke:stringHelpers|getParagraphFromQuestion|{{{1}}}}}|{{{1}}} {{{2}}}]]</div>}}}}}}</includeonly>