From aa16db56c4bec6411ca5c6b32ca85d4de36478d6 Mon Sep 17 00:00:00 2001 From: jtrobinson Date: Mon, 3 Jun 2013 09:53:13 -0700 Subject: [PATCH 01/11] Updated DataGrid for Presenter-side poll results --- .../polling/views/PollingStatsWindow.mxml | 86 +++++++++---------- 1 file changed, 39 insertions(+), 47 deletions(-) diff --git a/bigbluebutton-client/src/org/bigbluebutton/modules/polling/views/PollingStatsWindow.mxml b/bigbluebutton-client/src/org/bigbluebutton/modules/polling/views/PollingStatsWindow.mxml index ed9e90710a..b45adafe23 100755 --- a/bigbluebutton-client/src/org/bigbluebutton/modules/polling/views/PollingStatsWindow.mxml +++ b/bigbluebutton-client/src/org/bigbluebutton/modules/polling/views/PollingStatsWindow.mxml @@ -320,69 +320,61 @@ ]]> - - + + + focusEnabled="true"> + width="140" + /> + width="90%"> - - - - - - + + + + + + + + Date: Mon, 3 Jun 2013 09:54:19 -0700 Subject: [PATCH 02/11] Changed didNotVote() to reflect new results view --- .../polling/views/PollingStatsWindow.mxml | 21 ++++++------------- 1 file changed, 6 insertions(+), 15 deletions(-) diff --git a/bigbluebutton-client/src/org/bigbluebutton/modules/polling/views/PollingStatsWindow.mxml b/bigbluebutton-client/src/org/bigbluebutton/modules/polling/views/PollingStatsWindow.mxml index b45adafe23..ac9018744e 100755 --- a/bigbluebutton-client/src/org/bigbluebutton/modules/polling/views/PollingStatsWindow.mxml +++ b/bigbluebutton-client/src/org/bigbluebutton/modules/polling/views/PollingStatsWindow.mxml @@ -301,21 +301,12 @@ resultBox.validateNow(); } // end of function createResultsTable - private function didNotVote():void{ - var _tx:Text = new Text(); - var _votes:Text= new Text; - var _hb:HBox = new HBox(); - _tx.name = "optionNull"; - _tx.width = 200; - _tx.text = ResourceUtil.getInstance().getString('bbb.polling.stats.didNotVote'); - - _votes.name = "voteNull"; - _votes.width = 30; - _votes.text = trackingPoll.didNotVote.toString(); - - resultBox.addChild(_hb); - _hb.addChild(_tx); - _hb.addChild(_votes); + private function didNotVote():PollStatLineObject{ + var pso:PollStatLineObject = new PollStatLineObject(); + pso.answer = ResourceUtil.getInstance().getString('bbb.polling.stats.didNotVote'); + pso.votes = trackingPoll.didNotVote.toString(); + pso.percentage = ""; + return pso; } ]]> From a93af9dc30339c5e4258124f5ee67b7daa80bf55 Mon Sep 17 00:00:00 2001 From: jtrobinson Date: Mon, 3 Jun 2013 09:55:07 -0700 Subject: [PATCH 03/11] Changed createResultsTable() to reflect new results view --- .../polling/views/PollingStatsWindow.mxml | 56 ++----------------- 1 file changed, 4 insertions(+), 52 deletions(-) diff --git a/bigbluebutton-client/src/org/bigbluebutton/modules/polling/views/PollingStatsWindow.mxml b/bigbluebutton-client/src/org/bigbluebutton/modules/polling/views/PollingStatsWindow.mxml index ac9018744e..d2fc2b9404 100755 --- a/bigbluebutton-client/src/org/bigbluebutton/modules/polling/views/PollingStatsWindow.mxml +++ b/bigbluebutton-client/src/org/bigbluebutton/modules/polling/views/PollingStatsWindow.mxml @@ -247,59 +247,11 @@ dispatchEvent(stopPollEvent); } - // function receives Array.length and ArrayCollection private function createResultsTable(amount:uint, content:Array):void{ - var _tx: Text; - var _votes: Text; - var _percent: Text; - var _hb: HBox; - var _line: HRule; - var totalVotes:int = 0; - for (var n:int = 0; n < trackingPoll.votes.length; n++){ - totalVotes+= int(trackingPoll.votes[n]); - } - // delete existing rows - resultBox.removeAllChildren(); - // creating rows one by one - for (var i:int = 0; i < amount; i++) { - _tx = new Text(); - _votes= new Text; - _percent= new Text(); - _hb = new HBox(); - - _line = new HRule(); - _line.width = 290; - - _tx.name = "option" +i; - _tx.width = 200; - _tx.text =content[i].toString(); - - _votes.name = "votes" +i; - _votes.width = 30; - _votes.text = trackingPoll.votes[i]; - - _percent.name = "percent" +i; - _percent.width = 50; - - // Percentage is in terms of how many votes each option has in terms of total votes - if (totalVotes > 0){ - _percent.text = Math.round(100*(trackingPoll.votes[i]/totalVotes)) + "%"; - }else{ - // Prevents percentages from displaying misleading results before any votes come in, and from dividing by zero - _percent.text = " "; - } - - resultBox.addChild(_hb); - _hb.addChild(_tx); - _hb.addChild(_votes); - _hb.addChild(_percent); - - resultBox.addChild(_line); - } // end of loop - didNotVote(); - invalidateDisplayList(); - resultBox.validateNow(); - } // end of function createResultsTable + answerCollection = trackingPoll.generateStats(); + answerCollection.addItem(didNotVote()); + resultsGrid.dataProvider = answerCollection; + } private function didNotVote():PollStatLineObject{ var pso:PollStatLineObject = new PollStatLineObject(); From 6314e84b53ddc315ebc2d2a3be4d4b3f9703e9b8 Mon Sep 17 00:00:00 2001 From: jtrobinson Date: Mon, 3 Jun 2013 09:57:09 -0700 Subject: [PATCH 04/11] Added accessibilityName to setUrlBoxText() --- .../bigbluebutton/modules/polling/views/PollingStatsWindow.mxml | 1 + 1 file changed, 1 insertion(+) diff --git a/bigbluebutton-client/src/org/bigbluebutton/modules/polling/views/PollingStatsWindow.mxml b/bigbluebutton-client/src/org/bigbluebutton/modules/polling/views/PollingStatsWindow.mxml index d2fc2b9404..48f73347fb 100755 --- a/bigbluebutton-client/src/org/bigbluebutton/modules/polling/views/PollingStatsWindow.mxml +++ b/bigbluebutton-client/src/org/bigbluebutton/modules/polling/views/PollingStatsWindow.mxml @@ -151,6 +151,7 @@ public function setUrlBoxText():void{ webPollURLBox.text = webPollUrl; + webPollURLBox.accessibilityName = ResourceUtil.getInstance().getString('bbb.polling.stats.webPollBoxAccessName', [webPollUrl]); LogUtil.debug("webPollURLBox.Text is : " + webPollURLBox.text); if (UsersUtil.amIPresenter()) messageForRecording(ResourceUtil.getInstance().getString('bbb.polling.stats.webPollURL') + " " + webPollUrl); From 2499b26e680d68fca03da9099fed9f2cd8fffbc1 Mon Sep 17 00:00:00 2001 From: jtrobinson Date: Mon, 3 Jun 2013 10:04:54 -0700 Subject: [PATCH 05/11] Removed references to tabIndex for now; they will be put back in the branch for importing tab order. Other small adjustments. --- .../modules/polling/views/PollingStatsWindow.mxml | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/bigbluebutton-client/src/org/bigbluebutton/modules/polling/views/PollingStatsWindow.mxml b/bigbluebutton-client/src/org/bigbluebutton/modules/polling/views/PollingStatsWindow.mxml index 48f73347fb..9e3ce32d62 100755 --- a/bigbluebutton-client/src/org/bigbluebutton/modules/polling/views/PollingStatsWindow.mxml +++ b/bigbluebutton-client/src/org/bigbluebutton/modules/polling/views/PollingStatsWindow.mxml @@ -91,6 +91,9 @@ private var answersAC:ArrayCollection = new ArrayCollection(); private function init():void{ + + answerCollection = trackingPoll.generateStats(); + conference = UserManager.getInstance().getConference(); webPollText.visible = (UsersUtil.amIPresenter() && (!reviewing && trackingPoll.publishToWeb)); btnClosePoll.visible = UsersUtil.amIPresenter(); @@ -102,9 +105,6 @@ generate.poll = trackingPoll; dispatchEvent(generate); } - refreshTimer.addEventListener(TimerEvent.TIMER, autoRefresh); - refreshTimer.start(); - answersAC = trackingPoll.generateStats(); notified = false; } @@ -285,9 +285,9 @@ editable="false" text="" height="25" - width="95%" - tabIndex="{baseIndex+4}" - /> + width="95%" + /> + + > + Date: Mon, 3 Jun 2013 10:32:27 -0700 Subject: [PATCH 06/11] More minor adjustments to Statistics window to work with results view. --- .../bigbluebutton/modules/polling/views/PollingStatsWindow.mxml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bigbluebutton-client/src/org/bigbluebutton/modules/polling/views/PollingStatsWindow.mxml b/bigbluebutton-client/src/org/bigbluebutton/modules/polling/views/PollingStatsWindow.mxml index 9e3ce32d62..2194e5c8e8 100755 --- a/bigbluebutton-client/src/org/bigbluebutton/modules/polling/views/PollingStatsWindow.mxml +++ b/bigbluebutton-client/src/org/bigbluebutton/modules/polling/views/PollingStatsWindow.mxml @@ -88,7 +88,7 @@ private var webClosed:Boolean; private var notified:Boolean; private var refreshTimer:Timer = new Timer(1000); - private var answersAC:ArrayCollection = new ArrayCollection(); + [Bindable] private var answerCollection:ArrayCollection = new ArrayCollection(); private function init():void{ From 8c327de387b53ee4429fb2d0b9fe8afc2afbc4a9 Mon Sep 17 00:00:00 2001 From: jtrobinson Date: Mon, 3 Jun 2013 10:44:12 -0700 Subject: [PATCH 07/11] Modified createButtons() in Voting window. Commented out references to tabIndex and baseIndex, they will be enabled in a future branch dealing with tab order. --- .../polling/views/PollingViewWindow.mxml | 52 +++++++++++-------- 1 file changed, 29 insertions(+), 23 deletions(-) diff --git a/bigbluebutton-client/src/org/bigbluebutton/modules/polling/views/PollingViewWindow.mxml b/bigbluebutton-client/src/org/bigbluebutton/modules/polling/views/PollingViewWindow.mxml index 77d3db9b72..92b03d7359 100755 --- a/bigbluebutton-client/src/org/bigbluebutton/modules/polling/views/PollingViewWindow.mxml +++ b/bigbluebutton-client/src/org/bigbluebutton/modules/polling/views/PollingViewWindow.mxml @@ -80,16 +80,16 @@ errorMessage.text = ResourceUtil.getInstance().getString('bbb.polling.vote.error.check'); else errorMessage.text = ResourceUtil.getInstance().getString('bbb.polling.vote.error.radio'); - checkInstructions.visible = isMultiple; + ExternalInterface.call("addAlert", errorMessage.text); + //checkInstructions.visible = isMultiple; createButtons(answers.length,answers); invalidateDisplayList(); validateNow(); - var lines:int = (question.length / 28) + 1; + /*var lines:int = (question.length / 28) + 1; for(var s:String in answers){ lines = lines + ((s.length / 28) + 1); } - height = height + (lines * 50); - //questionBox. + height = height + (lines * 50);*/ } // This function will receive information and generate radiobuttons on fly @@ -100,35 +100,41 @@ var _tx: Text; var _hb: HBox; var _rb_group:RadioButtonGroup = new RadioButtonGroup(); + var totalOptions:int = content.length; // creating buttons one by one - for (var i:int = 0; i < amount; i++) { + for (var i:int = 0; i < amount; i++) { + var indicator:String = ResourceUtil.getInstance().getString('bbb.polling.vote.indicator', [i+1, totalOptions]) _tx = new Text(); _hb = new HBox(); _tx.name = "option" +i; _tx.width = 200; // assigning array element to text field - _tx.text =content[i].toString(); - answerBox.addChild(_hb); - + _tx.text = content[i].toString(); + answerBox.addChild(_hb); + // if global var isMultiple is true it means user wants checkboxes, //otherwise radiobutton (if multiple choices are allowed) if(isMultiple){ - _cb= new CheckBox(); - _cb.id = "answers"+i; - _cb.addEventListener(MouseEvent.CLICK, checkBoxClick); - // gap between the buttons - _cb.y=i*20; - // adding buttons to the Horizontal Box - _hb.addChild(_cb); - }else{ - _rb = new RadioButton(); - _rb.groupName = "answersGroup"; - _rb.name = content[i].toString(); // giving button a name of array elelment to process it easier later - _rb.id = "answers"+i; + _cb= new CheckBox(); + _cb.id = "answers"+i; + _cb.accessibilityName = indicator + content[i].toString(); + _cb.addEventListener(MouseEvent.CLICK, checkBoxClick); + // gap between the buttons + _cb.y=i*20; + //_cb.tabIndex = baseIndex++; + // adding buttons to the Horizontal Box + _hb.addChild(_cb); + }else{ + _rb = new RadioButton(); + _rb.groupName = "answersGroup"; + _rb.name = content[i].toString(); // giving button a name of array elelment to process it easier later + _rb.id = "answers"+i; _rb.addEventListener(MouseEvent.CLICK, radioClick); - _hb.addChild(_rb); - } - _hb.addChild(_tx); // adding text near button + _rb.accessibilityName = indicator + content[i].toString(); + //_rb.tabIndex = baseIndex++; + _hb.addChild(_rb); + } + _hb.addChild(_tx); // adding text near button } // end of loop answerBox.validateNow(); } // end of function createButtons From f0e660f3c134614f27f2971eed2e31653fa84a49 Mon Sep 17 00:00:00 2001 From: jtrobinson Date: Mon, 3 Jun 2013 10:47:50 -0700 Subject: [PATCH 08/11] Imported accessible voting interface. --- .../polling/views/PollingViewWindow.mxml | 54 ++++++++++--------- 1 file changed, 28 insertions(+), 26 deletions(-) diff --git a/bigbluebutton-client/src/org/bigbluebutton/modules/polling/views/PollingViewWindow.mxml b/bigbluebutton-client/src/org/bigbluebutton/modules/polling/views/PollingViewWindow.mxml index 92b03d7359..066fd120f2 100755 --- a/bigbluebutton-client/src/org/bigbluebutton/modules/polling/views/PollingViewWindow.mxml +++ b/bigbluebutton-client/src/org/bigbluebutton/modules/polling/views/PollingViewWindow.mxml @@ -155,8 +155,10 @@ dispatchEvent(voteEvent); closeWindow(); } - else + else{ errorMessage.visible = true; + ExternalInterface.call("addAlert", errorMessage.text); + } } // _vote // As the user clicks CheckBoxes, this function keeps a running tally of which boxes are and are not selected @@ -187,32 +189,32 @@ - - - - - - - + + + + + + + + + + Date: Mon, 3 Jun 2013 11:06:28 -0700 Subject: [PATCH 09/11] Restored algorithm to determine voting window size. --- .../modules/polling/views/PollingViewWindow.mxml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bigbluebutton-client/src/org/bigbluebutton/modules/polling/views/PollingViewWindow.mxml b/bigbluebutton-client/src/org/bigbluebutton/modules/polling/views/PollingViewWindow.mxml index 066fd120f2..8f13b3c144 100755 --- a/bigbluebutton-client/src/org/bigbluebutton/modules/polling/views/PollingViewWindow.mxml +++ b/bigbluebutton-client/src/org/bigbluebutton/modules/polling/views/PollingViewWindow.mxml @@ -85,11 +85,11 @@ createButtons(answers.length,answers); invalidateDisplayList(); validateNow(); - /*var lines:int = (question.length / 28) + 1; + var lines:int = (question.length / 28) + 1; for(var s:String in answers){ lines = lines + ((s.length / 28) + 1); } - height = height + (lines * 50);*/ + height = height + ((lines+1) * 45); } // This function will receive information and generate radiobuttons on fly From 55df6c1e26bab5606e40dfbe3c1ffee97839bd32 Mon Sep 17 00:00:00 2001 From: jtrobinson Date: Mon, 3 Jun 2013 11:27:42 -0700 Subject: [PATCH 10/11] Adjusted Voting window. Something is amiss. --- .../polling/views/PollingViewWindow.mxml | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/bigbluebutton-client/src/org/bigbluebutton/modules/polling/views/PollingViewWindow.mxml b/bigbluebutton-client/src/org/bigbluebutton/modules/polling/views/PollingViewWindow.mxml index 8f13b3c144..214eb16a27 100755 --- a/bigbluebutton-client/src/org/bigbluebutton/modules/polling/views/PollingViewWindow.mxml +++ b/bigbluebutton-client/src/org/bigbluebutton/modules/polling/views/PollingViewWindow.mxml @@ -189,7 +189,7 @@ - + @@ -215,12 +215,13 @@ - - - + + + \ No newline at end of file From e4eece5037f70a08ab0c6a93b17b7ec801e0cb6f Mon Sep 17 00:00:00 2001 From: jtrobinson Date: Tue, 4 Jun 2013 07:35:18 -0700 Subject: [PATCH 11/11] Solved the problem of the Voting window appearing incorrectly. Ready for the next branch of polling accessibility features: tab indexes. --- .../modules/polling/views/PollingViewWindow.mxml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/bigbluebutton-client/src/org/bigbluebutton/modules/polling/views/PollingViewWindow.mxml b/bigbluebutton-client/src/org/bigbluebutton/modules/polling/views/PollingViewWindow.mxml index 214eb16a27..74b016c852 100755 --- a/bigbluebutton-client/src/org/bigbluebutton/modules/polling/views/PollingViewWindow.mxml +++ b/bigbluebutton-client/src/org/bigbluebutton/modules/polling/views/PollingViewWindow.mxml @@ -76,6 +76,10 @@ } private function onCreationComplete():void{ + questionText.text = question; + if (isMultiple) + questionText.text += " " + ResourceUtil.getInstance().getString('bbb.polling.pollPreview.checkAll'); + if (isMultiple) errorMessage.text = ResourceUtil.getInstance().getString('bbb.polling.vote.error.check'); else