Formato GIFT

De MoodleDocs


El formato GIFT le permite a Usted emplear un editor de texto para escribir preguntas de opción múltiple, falso-verdadero, respuesta corta, palabra faltante coincidente y preguntas numéricas, en un formato simple, que puede importarse. El formato GIFT también es un formato de archivo para exportación disponible en el Banco de preguntas. Este formato ha sido desarrollado con la comunidad de Moodle, pero otros programas y plataformas también lo soportan en mayor o menor grado.

  • Al crear un gran número de preguntas, GIFT puede proporcionar una manera rápida para añadir masivamente preguntas, ya sea hacia una categoría de pregunta, o hacia una lección.
  • En ocasiones es más facil el revisar las preguntas al verlas en un archivo GIFT.

Instrucciones generales

Debe dejarse al menos una línea vacía entre una pregunta y otra.

En el formato simple, primero está la pregunta, después se configuran las respuestas entre paréntesis, con un signo de igual (=) que indica cual es la respuesta correcta y una tilde (~) para las respuestas erróneas. Un signo de gato numérico (#) insertará una respuesta. Las preguntas pueden ponderarse al ponerles signos de porcentaje (%..%) alrededor de la ponderación. Los comentarios están precedidos por dos diagonales (//) y no son importados.

Aquí hay algunos ejemplos útiles GIFT examples que pueden importarse o pueden usarse como plantillas burdas. Muchos de los ejemplos de abajo usaron como punto de partida las preguntas de este archivo.

Codificación UTF-8

Cualquier archivo GIFT debe de estar codificado correctamente en UTF-8. Aunque Usted puede usar el programa Notepad de Microsoft para guardar su archivo en formato UTF-8 es más recomendable emplear un programa del tipo de Notepad ++. Nota: El formato ANSI solamente funcionará para Idiomas que no usen ningun caracter especial (como por ejemplo á, ñ, ä, ö, ü, æ, å, ø, œ o ß). Y no vaya a usar "Unicode" como formato porque este es en realidad UTF-16 y no funcionará. Vea Convertir archivos a UTF-8 para más información.

Símbolos en el formato

Aquí están algunos símbolos GIFT comunes y su empleo.

Símbolos Uso
// text Commentario hasta el final de la línea (opcional)
::title:: Título de la pregunta (opcional)
text Texto de la pregunta (se vuelve el título si no se espicifica un título)
[...format...] El formato del sguiente trozo de texto. Las opciones son [html], [moodle], [plain] y [markdown]. La opción por defecto es [moodle] para el texto de la pregunta, mientras que las otras partes de la pregunta por defecto toman el formato usado en el texto de la pregunta.
{ Inicio de respuesta(s) -- si no hubiera respuestas, el texto es una descripción de las preguntas siguientes
{T} o {F} Respuesta Verdadera (True) o Falsa, también {TRUE} and {FALSE}
{ ... =right ... } Respuesta correcta para opción múltiple, (¿respuestas múltiples? -- vea los comentarios a la página en idioma inglés) o llene-el-hueco
{ ... ~wrong ... } Respuesta incorrecta para opción múltiple o respuesta múltiple
{ ... =item -> match ... } Respuesta para preguntas de relacionar columnas (emparejamiento)
#texto de retrolimentación Retroalimentación a la respuesta para respuesta precedente múltiple, llenar-el-hueco o numérica
####retroalimentación general Retroalimentación general
{# Inicio de respuesta(s) numérica(s)
respuesta:tolerancia Respuesta numérica aceptada con rango ± de tolerancia
low..high Valores de los rangos inferior y superior de respuesta numérica aceptada
=%n%respuesta:tolerancia n porcentaje de crédito para uno de los rangos numéricos múltiples dentro de la tolerancia para la respuesta
} Final de respuesta(s)
caracter \ El caracter de barra diagonal invertida es un escape del significado especial de ~, =, #, {, }, y :
\n Pone una línea nueva dentro del texto de la pregunta -- las líneas vacías delimitan las preguntas

Aquí hay algunos ejemplos rápídos:

Nota: Pendiente de Traducir. ¡Anímese a traducir esta página!.     ( y otras páginas pendientes)

// falso/verdadero
::Q1:: 1+1=2 {T}

// opción múltiple con retroalimentación especificada para respuestas correctas e incorrectas
::Q2:: ¿Qué color hay entre el naranja y el verde en el espectro? 
{ =Amarillo# correcto; bien! ~rojo # incorrecto, es amarillo ~azul # incorrecto, es amarillo }

// llenar-el-hueco
::Q3:: Dos más {=dos =2} es igual a cuatro.

// relacionar (emparejar)
::Q4:: ¿Qué animal come cual comida? { =gato -> comida de gato =perro -> comida de perro }

// pregunta de rango matemático
::Q5:: What is a number from 1 to 5? {#3:2}

// math range specified with interval end points
::Q6:: What is a number from 1 to 5? {#1..5}
// translated on import to the same as Q5, but unavailable from Moodle question interface

// respuestas numéricas múltiples con crédito parcial y retroalimentación
::Q7:: ¿En cuial año nació Ulysses S. Grant? {#
         =1822:0      # Correcto! Puntuación completa.
         =%50%1822:2  # Nació en 1822. Medio punto por respuesta cercana.
}

// ensayo
::Q8:: ¿Cómo estás? {}

Formato de los símbolos explicado

El formato para la pregunta de opción múltiple tiene una línea de comentario // para la pregunta, cuando Moodle la exporte, aquí aparecerá el número identificador único (ID) de la pregunta. El primer conjunto de  :: precede al título de la pregunta.

El segundo conjunto de :: precede a la pregunta misma. El primer { indica el principio de las respuestas. La respuesta correcta está precedida por un signo de = y las respuestas incorrectas están precedidas por un signo ~. Las respuestas del profesor tienen un signo # al frente. La pregunta termina con un caracter de } y después va una línea vacía. NOTA observe que son { } y no confundirlos con ( ) paréntesis! Usualmente estos caracteres poco comunes se obtienen con ayuda de la tecla [AltGr].

//Línea de comentario 
::Título de la pregunta 
:: Pregunta {
=Una respuesta correcta
~Respuesta equivocada1
#A comentario a la respuesta equivocada1
~Respuesta equivocada2
#A comentario a la respuesta equivocada2
~Respuesta equivocada3
#A comentario a la respuesta equivocada3
~Respuesta equivocada4
#A comentario a la respuesta equivocada4
}

El formato más corto para una pregunta de opción múltiple es:

Pregunta{= A Respuesta Correcta ~Respuesta equivocada1 ~Respuesta equivocada2 ~Respuesta equivocada3 ~Respuesta equivocada4 }
Sugerencia: If you don't specify a question title the WHOLE question will be used as the title at the time of import into Moodle. There are pros and cons to allowing this to happen.
    • Cons: This can add a lot of unnecessary words. This can include characters which might confuse the export GIFT process.
    • Pros: On the other hand. if the start of each question is different, it can make finding a single question easier in a category list of questions. It will save you typing. Having the same title for every question is a very bad idea.

Ejemplos de formato de preguntas

There are several ways to use a text editor to write a GIFT format. We will try to show the simple version for example and in some formats we will introduce some more complex features that can be imported into many Moodle Question formats.

Opción múltiple

For multiple choice questions, wrong answers are prefixed with a tilde (~) and the correct answer is prefixed with an equal sign (=).

Here is a simple acceptable GIFT multiple choice format:

Who's buried in Grant's tomb?{=Grant ~no one ~Napoleon ~Churchill ~Mother Teresa }

Here is a longer format that uses most of the GIFT elements:

 // question: 1 name: Grants tomb
::Grants tomb::Who is buried in Grant's tomb in New York City? {
=Grant
~No one
#Was true for 12 years, but Grant's remains were buried in the tomb in 1897
~Napoleon
#He was buried in France
~Churchill
#He was buried in England
~Mother Teresa
#She was buried in India
}

Opción múltiple con varias respuestas correctas

That is, using checkboxes, not radio buttons:

What two people are entombed in Grant's tomb? {
   ~%-100%No one
   ~%50%Grant
   ~%50%Grant's wife
   ~%-100%Grant's father
}

Falso-Verdadero

In this question-type the answer indicates whether the statement is true or false. The answer should be written as {TRUE} or {FALSE}, or abbreviated to {T} or {F}.

// question: 0 name: TrueStatement using {T} style
::TrueStatement about Grant::Grant was buried in a tomb in New York City.{T}

// question: 0 name: FalseStatement using {FALSE} style
::FalseStatement about sun::The sun rises in the West.{FALSE}

Respuesta corta

Answers in Short Answer question-type are all prefixed by an equal sign (=), indicating that they are all correct answers. The answers must not contain a tilde.

Here are two examples using the simple method showing possible right answers for credit.

Who's buried in Grant's tomb?{=Grant =Ulysses S. Grant =Ulysses Grant}
Two plus two equals {=four =4}

If there is only one correct Short Answer, it may be written without the equal sign prefix, as long as it cannot be confused as True-False.

Relacionar columnas (emparejamiento)

Matching pairs begin with an equal sign (=) and are separated by this symbol "->". There must be at least three matching pairs.

Match the following countries with their corresponding capitals. {
   =Canada -> Ottawa
   =Italy  -> Rome
   =Japan  -> Tokyo
   =India  -> New Delhi
   }

Matching questions do not support feedback or percentage answer weights.

Palabra faltante

The Missing Word format automatically inserts a fill-in-the-blank line (like this _____) in the middle of the sentence. To use the Missing Word format, place the answers where you want the line to appear in the sentence.

Moodle costs {~lots of money =nothing ~a small amount} to download from moodle.org.

If the answers come before the closing punctuation mark, a fill-in-the-blank line will be inserted for the "missing word" format. All question types can be written in the Missing Word format.

There must be a blank line (double carriage return) separating questions. For clarity, the answers can be written on separate lines and even indented. Some examples:

Mahatma Gandhi's birthday is an Indian holiday on  {
~15th
~3rd
=2nd
} of October.

Since {
  ~495 AD
  =1066 AD
  ~1215 AD
  ~ 43 AD
}
the town of Hastings England has been "famous with visitors".

Preguntas numéricas

The answer section for Numerical questions must start with a number sign (#). Numerical answers can include an error margin, which is written following the correct answer, separated by a colon. So for example, if the correct answer is anything between 1.5 and 2.5, then it would be written as follows {#2:0.5}. This indicates that 2 with an error margin of 0.5 is correct (i.e., the span from 1.5 to 2.5). If no error margin is specified, it will be assumed to be zero.

Here is a simple numerical format question. It will accept a range of 5 years.

When was Ulysses S. Grant born?{#1822:5}

It is a good idea to check the margins of the range, 3.141 is not counted as correct and 3.142 is considered in the range.

What is the value of pi (to 3 decimal places)? {#3.14159:0.0005}.

Optionally, numerical answers can be written as a span in the following format {#MinimumValue..MaximumValue}.

What is the value of pi (to 3 decimal places)? {#3.141..3.142}.

Moodle's browser interface does not support multiple numerical answers, but Moodle's code can and so does GIFT. This can be used to specify numerical multiple spans, and can be particularly usefully when combined with percentage weight grades. If multiple answers are used, they must be separated by an equal sign, like short answer questions.

When was Ulysses S. Grant born? {#
   =1822:0
   =%50%1822:2
}

Note that since Moodle's browser GUI didn't support multiple answers for Numerical questions, there's no way in older Moodle versions to see them or edit them through Moodle. The only way to change a numerical answer beyond the first, is to delete the question and re-import it (or use something like phpMyAdmin). But better would be to upgrade your Moodle to at least 1.9.

Ensayo

An essay question is simply a question with an empty answer field. Nothing is permitted between the curly braces at all.

Write a short biography of Dag Hammarskjöld. {}

Descripción

A description "question" has no answer part at all

You can use your pencil and paper for these next math questions.

Opciones

In addition to these basic question types, this filter offers the following options: line comments, question name, feedback and percentage answer weight.

Comentarios en línea

Comments that will not be imported into Moodle can be included in the text file. This can be used to provide headers or more information about questions. All lines that start with a double backslash (not counting tabs or spaces) will be ignored by the filter.

// Subheading: Numerical questions below
What's 2 plus 2? {#4}

Comments will be exported from Moodle and will include the unique question id. The above question after it was imported and then exported from Moodle:

// question: 914  name: What's 2 plus 2? 
::What's 2 plus 2?::What's 2 plus 2?{#
    =4:0#
}

Nombre de la pregunta

A question name can be specified by placing it first and enclosing it within double colons (::...::).

::Kanji Origins::Japanese characters originally
came from what country? {=China}
::Thanksgiving Date::The American holiday of Thanksgiving is 
celebrated on the {~second ~third =fourth} Thursday of November.

If no question name is specified, the entire question will be used as the name by default.

Retroalimentación

Feedback can be included for each answer by following the answer with a number sign (# also known as a hash mark) and the feedback.

What's the answer to this multiple-choice question? {
  ~wrong answer#feedback comment on the wrong answer
  ~another wrong answer#feedback comment on this wrong answer
  =right answer#Very good!
}
 
//From The Hitchhiker's Guide to the Galaxy
Deep Thought said " {
  =forty two#Correct according to The Hitchhiker's Guide to the Galaxy!
  =42#Correct, as told to Loonquawl and Phouchg
  =forty-two#Correct!
}  is the Ultimate Answer to the Ultimate Question of Life, The Universe, and Everything."

   42 is the Absolute Answer to everything.{
FALSE#42is the Ultimate Answer.#You gave the right answer.}

For Multiple Choice questions, feedback is displayed only for the answer the student selected. For short answer, feedback is shown only when students input the corresponding correct answer. For true-false questions, there can be one or two feedback strings. The first is shown if the student gives the wrong answer. The second if the student gives the right answer.

Ponderaciones de porcentaje de respuesta

Percentage answer weights are available for both Multiple Choice and Short Answer questions. Percentage answer weights can be included by following the tilde (for Multiple Choice) or equal sign (for Short Answer) with the desired percent enclosed within percent signs (e.g., %50%). This option can be combined with feedback comments.

Difficult question.{~wrong answer ~%50%half credit answer =full credit answer}

::Jesus' hometown::Jesus Christ was from {
   ~Jerusalem#This was an important city, but the wrong answer.
   ~%25%Bethlehem#He was born here, but not raised here.
   ~%50%Galilee#You need to be more specific.
   =Nazareth#Yes! That's right!
}.
    
::Jesus' hometown:: Jesus Christ was from {
   =Nazareth#Yes! That's right!
   =%75%Nazereth#Right, but misspelled.
   =%25%Bethlehem#He was born here, but not raised here.
}

Note that the last two examples are essentially the same question, first as multiple choice and then as short answer.

Note that it is possible to specify percentage answer weights that are NOT available through the browser interface. The Match Grades drop-down on the import page determines how these are handled. You can either request that an error be reported or that the answer weight be adjusted to the nearest valid answer weight.

Specify text-formatting for the question The question text (only) may have an optional text format specified. Currently the available formats are moodle (Moodle Auto-Format), html (HTML format), plain (Plain text format) and markdown (Markdown format). The format is specified in square brackets immediately before the question text. See Formateando texto for further information.

[markdown]The *American holiday of Thanksgiving* is celebrated on the {
   ~second
   ~third
   =fourth
} Thursday of November.

Respuestas múltiples

The Multiple Answers option is used for multiple choice questions when two or more answers must be selected in order to obtain full credit. The multiple answers option is enabled by assigning partial answer weight to multiple answers, while allowing no single answer to receive full credit.

What two people are entombed in Grant's tomb? {
   ~No one
   ~%50%Grant
   ~%50%Grant's wife
   ~Grant's father
}

Note that there is no equal sign (=) in any answer and the answers should total no more than 100%, otherwise Moodle will return an error. To avoid the problem of students automatically getting 100% by simply checking all of the answers, it is best to include negative answer weights for wrong answers.

What two people are entombed in Grant's tomb? {
   ~%-50%No one
   ~%50%Grant
   ~%50%Grant's wife
   ~%-50%Grant's father
}

Caracteres especiales ~ = # { }

These symbols ~ = # { } : control the operation of this filter and cannot be used as normal text within questions. Since these symbols have a special role in determining the operation of this filter, they are called "control characters." But sometimes you may want to use one of these characters, for example to show a mathematical formula in a question. The way to get around this problem is "escaping" the control characters. This means simply putting a backslash (\) before a control character so the filter will know that you want to use it as a literal character instead of as a control character. For example:

Which answer equals 5? {
   ~ \= 2 + 2
   = \= 2 + 3
   ~ \= 2 + 4
}
::GIFT Control Characters::
Which of the following is NOT a control character for the GIFT import format? {
  ~ \~     # \~ is a control character.
  ~ \=     # \= is a control character.
  ~ \#     # \# is a control character.
  ~ \{     # \{ is a control character.
  ~ \}     # \} is a control character.
  = \      # Correct! \ (backslash) is not a control character. BUT,
             it is used to escape the control characters.
}

When the question is processed, the backslash is removed and is not saved in Moodle.

Especificar Categorías

It is possible to change the category into which the questions are added within the GIFT file. You can change the category as many times as you wish within the file. All questions after the modifier up to the next modifier or the end of the file will be added to the specified category. Up to the first category modifier the category specified on the import screen will be used. Note that for this to work the from file: box must be ticked on the import screen.

To include a category modifier include a line like this (with a blank line before and after):

$CATEGORY: tom/dick/harry

or simply

$CATEGORY: mycategory

...the first example specifies a path of nested categories. In this case the questions will go into harry. The categories are created if they do not exist.

To find out how your categories are organized, you might try exporting some questions including category data first and check the exported GIFT formatted file. The lowest level of system context might give you something like $CATEGORY: $system$/....

Hacer las preguntas sensibles a MAYÚSCULAS/minúsculas

Short Answer questions can be made case sensitive by changing "0" to "1" in the following line of your moodle/question/format/gift/format.php file:

$question->usecase = 0; // Ignore case

Sugerencias y Trucos

  • Use the ::title:: at the beginning of every question to organize your questions when Moodle presents a list or exports them as another GIFT file. When the title is left blank, Moodle will put the beginning of the question as the title. Some teachers want to see something like "001 LIT101 Poe ref Purloin Letter" or "The Purloin Letter was written by (AmLit pg 254)" in the title.
  • You can specify markup if you need to format the question by setting [html], [moodle], [plain] or [markdown] just before the question text. See more about this in the reference pdf below.
  • In the Lesson module, in a question page, correct answers jump by default to Next page and incorrect answers jump to This page (i.e. student has to "try again"). When importing from a GIFT format file, this is exactly the mechanism which is used.
  • If you want a student to be taken directly from one question to the next irrespective of their answer being correct or incorrect: in the Lesson Settings, set Maximum number of attempts: to 1.
    • Please note, however, that a message "correct / incorrect" will still be displayed to the student upon answering each question. If you do not want this (default) feedback message to be displayed then enter your own feedback message (i.e. "continue", "---", etc.)
    • In case you want no visible message displayed then enter a non-breaking space as feedback. Moodle will not put it's automatic response because it sees the blank space. To do this, put a # after the answer and write Nbsp.png (without spaces between these characters).
  • Need to use a special GIFT character in your question or answer? Put a \ in front of the GIFT character.
    • For example if you want to use curly braces, { or }, or equal sign, =, or # or ~ in a GIFT file (in a math question including TeX expressions) you must "escape" them by preceding them with a \ directly in front of each { or } or =. It is possible to use a replace program/macro/editor filter to do this conversion before importing to Moodle.
  • Want to change T/F type questions to multiple choice? Consider exporting the T/F questions as a GIFT file, then using a text editor to replace the (T) with (=True ~False). Perhaps change the title slightly so you will recognize the new questions.
  • Alphabetic case-sensitive comparison is disabled by default. If you need case-sensitive comparison for short answer questions (an unusual need), precede them with:
  $question->usecase = 1;

surrounded by blank lines.

Herramientas de procesadores de texto y hojas-de-cálculo que crean GIFTs

Varios contribuyentes han usado macros para generar archivos GIFT a partir de programas populares más familiares.

  • Hay macros de Word disponibles, para crear fácilmente archivos GIFT. Vea este hilo del foro para enlaces hacia archivos descargables para diferentes versiones de Word.
  • Hay varias hojas de cálculo de Excel para generar archivos GIFT. Varias personas han complementado el trabajo de otras:
  • Hay un proyecto, Plantillas para Libre Office (Libre Office templates), para generar archivos GIFT en Writer. Se encuentra en

OOo Creación de preguntas de cuestionario Moodle con el paquete LibreOffice

  • Hay plantillas de Open Office para generar archivos GIFT en Writer. Están localizadas en el foro en inglés de Quiz en OOo template to write exams and convert to GIFT format thread.
    • La más reciente para OO 2.x is "OOo2GIFT_Template_05.zip" publicada el 17 de diciembre del 2005 por Enrique Castro.
    • Una versión más antigua es "GIFT_template_OOo.zip" publicada el 22 Marzo del 2005 por Enrique Castro.
  • Existe un generador en-línea fácil de usar para preguntas de opción múltiple en a4esl.org. Aquí Usted escribe su(s) pregunta(s) sin marcas de formateo, selecciona Moodle y presiona el botón para generar el examen. Esto crea texto formateado GIFT que puede entonces pegarse a un archivo que será importado en Moodle.
    • El formato inicial requiere menos golpes de tecla (usa posición de línea y retorno-del-carro) que el formato GIFT, por lo que Usted ahorrará tiempo y tendrá menor riesgo de crear datos inválidos.
    • Enlace hacia una antigua plantilla para autoría para Microsoft Word
    • Convertidor Moodle XML [1]
    • Librería de valoración de formato GIFT para Ruby (GIFT format parser library in Ruby) [2]

Formato GIFT con multimedios (imágenes, sonido...)

El plugin opcional de GIFT with medias es un formato para importar similar a GIFT, pero en lugar de usar un archivo de texto, importa un archivo ZIP que contiene el archivo del texto GIFT y además los archivos de multimedios (imágenes, sonidos, etc, ...).

Vea también

Enlaces externos