CIForms sandbox: Difference between revisions

From Wikisphere
Jump to navigation Jump to search
Tag: 2017 source edit
No edit summary
Tag: 2017 source edit
Line 27: Line 27:
| your message [textarea]  *
| your message [textarea]  *
}}
}}


==Placeholders==
==Placeholders==
Line 51: Line 53:
| [your message=textarea]  *
| [your message=textarea]  *
}}
}}


==Two columns==
==Two columns==
Line 78: Line 82:
| your message [textarea]  *
| your message [textarea]  *
}}
}}




Line 104: Line 109:
| Let me explain []  
| Let me explain []  
}}
}}


== Select ==
== Select ==
Line 121: Line 129:
| [Please chose one=select=PHP and Mysql, Node.js\, Vue.js\, React, Mediawiki and Gerrit ] *
| [Please chose one=select=PHP and Mysql, Node.js\, Vue.js\, React, Mediawiki and Gerrit ] *
}}
}}


==Select with combobox==
==Select with combobox==
Line 140: Line 151:
| city [] *
| city [] *
}}
}}


==Nested sections==
==Nested sections==
Line 179: Line 193:
| [textarea=1000] *
| [textarea=1000] *
}}
}}


}}
}}
Line 223: Line 236:




==Cloze tests ==


===Html===
 
==Cloze test==
 
Cloze tests are mainly used to administer quizzes and tests.
Cloze tests are mainly used to administer quizzes and tests.
The following is a quiz adapted from [https://en.wikiversity.org/wiki/Help:Quiz-Simple this page]
 
Square brackets represent an input, a square bracket with text inside represents a suggestion. The asterisk represents an example sentence. Each row can contain an arbitrary number of inputs.


<pre>
<pre>
{{#CI form: title = Complete the text from the Wikipedia article on [https://en.wikipedia.org/wiki/Aristotle Aristotle]
{{#CI form: type = cloze test  
| type = cloze test | list-type = none
| title = Chose the right verbs for each sentence and put them in the proper tense
| <b>Early Years</b> <br> Aristotle was born in [] in Chalcidice. His parents were []  and [], who became physician to King Amyntas of Macedon. <br> Aristotle was educated as a member of the aristocracy. At about the age of [], he went to [] to continue his education at []'s Academy for nearly twenty years, not leaving until after
| * I (to be) [have been] proud to win the match
Plato's death in [] BC.  
| I (to do) [] a wonderful work
| I (to drink) [] too much at the last party
| I (to eat) [] 3 pizzas and 4 portions of french fries, and now I don't perform really well in intimate situations
| (to make) We are such stuff as dreams are [] on; and our little life ...
}}
}}
</pre>
</pre>


{{#CI form: type = cloze test
| title = Chose the right verbs for each sentence and put them in the proper tense
| * I (to be) [have been] proud to win the match
| I (to do) [] a wonderful work
| I (to drink) [] too much at the last party
| I (to eat) [] 3 pizzas and 4 portions of french fries, and now I don't perform really well in intimate situations
| (to make) We are such stuff as dreams are [] on; and our little life ...
}}


{{#CI form: title = Complete the text from the Wikipedia article on [https://en.wikipedia.org/wiki/Aristotle Aristotle]
| type = cloze test | list-type = none
| <b>Early Years</b> <br> Aristotle was born in [] in Chalcidice. His parents were []  and [], who became physician to King Amyntas of Macedon. <br> Aristotle was educated as a member of the aristocracy. At about the age of [], he went to [] to continue his education at []'s Academy for nearly twenty years, not leaving until after
Plato's death in [] BC.
}}


==Cloze test with suggestions==


===Suggestions===
The list of suggestions is automatically shuffled and the suggestion is automatically canceled from the list. (line-through)


<pre>
<pre>
{{#CI form: title = Complete the text from the Wikipedia article on [https://en.wikipedia.org/wiki/Aristotle Aristotle]
{{#CI form: type = cloze test  
| type = cloze test | list-type = none
| title = Put the right word in each sentence
| suggestions = Athens, Nicomachus, eighteen, 347, Stageira, Phaestis, Plato
| suggestions = pencils, cats, dogs, car, house, pizzas
| <b>Early Years</b> <br> Aristotle was born in [Stageira] in Chalcidice. His parents were [] and [], who became physician to King Amyntas of Macedon. <br> Aristotle was educated as a member of the aristocracy. At about the age of [], he went to [] to continue his education at []'s Academy for nearly twenty years, not leaving until after
| * There are three [pencils] on my table
Plato's death in [] BC.
| My [] is pretty fast
| My [] barks a lot but welcomes thieves equipped with sausages
| I love [] because they say "meeeooow"
| I'm able to eat 4 [] at any time
| My [] has 3 swimming pools and a bowling lane, are you envious ?
}}
}}
</pre>
</pre>
{{#CI form: title = Complete the text from the Wikipedia article on [https://en.wikipedia.org/wiki/Aristotle Aristotle]
| type = cloze test | list-type = none
| suggestions =  Athens, Nicomachus, eighteen, 347, Stageira, Phaestis, Plato
| <b>Early Years</b> <br> Aristotle was born in [Stageira] in Chalcidice. His parents were []  and [], who became physician to King Amyntas of Macedon. <br> Aristotle was educated as a member of the aristocracy. At about the age of [], he went to [] to continue his education at []'s Academy for nearly twenty years, not leaving until after
Plato's death in [] BC.
}}


{{#CI form: type = cloze test  
{{#CI form: type = cloze test  
Line 280: Line 295:




==Cloze test with transformed suggestions==
In some cases the answer has to be "transformed" with regard of the list of suggestions. In this case the relationship is expressed with the equal symbol within square brackets.
<pre>
{{#CI form: type = cloze test  
{{#CI form: type = cloze test  
| title = Chose the right verbs for each sentence and put them in the proper tense
| title = Chose the right verbs for each sentence and put them in the proper tense
Line 289: Line 309:
| We are such stuff as dreams are [] on; and our little life ...
| We are such stuff as dreams are [] on; and our little life ...
}}
}}
</pre>


{{#CI form: type = cloze test
| title = Chose the right verbs for each sentence and put them in the proper tense
| suggestions = to be, to win, to do, to drink, to make
| * I [to be=have been] proud to win the match
| I [] a wonderful work
| I [] too much at the last party
| I [] 3 pizzas and 4 portions of french fries, and now I don't perform really well in intimate situations
| We are such stuff as dreams are [] on; and our little life ...
}}
==Cloze tests with html ==
The following is a quiz adapted from [https://en.wikiversity.org/wiki/Help:Quiz-Simple this page]


{{#CI form: type = cloze test  
<pre>
| title = Put the verbs in the proper tense
{{#CI form: title = Complete the text from the Wikipedia article on [https://en.wikipedia.org/wiki/Aristotle Aristotle]
| suggestions = to be, to make, to win, to do
| type = cloze test
| * I (to be) [to be=have been] proud to win the match
| list-type = none
| I (to do) [] a wonderful job
| suggestions = Athens, Nicomachus, eighteen, 347, Stageira, Phaestis, Plato
| I (to drink) [] too much at the last party
| <b>Early Years</b> <br> Aristotle was born in [] in Chalcidice. His parents were []  and [], who became physician to King Amyntas of Macedon. <br> Aristotle was educated as a member of the aristocracy. At about the age of [], he went to [] to continue his education at []'s Academy for nearly twenty years, not leaving until after
| I (to eat) [] 3 pizzas and 4 portions of french fries, and now I don't perform really well in intimate situations
Plato's death in [] BC.
}}
</pre>
 
 
{{#CI form: title = Complete the text from the Wikipedia article on [https://en.wikipedia.org/wiki/Aristotle Aristotle]
| type = cloze test | list-type = none
| suggestions =  Athens, Nicomachus, eighteen, 347, Stageira, Phaestis, Plato
| <b>Early Years</b> <br> Aristotle was born in [] in Chalcidice. His parents were []  and [], who became physician to King Amyntas of Macedon. <br> Aristotle was educated as a member of the aristocracy. At about the age of [], he went to [] to continue his education at []'s Academy for nearly twenty years, not leaving until after
Plato's death in [] BC.
}}
}}

Revision as of 13:36, 9 January 2022

This is a sandbox for https://www.mediawiki.org/wiki/Extension:CIForms !


Basic, one column

This is the simplest form (type "inputs" by default, one column)

The square brackets represent an input, the square brackets contain the input type, the asterisk indicates a mandatory field

{{#CI form: title = Contact form
| type = inputs
| first and last name [] *
| email [email] *
| your message [textarea]  *
}}

which produces the following


Contact form


Placeholders

Form with placeholders. The square brackets contain the placeholder and optionally the input type after the equal symbol:

{{#CI form: title = Contact form
| [first and last name] *
| [email=email] *
| [phone=tel]
| [your message=textarea]  *
}}


which produces the following:


Contact form


Two columns

Inputs responsive (two columns), the square brackets contain the input type, the form rows can contain html (the label of the email input is bold)


{{#CI form: title = Contact form
| type = inputs responsive
| submit = abc@test.com
| first name [] *
| last name [] *
| <b>email</b> [email] *
| phone [tel]
| your message [textarea]  *
}}


Contact form
first name
last name
email
phone
your message


Multiple choice

Multiple choice with arbitrary text inputs between answers (on the last line in the example)

{{#CI form: title = Why are you applying to this job ?
| type = multiple choice 
| I send bulk application, even if I will be selected I'm not sure to confirm
| I ran out of money, I have to find whatever job quickly
| I want to learn something new 
| The job fits my background and I'm very skilled, I look forward to join your team!
| Let me explain [] 
}}


Why are you applying to this job ?
  • I send bulk application, even if I will be selected I'm not sure to confirm
  • I ran out of money, I have to find whatever job quickly
  • I want to learn something new
  • The job fits my background and I'm very skilled, I look forward to join your team!
  • Let me explain



Select

Select with placeholder and hardcoded options. An option contain a comma? Just escape it!

{{#CI form: title = Select your preferred IT course
| type = inputs
| [Please chose one=select=PHP and Mysql, Node.js\, Vue.js\, React, Mediawiki and Gerrit ] *
}}


Select your preferred IT course



Select with combobox

Select populated by wikitext (if the select contains more than 20 options CIForms will automatically display it as a select2 combobox)

{{#CI form: title = Country and city
| type = inputs
| country [select={{#replace:{{Template:Countries}}|*|,}}] *
| city [] *
}}


Country and city



Nested sections

Form with nested sections

{{#CI form: title = Job application
| submission groups = sysop
|
{{#CI form section: type = inputs 
| name [] *
| email [] *
}}
|
{{#CI form section: type = inputs
| title = What about your motivation ?
| type = multiple choice
| I send bulk application, even if I will be selected I'm not sure to confirm
| I ran out of money, I have to find whatever job quickly
| I want to learn something new 
| The job fits my background and I'm very skilled, I look forward to join your team!
| Let me explain [] 
}}

{{#CI form section: type = multiple choice
| title = If you will be selected (on the basis of the answer above), how will you undertake your work ? (up to 3 answers allowed)
| type = multiple choice
| max answers=3
| I will work scrupulously
| I will work meticulously
| I will pretend to work
| I will delegate all my work to my sister
| I will work seriously 
}}

{{#CI form section: type = inputs
|title = Please describe yourself (1000 characters max)
| [textarea=1000] *
}}

}}


Job application
What about your motivation ?
  • I send bulk application, even if I will be selected I'm not sure to confirm
  • I ran out of money, I have to find whatever job quickly
  • I want to learn something new
  • The job fits my background and I'm very skilled, I look forward to join your team!
  • Let me explain
If you will be selected (on the basis of the answer above), how will you undertake your work ? (up to 3 answers allowed)
  • I will work scrupulously
  • I will work meticulously
  • I will pretend to work
  • I will delegate all my work to my sister
  • I will work seriously
Please describe yourself (1000 characters max)
0/1000 characters



Cloze test

Cloze tests are mainly used to administer quizzes and tests.

Square brackets represent an input, a square bracket with text inside represents a suggestion. The asterisk represents an example sentence. Each row can contain an arbitrary number of inputs.

{{#CI form: type = cloze test 
| title = Chose the right verbs for each sentence and put them in the proper tense
| * I (to be) [have been] proud to win the match
| I (to do) [] a wonderful work
| I (to drink) [] too much at the last party
| I (to eat) [] 3 pizzas and 4 portions of french fries, and now I don't perform really well in intimate situations
| (to make) We are such stuff as dreams are [] on; and our little life ...
}}
Chose the right verbs for each sentence and put them in the proper tense
  1. I (to be) have been proud to win the match
  2. I (to do) a wonderful work
  3. I (to drink) too much at the last party
  4. I (to eat) 3 pizzas and 4 portions of french fries, and now I don't perform really well in intimate situations
  5. (to make) We are such stuff as dreams are on; and our little life ...


Cloze test with suggestions

The list of suggestions is automatically shuffled and the suggestion is automatically canceled from the list. (line-through)

{{#CI form: type = cloze test 
| title = Put the right word in each sentence
| suggestions = pencils, cats, dogs, car, house, pizzas
| * There are three [pencils] on my table
| My [] is pretty fast
| My [] barks a lot but welcomes thieves equipped with sausages
| I love [] because they say "meeeooow"
| I'm able to eat 4 [] at any time
| My [] has 3 swimming pools and a bowling lane, are you envious ?
}}
Put the right word in each sentence
catspencilshousedogspizzascar
  1. There are three pencils on my table
  2. My is pretty fast
  3. My barks a lot but welcomes thieves equipped with sausages
  4. I love because they say "meeeooow"
  5. I'm able to eat 4 at any time
  6. My has 3 swimming pools and a bowling lane, are you envious ?


Cloze test with transformed suggestions

In some cases the answer has to be "transformed" with regard of the list of suggestions. In this case the relationship is expressed with the equal symbol within square brackets.

{{#CI form: type = cloze test 
| title = Chose the right verbs for each sentence and put them in the proper tense
| suggestions = to be, to win, to do, to drink, to make
| * I [to be=have been] proud to win the match
| I [] a wonderful work
| I [] too much at the last party
| I [] 3 pizzas and 4 portions of french fries, and now I don't perform really well in intimate situations
| We are such stuff as dreams are [] on; and our little life ...
}}
Chose the right verbs for each sentence and put them in the proper tense
to maketo drinkto winto beto do
  1. I have been proud to win the match
  2. I a wonderful work
  3. I too much at the last party
  4. I 3 pizzas and 4 portions of french fries, and now I don't perform really well in intimate situations
  5. We are such stuff as dreams are on; and our little life ...


Cloze tests with html

The following is a quiz adapted from this page

{{#CI form: title = Complete the text from the Wikipedia article on [https://en.wikipedia.org/wiki/Aristotle Aristotle]
| type = cloze test
| list-type = none
| suggestions =  Athens, Nicomachus, eighteen, 347, Stageira, Phaestis, Plato
| <b>Early Years</b> <br> Aristotle was born in [] in Chalcidice. His parents were []  and [], who became physician to King Amyntas of Macedon. <br> Aristotle was educated as a member of the aristocracy. At about the age of [], he went to [] to continue his education at []'s Academy for nearly twenty years, not leaving until after 
Plato's death in [] BC. 
}}


Complete the text from the Wikipedia article on Aristotle
Stageira347AthensPlatoPhaestisNicomachuseighteen
  • Early Years
    Aristotle was born in in Chalcidice. His parents were and , who became physician to King Amyntas of Macedon.
    Aristotle was educated as a member of the aristocracy. At about the age of , he went to to continue his education at 's Academy for nearly twenty years, not leaving until after Plato's death in BC.