Difference between revisions of "Template:Q"
Line 2: | Line 2: | ||
<code>q</code> - stands for '''Question'''<br> | <code>q</code> - stands for '''Question'''<br> | ||
This template is recommended to be used whenever a literature question is needed. | 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 == | == Parameters == | ||
Line 20: | Line 21: | ||
| <code><nowiki>{{q|1|Isn't this nice?}}</nowiki></code> || <div id="question1">[[#paragraph1|1 Isn't this nice?]]</div> | | <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?}} | || {{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|25|Isn't this nice?}}</nowiki></code> || <div id="question25">[[#paragraph25|25 Isn't this nice?]]</div> | ||
Line 45: | Line 49: | ||
|- | |- | ||
| <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|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><nowiki>{{q|7-10|Isn't this nice?}}</nowiki></code> || <div id="question7-10">[[#paragraph7|7-10 Isn't this nice?]]</div> |
Revision as of 10:01, 27 November 2020
q
- stands for Question
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.
Contents
Parameters
first
- number of the question.
second
- the actual text of the question.
third
- optional option.
Options
r
- reverse. Puts number of question at the end of the question.
One question - one paragraph
{{q|25|Isn't this nice?}}
It will automatically link the question to the 25 paragraph.
Tests
Code | Expected | Actual |
---|---|---|
{{q|1|Isn't this nice?}} |
||
{{q|1|id=something|Isn't this nice?}} |
||
{{q|25|Isn't this nice?}} |
||
{{q|105|Isn't this nice?}} |
Reverse option
Code | Expected | Actual |
---|---|---|
{{q|1|Isn't this nice?|r}} |
One question - multiple paragraphs
{{q|25-27|Isn't this nice?}}
It will automatically link the question to the 25 paragraph.
Tests
Code | Expected | Actual |
---|---|---|
{{q|7-9|Isn't this nice?}} |
||
{{q|7-9|id=something|Isn't this nice?}} |
||
{{q|7-10|Isn't this nice?}} |
||
{{q|10-12|Isn't this nice?}} |
||
{{q|99-101|Isn't this nice?}} |
||
{{q|101-105|Isn't this nice?}} |
Reverse option
Code | Expected | Actual |
---|---|---|
{{q|7-9|Isn't this nice?|r}} |
Continuation of question to another column
Code | Expected | Actual |
---|---|---|
{{q|1||c|Isn't this nice?}} |