Difference between revisions of "Template:Q"

From Data JW United
Jump to navigation Jump to search
(Number of first paragraph of one digit)
Line 22: Line 22:
 
Expected:
 
Expected:
 
<div id="question25">
 
<div id="question25">
[[#paragraph25|25 Isn't this nice?]]
+
[[#paragraph25|25 Isn't this nice?]]</div>
</div> <br>
 
 
Actual:  
 
Actual:  
{{q|25|Isn't this nice?}}<br>
+
{{q|25|Isn't this nice?}}
 
== One question - multiple paragraphs ==
 
== One question - multiple paragraphs ==
 
=== Number of first paragraph of one digit ===
 
=== Number of first paragraph of one digit ===
Line 32: Line 31:
  
 
Expected:
 
Expected:
<div id="question7-10">
+
<div id="question7-10">[[#paragraph7|7-10 Isn't this nice?]]</div>
[[#paragraph7|7-10 Isn't this nice?]]
 
</div> <br>
 
 
Actual:  
 
Actual:  
{{q|7-10|Isn't this nice?}}<br>
+
{{q|7-10|Isn't this nice?}}
{{#sub: carte | 1 | 2 }}
+
</noinclude><includeonly><div id="question{{{1}}}">[[#paragraph{{#invoke:stringHelpers|getParagraphFromQuestion|{{{1}}} }}|{{{1}}} {{{2}}}]]</div></includeonly>
 
 
Invoke: {{#invoke:stringHelpers|getParagraphFromQuestion|paragraph7}}
 
 
 
</noinclude>
 
<includeonly>
 
<div id="question{{{1}}}">
 
[[#paragraph{{{1}}}|{{{1}}} {{{2}}}]]
 
</div>
 
</includeonly>
 

Revision as of 18:22, 12 April 2020

q - stands for Question
This template is recommended to be used whenever a literature question is needed.

Parameters

first - number of the question.
second - the actual text of the question.

One question - one paragraph

Usage

{{q|25|Isn't this nice?}}

Example action

It will automatically link the question to the 25 paragraph.

One question - multiple paragraphs

Comming soon ...

Tests

One question - one paragraph

Code:
{{q|25|Isn't this nice?}}

Expected:

Actual:

One question - multiple paragraphs

Number of first paragraph of one digit

Code:
{{q|7-10|Isn't this nice?}}

Expected:

Actual: