/**
* /sQuiz/sQuiz_module_fillIn.js
* @version 1.0
* @desc sQuiz class for fillIns
* @author Fándly Gergő Zoltán (gergo@systemtest.tk, systemtest.tk)
* @copy 2017 Fándly Gergő Zoltán
* License:
sQuiz for creating small jQuery based quizs in an implementable way
Copyright (C) 2017 Fándly Gergő Zoltán
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see
");
fillable=fillable.replace(new RegExp(/\[\][^\[\]]+\[\/\]/g), replacer);
var fillers=[];
var res;
var reg=new RegExp(/\[\]([^\[\]]+)\[\/\]/g);
while((res=reg.exec(this.quiz.text))!==null){
fillers.push(""+res[1]+"");
this.answers.push(res[1]);
}
var fillerstr="";
while(fillers.length>0){
var index=Math.floor(Math.random()*fillers.length);
fillerstr+=fillers[index];
fillers.splice(index, 1);
}
this.container.html("
"+fillable+"