Forms & quizzes

From Redazione
Jump to navigation Jump to search

Cultura italiana offers effective tools for rapid creation of forms, either standard forms with input fields aimed at receiving data from visitors, or forms with multiple choice questions or even Cloze tests to be used as teaching tools for current students or to engage prospective ones.

All forms include automatic validation, are protected by the latest version of Google recaptcha and are automatically "mirrored" by the respective dynamic component on the front-end (or "by the respective parser functions on the back-end, depending on what side you are reading this page), respectively for an optimal user-experience, and to just create the form in a "programmatic" and at the same time simple way without the need to create the interface itself using, namely, a tool like "Google form", which is actually a more convoluted process.

Conversely, "CI forms" have been inspired by this extension at Wikiversity and they diverge from it, apart the features above, mainly because the submitted data are sent to the provided email address, rather than used to compute a score.

Here is an overview of the available options and the way to use them.


Form with inputs

The most common kind of form, it can contain an arbitrary number of rows (but in order to ensure a good user experience, they should not exceed 10,000) with any of the input fields among the following: 'text', 'email', 'password', 'textarea', 'email', 'search', 'tel', 'file', 'number', 'url', 'time', 'date'. The list currently reflects the accepted input types by the Quasar framework inasmuch as the form is automatically converted to a Quasar component once created on the (wiki) back-end. (*** currently, in February 2021, only few of them have been tested, among which, 'text', 'email', 'textarea', 'email', but all of them will be set-up as soon as possible).

A form can be created through a template like the following:

{{#CI form: title = Contact form
| submit = abc@test.com
| first and last name [] *
| email [email] *
| your message [textarea]  *
}}

which produces the following result


Contact form
form protected using Google recaptcha


where the double square brackets represent an input, the asterisk a mandatory field, and the pipe is of course used to separate rows. The input symbol can be either left blank (in this case the input type is assumed to be "text"), filled-in with one of the values above (like 'email', 'textarea', etc.) or completed with a placeholder, like in the following example:

{{#CI form: title = Contact form
| submit = abc@test.com
| [first and last name] *
| [email=email] *
| [phone=tel]
| [your message=textarea]  *
}}


which produces the following:


Contact form
form protected using Google recaptcha

(note that the placeholder label is placed within the input symbol itself and the the row does not contain other text).


Inputs fields can also be displayed in a responsive way, as follows:

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


Contact form
form protected using Google recaptcha

(useful rather when you are combining standard inputs with multiple choice or Cloze tests, as shown below).

Note also that the input type is 'inputs responsive', conversely to the input type by default, which is 'inputs'.

Predictably, the 'submit' field contains the email to which the filled-in form will be dispatched (which can be omitted as long as the variable $wgCIFormsSubmitEmail in LocalSettings.php is set to some value), while all forms also accept the parameters 'success message' with a message to be displayed to the user once the form has been correctly dispatched, and 'error message', where the form cannot be dispatched for any reason: also in this case the variables $wgCIFormsSuccessMessage and $wgCIFormsErrorMessage can be set instead, but they can be left blank in favor of standard messages.

Form with multiple choice questions

A form intended either to create surveys of any kind, or as a teaching tool, to be combined with "Cloze tests" described below.

This is an example of multiple choice questions with arbitrary input fields among the answers:

{{#CI form: title = Why do you want to learn Italian?
| type = multiple choice  | list-type = letters | max answers = 2
| I want to work using Italian language 
| I want to study using Italian language 
| Cultural interest / personal knowledge 
| interpersonal relationships [] *
| prospective stay in Italy 
}}


Why do you want to learn Italian?
  1. I want to work using Italian language
  2. I want to study using Italian language
  3. Cultural interest / personal knowledge
  4. interpersonal relationships *
  5. prospective stay in Italy
form protected using Google recaptcha


where 'type' is the kind of form, 'list-type' the kind of list, which can be "none", "ordered", "unordered", "letters", "number", or any of the values listed here, 'max answers' the maximum number of allowed answers, the double square brackets represent as above an input field, and the asterisk indicates as above that the preceding input field is mandatory. (an input field can be added to every row, however no more than 1 input field per row is currently expected to be found)



Form with Cloze tests

A kind of form mainly used to provide students with online exercises to assess their understanding of assigned teaching materials.

A Cloze (completion) test can be either with inline suggestions like the following:

{{#CI form: title = Metti i verbi al futuro semplice
| type = cloze test 
| * Vedo, vedo... che tra poco [incontrare=incontrerai] l'uomo della tua vita
| Vedo, vedo... che [avere] una grande vincita al gioco
| Questa carta mi dice che [vincere] il concorso che hai appena fatto
| Quest'altra carta mi dice che [sposarsi] al massimo entro tre anni
| Ah, qui vedo che [fare] un viaggio molto interessante
| Qui vedo che [andare] ad abitare in un'altra citta'
}}


Metti i verbi al futuro semplice
  1. Vedo, vedo... che tra poco (incontrare) incontrerai l'uomo della tua vita
  2. Vedo, vedo... che (avere) una grande vincita al gioco
  3. Questa carta mi dice che (vincere) il concorso che hai appena fatto
  4. Quest'altra carta mi dice che (sposarsi) al massimo entro tre anni
  5. Ah, qui vedo che (fare) un viaggio molto interessante
  6. Qui vedo che (andare) ad abitare in un'altra citta'
form protected using Google recaptcha

where the asterisk at the beginning of the line denotes an example answer (conversely than indicating a mandatory field in the 'inputs' type) and the square brackets in each row denote inline suggestions (here the foreseen input type is 'text' in all cases). Also note that the example answer contains the solution after the equal symbol, conversely from the other inline suggestions.


...either with framed suggestions like the following:

{{#CI form: title = Completa con i tempi dati al futuro semplice
|type = cloze test
| suggestions = fare, imparare, svegliarsi, imparare, andare, fare
| * Quando andrò in pensione [fare=farò] una crociera
| [] l'inglese
| [] in palestra
| [] jogging tutti i giorni
| [] a ballare il tango
| [] tardi la mattina
}}
Completa con i tempi dati al futuro semplice
imparareimparareandarefarefaresvegliarsi
  1. Quando andrò in pensione (fare) farò una crociera
  2. l'inglese
  3. in palestra
  4. jogging tutti i giorni
  5. a ballare il tango
  6. tardi la mattina
form protected using Google recaptcha

Note that the suggestion ('fare') related to the solution ('farò') put in the example answer, is automatically 'canceled' in the list of suggestions.

Also note that the Cloze tests above foresee solutions to be "transformed" relatively to the provided suggestions (specifically, the suggestions are provided in infinite form, and the solutions are expected to be in future simple) while of course the suggestions can be provided "as they are", where in this case it makes sense to only list them above the answers, like in the following example:

{{#CI form: type = cloze test 
| title = Completa come nell'esempio 
| suggestions = poca, nessun, poco, altra, molti, troppo, nessuno, tante, qualsiasi, qualche, ogni
| * C'è [altra] pasta ? Ho ancora fame
| Non c'è [] tavolo libero: aspettiamo o cambiamo ristorante?
| Ho bevuto [] spumante. Mi gira la testa.
| [] mattina la mia sveglia suona alle 7.00
| Se c'è un problema, chiamami a [] ora
| Ho scritto [] cartolina e poi sono uscito a comprare i francobolli
| Stefano legge [] romanzi gialli perché gli piace trovare il colpevole
| a [] persone passano il fine settimana fuori città
| C'è [] latte nel frigo, lo compri tu?
| Ho [] voglia di vedere mia cugina. Ultimamente non andiamo d'accordo.
| Bravo! Questo compito è perfetto. Non c'è [] sbaglio.
}}


Completa come nell'esempio
moltialtraqualsiasitantepocotropponessunqualchepocaogninessuno
  1. C'è (altra) altra pasta ? Ho ancora fame
  2. Non c'è tavolo libero: aspettiamo o cambiamo ristorante?
  3. Ho bevuto spumante. Mi gira la testa.
  4. mattina la mia sveglia suona alle 7.00
  5. Se c'è un problema, chiamami a ora
  6. Ho scritto cartolina e poi sono uscito a comprare i francobolli
  7. Stefano legge romanzi gialli perché gli piace trovare il colpevole
  8. a persone passano il fine settimana fuori città
  9. C'è latte nel frigo, lo compri tu?
  10. Ho voglia di vedere mia cugina. Ultimamente non andiamo d'accordo.
  11. Bravo! Questo compito è perfetto. Non c'è sbaglio.
form protected using Google recaptcha

(note that the input field in the example answer only contains 1 word, since an exact match is expected: i.e., the suggestion corresponds to the solution, without any "transformation")

Finally, "framed" suggestions (i.e. suggested words listed as argument of the parameter "suggestions") are automatically shuffled, thus it is a good practice to not put them in the right order, since the wiki-text is to be deemed open-source.


Nested form sections

CI forms are flexible enough to allow nested form sections of different kind, like in the following example:


Enrollment test
Why do you want to learn Italian?
  1. I want to work using Italian language
  2. I want to study using Italian language
  3. Cultural interest / personal knowledge
  4. interpersonal relationships *
  5. prospective stay in Italy
What is your profession / background ?
  • I'm a student or scholar
  • I'm an employee
  • I'm a professional or manager
  • other *
Do you have any experience of learning Italian language?
  • I haven't experience yet
  • Few personal attempts
  • I have taken private lessons during *
  • I have attended classes during *
form protected using Google recaptcha


where the form is built using the following model:


{{#CI form: title = Enrollment test 
| submit = abc@test.com
|

{{#CI form section: type = inputs
| first and last name [] *
| email [email] *
| phone [tel]
}}

{{#CI form section: ... }}

... [additional 'CI form sections']

}}

where in short the parser function 'CI form' becomes a container for the parser function 'CI form section' and the latter is characterized with a type (either 'inputs', 'multiple choice questions', or 'cloze test') a title, and the related content. (see table below List of parameters for all the accepted parameters)

This model allows a large combination of possible forms able to cover a correspondent wide range of needs, and, the most important, to create either a form with inputs, a multiple choice question test, or a Cloze test, in minutes, just filling-in with different contents predefined templates similar or identical to those shown as example.



List of parameters

attribute scope description
type CI form or CI section type of form or section: "inputs", "inputs responsive", "multiple choice" or "cloze test"
title CI form or CI section form or section title
submit CI form list of email addresses (comma separated) to which the filled-in form will be dispatched
success message CI form the message displayed after submission of the form if the form has been correctly sent
error message CI form the message displayed after submission of the form if there was any issue sending the form
suggestions CI form or CI section with type "cloze test" list of comma separated words to be used as a reference to complete the various answers and shown in a box above the answers
list-type CI form or CI section with type "multiple choice questions" the list type of the answers, can be "none", "ordered", "unordered", "letters", "number", or whatever value listed here
max answers CI form or CI section with type "multiple choice questions" maximum number of answers
form class CI form additional class of the form (for styling)

Known issues

Due to this Visual Editor's bug, if the 1st parameter after the function name is separated by a new line, Visual Editor will not recognize the template/parser function and will surround it with unwanted 'nowiki' tags. Therefore use always the following

{{#CI form: title = Completa con i tempi dati al futuro semplice
|...
}}

rather than the following

{{#CI form: 
title = Completa con i tempi dati al futuro semplice
|...
}}



Additional examples

Cloze test with sentences

Since version 1.1 CIForms allow multiple inputs in the answers of cloze and multiple choice tests. This allows to easily create a quiz like the following (adapted from this page)
Also note that html is allowed everywhere in the form definition, while wiki-text is only allowed in titles.


{{#CI form: title = Complete the text from the Wikipedia article on [[w: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.
}}
Complete the text from the Wikipedia article on Aristotle
  • 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.
form protected using Google recaptcha


Dialogues

Dialogues can be created using a cloze test with list-type = none with rows separated by line breaks, as follows. (note that html is allowed everywhere in the form definition, while wiki-text is only allowed in titles)

{{#CI form: title = Fare la conoscenza 
| type = cloze test | list-type = none |
<span style="font-weight:bold">A</span> Ciao, [] ti chiami? <br/>
<span style="font-weight:bold">B</span> Mi [] Lucia, piacere e tu come ti chiami? <br/>
<span style="font-weight:bold">A</span> Piacere Lucia io mi chiamo Paolo e[] di Firenze. E tu di dove sei?  <br/>
<span style="font-weight:bold">B</span> Io abito a Roma, ma io[] di un piccolo paese che si chiama Sutri. <br/>
<span style="font-weight:bold">A</span> Io sono nato a Firenze e [] a Firenze, vicino al Duomo di Santa Maria del Fiore. <br/>
<span style="font-weight:bold">B</span> Io abito a Roma da 7 anni. I miei genitori [] originari della Germania. Si sono trasferiti in Italia per lavoro. Io sono nata in Italia. <br/>
<span style="font-weight:bold">A</span> Lucia quanti anni [] ? <br/>
<span style="font-weight:bold">B</span> Io [] 35 anni e tu Paolo quanti anni hai? <br/>
<span style="font-weight:bold">A</span> Io ho 40 anni. [] fratelli o sorelle? <br/>
<span style="font-weight:bold">B</span> Si, [] un fratello che si chiama Alessandro e una sorella che si chiama Matilde. Loro [] più piccoli di me. Tu hai fratelli Paolo? <br/>
<span style="font-weight:bold">A</span> Io sono figlio unico, ma due anni fa sono diventato padre e [] 2 bambine, Ludovica e Federica <br/>
<span style="font-weight:bold">B</span> Cosa [] di lavoro Paolo? <br/>
<span style="font-weight:bold">A</span> Io sono un insegnante. E te che lavoro fai Lucia? <br/>
<span style="font-weight:bold">B</span> Io sono una cuoca. Adesso Paolo devo salutarti. Ci vediamo! Ciao <br/>
<span style="font-weight:bold">A</span> Ciao Lucia, è stato un piacere conoscerti, a presto <br/>
}}


Fare la conoscenza
  • A Ciao, ti chiami?
    B Mi Lucia, piacere e tu come ti chiami?
    A Piacere Lucia io mi chiamo Paolo e di Firenze. E tu di dove sei?
    B Io abito a Roma, ma io di un piccolo paese che si chiama Sutri.
    A Io sono nato a Firenze e a Firenze, vicino al Duomo di Santa Maria del Fiore.
    B Io abito a Roma da 7 anni. I miei genitori originari della Germania. Si sono trasferiti in Italia per lavoro. Io sono nata in Italia.
    A Lucia quanti anni  ?
    B Io 35 anni e tu Paolo quanti anni hai?
    A Io ho 40 anni. fratelli o sorelle?
    B Si, un fratello che si chiama Alessandro e una sorella che si chiama Matilde. Loro più piccoli di me. Tu hai fratelli Paolo?
    A Io sono figlio unico, ma due anni fa sono diventato padre e 2 bambine, Ludovica e Federica
    B Cosa di lavoro Paolo?
    A Io sono un insegnante. E te che lavoro fai Lucia?
    B Io sono una cuoca. Adesso Paolo devo salutarti. Ci vediamo! Ciao
    A Ciao Lucia, è stato un piacere conoscerti, a presto
form protected using Google recaptcha


Tables

Tables with input-cells can be created, as above, using a cloze test type, and then styling the table through html and a related stylesheet. Note that for the table below we use the parameter form class = table_test to add an additional class to the form, so that we can override the standard styles where needed. Also note the css rules between the tag <style> ... </style> visible in the source code of this page.


Completa la tabella inserendo le forme mancanti. Se non le conosci, guarda sul dizionario o chiedi aiuto a un compagno
form protected using Google recaptcha