匯入"GIFT"格式的檔案

要將文字檔匯入 Moodle 測驗模組時,GIFT是最具綜合性的匯入格式。它支援選擇題,是非題,簡答(填充題),配合題和數字題,以及填空式的克漏字題型。各種題型可以混雜在一個文字檔中,且這格式可以支援線上評語,試題名稱,和百分比加權計分。

您的文字檔的編碼方式必須和您安裝您的 Moodle 時所用的相同(本系統是UTF-8)。

這兒有一個試題文字檔的範例: gift/examples.txt.

試題類型

選擇題
就選擇題而言,錯誤答案前面要加波浪符號(~),而正確答案前面要加上等於符號(=)。

     誰被埋在格蘭特的墳墓裡?{~格蘭特 ~傑佛遜 =沒有人}

填空格式會在句子中間自動插入一可供填寫的底線(像這樣 _____)。 要使用填充格式,只要把答案放在該句子中,您要底線出現的地方。

     格蘭特 is {~buried =entombed ~living} in Grant's tomb.

只要答案是在結束的標點符號前出現,一個填空用的底線就會被插入。所有的題型都可以寫成填空的格式。

必須使用一個空白行 (按兩次return鍵) 來分隔試題。 為了閱讀清晰,每個選項可以寫成一行,甚至上下對齊,例如:

     美國的感恩節是在十一月的第{
         ~二
         ~三
         =四
     } 個星期四。
     
     日本文字原初是來自於哪一國家? {
         ~印度
         =中國
         ~韓國
         ~埃及}
	 

簡答題:
簡答題的所有可接受的答案,都要在前面加上等號(=),並以空格隔開。 答案裡不可以包含顎化符號(tilde,西班牙文字中 n 字上所附之符號)。

	 誰被埋在格蘭特的墳墓裡?{=沒有 =沒有人}

         二加二等於 {=四 =4}.
	 

如果只有一個正確答案,它可以不必在前面加上等號,但是不要與是非題混淆。

是非題:
在這種題型裡,答案要指出這敘述是真或假。 答案應該寫成{TRUE} 或{FALSE},或簡寫成{T} 或 {F}。

    格蘭特是被葬在格蘭特的墳墓裡。{F}

    太陽從東方升起。{T}
	 

配合題:
配題題中的每一配對要以等號(=)開頭,並以箭頭"->"(減號和大於)指向答案。至少要有三個配對。

	配合題的作答說明。 {
         =試題1 -> 答案1
         =試題2 -> 答案2
         =試題3 -> 答案3
         }
     
     請將下列國家與其首都對應起來。{
         =加拿大 -> 渥太華
         =義大利 -> 羅馬
         =日本   -> 東京
         =印度   -> 新德里
         }

配合題不能使用回饋,和選項加權法。

數字題:
數字題的答案部分必須以一數字符號(#)開始。 數字答案可以包括誤差範圍,它是寫在正確答案之後,並以冒號隔開。 舉例來說,如果正確答案是界於 1.5 和 2.5 之間的任何數值,那它可以寫成{#2:0.5}。 這表示正確答案是 2 而允許的誤差範圍是 0.5 (亦即,範圍從 1.5 到 2.5)。 如果沒有指定誤差範圍,那就會被當作是 0。

     Ulysses S. Grant 是哪一年出生? {#1822}

     圓周率(pi)的值是多少(取到小數第三位)? {#3.1415:0.0005}.

除此之外,數字答案也可以用下列格式指定一個範圍 {#最大值..最小值}.

     圓周率(pi)的值是多少(取到小數第三位)? {#3.141..3.142}.

Moodle的瀏覽器介面不支援多個數字答案,但 Moodle的程式碼可以,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.

     Ulysses S. Grant 是哪一年出生? {#
         =1822:0
         =%50%1822:2}

注意,因為 Moodle的瀏覽器的圖形使用介面不支援數字題的多重答案,所以透過Moodle是沒有辦法看到他們或編輯他們。 要改變數值答案的唯一方法,就是刪除這試題並重新匯入它 (或使用像是 phpMyAdmin 的程式)。

==其他選擇==

除了這些基本的試題類型之外,這一程式還提供下列選項: 補充文字說明,試題名稱,回饋,和以百分比表示的選項加權量。

補充文字說明:
不要匯入Moodle 的補充說明文字,也可以包含在文字檔理。 這將可以用來提供標題或更複雜的補充說明。 所有各行文字,若以雙斜線開頭(不算跳格鍵或空白鍵) 其後的文字,這程式將會忽視不處理。

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

試題簡稱:
一個試題的簡稱,是在試題前面加上文字,並在其前後各加上雙重冒號(::)。例如:

	 ::漢字起源::日本文字是起源於哪一國家? {=中國}

    ::感恩節日期::美國的感恩節假日是在十一月的第{~二 ~三 =四}個星期四。
	

如果沒有指定試題簡稱,預設是把整個試題當作簡稱。

回饋:
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!}
     
     Who's buried in Grant's tomb?{
     =no one#excellent answer!
     =nobody#excellent answer!}
     
     Grant is buried in Grant's tomb.{FALSE#No one is buried in Grant's tomb.}

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, the imported feedback is saved so that it will display if the student chose the wrong answer. So, in the last example above, the student would see the feedback only if they selected TRUE as their answer.

選項百分比加權:
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. Such answer-weights will calculate correctly (according to the value assigned when imported), and will appear normal to students taking the test. But such answer-weights will not display correctly to teachers when editing them through Moodle's Edit Question interface. The pull-down menu only allows certain fixed values, and if the answer-weight does not exactly match one of those predetermined values, then it will not display correctly. If you edit such a question through the browser interface, the answer weight will change to that displayed.

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. More information on text formats in Moodle.

[markdown]The *美國的感恩節*是在十一月的第幾個星期四舉行? {
         ~第二
         ~第三
         =第四
     } 

複選題:
當選擇題必須選取兩個或以上的選項,才能獲得該題完整的配分,就稱為複選題。你只要在各選項上指派不同比例的配分,就會啟動複選的功能,同時沒有單一的選項會得到完整的配分。

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

注意,這裡不需要在任何答案上使用等號(=),而且答案的總分部可以超過100%, 否則 Moodle 將會回報錯誤。 要避免學生勾選全部答案就會自動拿到 100% ,最好對錯誤的選項設定負的選項加權。

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

特殊符號 ~ = # { } :
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.

Other Options:
Short Answer questions can be made case sensitive by changing "0" to "1" in the following line:
$question->usecase = 0; // Ignore case

Other options are available through editing the import filter gift/format.php.

感謝

This filter was written through the collaboration of numerous members of the Moodle community. It was originally based on the missingword format, which included code from Martin Dougiamas and Thomas Robb. Paul Tsuchido Shew wrote this filter in December 2003 incorporating community suggestions for a more robust question format. The name was conceived as an acronym for "General Import Format Technology" or something like that, but it's too long for a simple filter like this, so it just GIFT.

GIFT filter and documentation by Paul Tsuchido Shew http://ac.shew.jp. Last updated 27 Feb 2004.

輔助說明檔案的索引
以English語言顯示輔助說明