quick poll matches true/false, yes/no
This commit is contained in:
parent
6e3ea8dbb0
commit
e063eedab7
@ -30,8 +30,23 @@ package org.bigbluebutton.modules.polling.views {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private function parseSlideText(text:String):void {
|
private function parseSlideText(text:String):void {
|
||||||
var regEx:RegExp = new RegExp("\n[^\s][\.\)]", "g");
|
var numRegex:RegExp = new RegExp("\n[^\s][\.\)]", "g");
|
||||||
var matchedArray:Array = text.match(regEx);
|
var ynRegex:RegExp = new RegExp((ResourceUtil.getInstance().getString("bbb.polling.answer.Yes")+
|
||||||
|
"\s*/\s*"+
|
||||||
|
ResourceUtil.getInstance().getString("bbb.polling.answer.No")).toLowerCase());
|
||||||
|
var nyRegex:RegExp = new RegExp((ResourceUtil.getInstance().getString("bbb.polling.answer.No")+
|
||||||
|
"\s*/\s*"+
|
||||||
|
ResourceUtil.getInstance().getString("bbb.polling.answer.Yes")).toLowerCase());
|
||||||
|
var tfRegex:RegExp = new RegExp((ResourceUtil.getInstance().getString("bbb.polling.answer.True")+
|
||||||
|
"\s*/\s*"+
|
||||||
|
ResourceUtil.getInstance().getString("bbb.polling.answer.False")).toLowerCase());
|
||||||
|
var ftRegex:RegExp = new RegExp((ResourceUtil.getInstance().getString("bbb.polling.answer.False")+
|
||||||
|
"\s*/\s*"+
|
||||||
|
ResourceUtil.getInstance().getString("bbb.polling.answer.True")).toLowerCase());
|
||||||
|
|
||||||
|
text = text.toLowerCase();
|
||||||
|
|
||||||
|
var matchedArray:Array = text.match(numRegex);
|
||||||
LOGGER.debug("Parse Result: {0} {1}", [matchedArray.length, matchedArray.join(" ")]);
|
LOGGER.debug("Parse Result: {0} {1}", [matchedArray.length, matchedArray.join(" ")]);
|
||||||
if (matchedArray.length > 1) {
|
if (matchedArray.length > 1) {
|
||||||
var constructedLabel:String = ResourceUtil.getInstance().getString("bbb.polling.answer."+String.fromCharCode(65));
|
var constructedLabel:String = ResourceUtil.getInstance().getString("bbb.polling.answer."+String.fromCharCode(65));
|
||||||
@ -42,6 +57,18 @@ package org.bigbluebutton.modules.polling.views {
|
|||||||
label = constructedLabel;
|
label = constructedLabel;
|
||||||
name = "A-"+len;
|
name = "A-"+len;
|
||||||
visible = true;
|
visible = true;
|
||||||
|
} else if (text.search(ynRegex) > -1 || text.search(nyRegex) > -1) {
|
||||||
|
label = ResourceUtil.getInstance().getString("bbb.polling.answer.Yes")+
|
||||||
|
"/"+
|
||||||
|
ResourceUtil.getInstance().getString("bbb.polling.answer.No");
|
||||||
|
name = "YN";
|
||||||
|
visible = true;
|
||||||
|
} else if (text.search(tfRegex) > -1 || text.search(ftRegex) > -1) {
|
||||||
|
label = ResourceUtil.getInstance().getString("bbb.polling.answer.True")+
|
||||||
|
"/"+
|
||||||
|
ResourceUtil.getInstance().getString("bbb.polling.answer.False");
|
||||||
|
name = "TF";
|
||||||
|
visible = true;
|
||||||
} else {
|
} else {
|
||||||
visible = false;
|
visible = false;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user