Source: site.view [edit]
Function name: fillInTheBlanksMultipleChoice
Arguments: question,answers
Description: For a fill in the blanks question, chooses from among multiple answers
Page type: webl
Render function:  
Module: sataire

Page source:

var questionList = Str_Split("|" + question + "|", "_");

var putTogether = fun(questionList, answerList)
   var s = "";
   every q in questionList do
      s = s + q;
      if (answerList != []) then
          s = s + First(answerList);
          answerList = Rest(answerList)
      end
   end;
   if (answerList != []) then
       s = s + First(answerList)
   end;
   s = Wub_ReplaceAll(s, "|", "");
   s
end;

var res = [];
every answer in answers do
     var answerList = Str_Split(answer, ";");
     res = res + [putTogether(questionList, answerList)]
end;

res;