« Formules: Cases de saisie » : différence entre les versions

De MoodleDocs
Aller à :navigation, rechercher
(Contenu remplacé par « <div style="background:#d9edf7;color:#3a87ad;0px;padding:8px;border:1px solid #bce8f1;border-radius:4px;margin:0;"> <p style="margin:2px 8px;"> Cette page a été dép... »)
Ligne 1 : Ligne 1 :
{{Question de type Formules}}
<div style="background:#d9edf7;color:#3a87ad;0px;padding:8px;border:1px solid #bce8f1;border-radius:4px;margin:0;">
{{Traduction}}
<p style="margin:2px 8px;">
 
Cette page a été déplacée vers  '''[[Formules:_Cases_de_réponse|Formules: Cases de réponse]]'''  ←''cliquez sur le lien''
==Answer box placeholders==
</p>
 
Answer box placeholders provide a simple way to arrange the answer boxes in the part's text. It is particularly useful when the subquestion requires more than one answer. This flexibility allows you to arrange the answer boxes in the form of a matrix, coordinates, embedding into the question text or any other way you want.
 
There are two answer box types: the quantity box and the unit box. The placeholder names are <span style="font-family:monospace;font-size:113%;">_0</span> for the first quantity box, <span style="font-family:monospace;font-size:113%;">_1</span> for the second quantity box, etc, and <span style="font-family:monospace;font-size:113%;">_u</span> for the unit box. The number of placeholder names that can be used is the same as the number of elements entered in the answer field, plus one if the unit is specified.
 
<div style="border:1px solid #bce8f1;border-radius:4px;padding: 0px 15px 0px; margin:20px 0 25px;">
<div style="font-family:Lucida Sans Unicode;font-size:150%;color:#f98012;margin:10px 0 10px;>Example</div>
 
A subquestion that has two elements in the answer field and a common unit:
 
<pre style="font-size:113%;width: 98%;">
General
  Question name !      Two quantity and one unit answer boxes
Main question
  Question text !      Using answer box placeholders
                      Given: Point A is at position x = 100 mm and y = 200 mm.
Part 1
  Part's mark*        1
  Answer type          Number
  Answer*              [100, 200]
  Grading criteria*    Absolute error == 0
  Unit                mm
  Part's text          Question: What are the coordinates of point A? The answer must be given as follows: '(x,y) unit'.
                      A(x,y) = ({_0},{_1}) {_u}
</pre>
 
The formulas question should look like this:
 
[[File:FormulasDocumentation03a.png|680px]]
 
<div style="margin:20px 0 20px;">
[http://35.193.77.29/mod/quiz/view.php?id=143 <span style="background-color:#f98012;box-shadow: 0 5px 10px #cbcbcb;border: none;color:white;padding: 8px 16px;text-align:center;text-decoration: none;cursor:pointer;">Play it</span>]   [[Formulas_question_type#Examples|Login info]]  ''(Open in new tab: Ctrl+Shift+Click)''
</div>
</div>
 
''Supprimez cette page si elle n'est plus utilisée.''
</div>
 
''Each answer box placeholder can only be used once in a part.'' For example, none of the following will be accepted:
 
<pre style="font-size:113%;width: 98%;">
  Part's text          {_0}{_0}            Comment: {_0} can not be used twice
 
  Part's text          {_0}{_1}{_1}        Comment: {_1} can not be used twice
 
  Part's text          {_0}{_u}{_1}{_u}    Comment: {_u} can not be used twice
 
  Part's text          {_3}{_3}            Comment: {_3} can not be used twice
</pre>
 
The placeholder names do not have to appear in any particular order such as the increasing order {_0}{_1}{_2}...{_u}. The order of the quantity boxes and the unit box correspond to the order of the placeholder names in the part's text. For example, the following:
 
<pre style="font-size:113%;width: 98%;">
Part 1
Answer*              [0, 100, 200, 300]
Unit                mm
Part's text          {_2}{_0}{_3}{_u}{_1}
</pre>
 
gives
 
[[File:En29FormulasDocumentation04.png|680px]]
 
Neither do the quantity answers have to be in increasing order (of course) and we would get exactly the same as above with the following:
 
<pre style="font-size:113%;width: 98%;">
Answer*              [200, 0, 300, 100]
Unit                mm
Part's text          {_0}{_1}{_2}{_u}{_3}
</pre>
 
By default, all missing placeholder are automatically appended at the end. For example, <span style="font-family:monospace;font-size:113%;">{_0}{_u}</span> for a one answer sub-question and <span style="font-family:monospace;font-size:113%;">{_0}{_1}{_u}</span> for a two answer sub-question.
 
The box <span style="font-family:monospace;font-size:113%;">{_0}</span> corresponds to the special variable <span style="font-family:monospace;font-size:113%;">_0</span> in the Grading variables.
 
===Quantity and unit boxes side by side or merged===
 
When the quantity placeholder <span style="font-family:monospace;font-size:113%;">{_0}</span> and the unit placeholder <span style="font-family:monospace;font-size:113%;">{_u}</span> are directly side by side, such as <span style="font-family:monospace;font-size:113%;">{_0}{_u}</span>, the quantity box and the unit box merge into a longer single answer box in which both quantity and unit must be entered.
 
When the quantity placeholder and the unit placeholder are not directly side by side, i.e. when they are separated by a space or any other string of characters, the answer boxes do not merge and hence they are displayed side by side.
 
<div style="border:1px solid #bce8f1;border-radius:4px;padding: 0px 15px 0px; margin:20px 0 25px;">
<div style="font-family:Lucida Sans Unicode;font-size:150%;color:#f98012;margin:10px 0 10px;>Example</div>
 
Answer with both quantity and unit:
 
<pre style="font-size:113%;width: 98%;">
Main question
  Question text*      What is 2 mm + 3 mm?
Part 1
  Part's mark*        1
  Answer type          Number
  Answer*              5
  Grading criteria*    Absolute error == 0
  Unit                mm
  Part's text          {_0} {_u}  Separate placeholders give separate quantity and unit boxes.
Part 2
  Part's mark*        1
  Answer type          Number
  Answer*              5
  Grading criteria*    Absolute error == 0
  Unit                mm
  Part's text          {_0}{_u}  Attached placeholders give a merged quantity and unit box.
</pre>
 
The formulas question should look like this:
 
[[File:En29FormulasDocumentation05.png|680px]]
 
<div style="margin:20px 0 20px;">
[http://35.193.77.29/mod/quiz/view.php?id=145 <span style="background-color:#f98012;box-shadow: 0 5px 10px #cbcbcb;border: none;color:white;padding: 8px 16px;text-align:center;text-decoration: none;cursor:pointer;">Play it</span>]   [[Formulas_question_type#Examples|Login info]]  ''(Open in new tab: Ctrl+Shift+Click)''
</div>
 
</div>
 
==Width of answer boxes==
 
The width of the quantity and unit boxes, both separate and merged, can be adjusted by modifying the width parameters in the <span style="font-family:monospace;font-size:113%;">styles.css</span> file for the Formulas question as shown below. This change can readily be done by your Moodle site administrator.
 
<code css>
 
/* Set the width of the unit box to 150px: */
input.formulas_unit {
    margin: 0.em 0 0 0;
    width : 150px;
}
 
/* Set the width of the quantity box to 130px: */
input.formulas_number {
    margin: 0.em 0 0 0;
    width : 130px;
}
 
/* Set the width of the box for merged quantity-unit to 250px: */
input.formulas_number_unit {
    margin: 0.em 0 0 0;
    width : 250px;
}
</code>
 
 
[[#top|Accéder au haut de la page]]
 
[[Question de type Formules|← QUESTION DE TYPE FORMULES]]
 
===Autres langues===
[https://docs.moodle.org/33/en/Formulas:_Answer_boxes English]<br>
[https://docs.moodle.org/all/es/F%C3%B3rmulas:_Cajas_de_entrada Español]

Version du 14 janvier 2018 à 20:49

Cette page a été déplacée vers  Formules: Cases de réponse  ←cliquez sur le lien

Supprimez cette page si elle n'est plus utilisée.