Case Sensitivity in GIFT?

Case Sensitivity in GIFT?

by Joshua Paman -
Number of replies: 7

How do you make questions case-sensitive using GIFT?  

In the GIFT formatting it says

"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."

 

But I cant seem to make it work. Can anyone give me a sample question with Case Sensitivity?

Average of ratings: -
In reply to Joshua Paman

Re: Case Sensitivity in GIFT?

by Joseph Rézeau -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers Picture of Translators

Hi Joshua,

The documentation did not clearly explain that you have to change that line in your moodle/question/format/gift/format.php file (not in the GIFT text file that you import).

I have changed the documentation accordingly.

Joseph

In reply to Joseph Rézeau

Re: Case Sensitivity in GIFT?

by Kim Thurston -

I have made the change in the /gift/format.php file.  Then when I go in and check a question, the case sensitivity drop down still says "NO, case is unimportant."  Does this mean it is not working?  Should it be changed to "Yes, case must match."  

In reply to Kim Thurston

Re: Case Sensitivity in GIFT?

by Joseph Rézeau -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers Picture of Translators

@Kim, changing $question->usecase = 0; to $question->usecase = 1 in your moodle/question/format/gift/format.php file will only work for new imports of short answer questions in GIFT files, not for questions you imported before you made the change to your moodle/question/format/gift/format.php file.

Joseph

In reply to Joseph Rézeau

Re: Case Sensitivity in GIFT?

by Kim Thurston -

This is how it originally looked in the format.php file when I first opened it //$question->usecase = 0; // Ignore case

After removing the // in front of the "$question", it worked.  I had just over looked that.  So now it looks like this and works!

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