From 5697f7c30a61c129d499e32cba106723c2e2df06 Mon Sep 17 00:00:00 2001 From: Markos Calderon Date: Thu, 18 Jul 2013 18:24:50 -0500 Subject: [PATCH] some small fixes in the polling workflow --- .../modules/polling/managers/PollingWindowManager.as | 2 +- .../modules/polling/model/PollingModel.as | 9 +++++++++ .../modules/polling/model/PollingViewModel.as | 4 ++-- .../modules/polling/views/CreatedPollsRenderer.mxml | 6 +++++- .../modules/polling/views/PollResultPanel.mxml | 12 ++++++++++-- 5 files changed, 27 insertions(+), 6 deletions(-) diff --git a/bigbluebutton-client/src/org/bigbluebutton/modules/polling/managers/PollingWindowManager.as b/bigbluebutton-client/src/org/bigbluebutton/modules/polling/managers/PollingWindowManager.as index f3df75ea50..8e6c8d89fa 100755 --- a/bigbluebutton-client/src/org/bigbluebutton/modules/polling/managers/PollingWindowManager.as +++ b/bigbluebutton-client/src/org/bigbluebutton/modules/polling/managers/PollingWindowManager.as @@ -42,7 +42,7 @@ package org.bigbluebutton.modules.polling.managers import org.bigbluebutton.modules.polling.views.PollCreateWindow; import org.bigbluebutton.modules.polling.views.PollMainWindow; import org.bigbluebutton.modules.polling.views.TakePollWindow; - import org.bigbluebutton.modules.polling.views.UpdatePollWindow; + import org.bigbluebutton.modules.polling.views.UpdatePollWindow; public class PollingWindowManager { private static const LOG:String = "Poll::PollingWindowManager - "; diff --git a/bigbluebutton-client/src/org/bigbluebutton/modules/polling/model/PollingModel.as b/bigbluebutton-client/src/org/bigbluebutton/modules/polling/model/PollingModel.as index ddbee91f22..2b01d80ce3 100755 --- a/bigbluebutton-client/src/org/bigbluebutton/modules/polling/model/PollingModel.as +++ b/bigbluebutton-client/src/org/bigbluebutton/modules/polling/model/PollingModel.as @@ -95,5 +95,14 @@ package org.bigbluebutton.modules.polling.model if (p.id == pollID) p.userResponded(); } } + + public function hasUserResponded(pollID:String):Boolean { + for (var i:int = 0; i < _polls.length; i++) { + var p:Poll = _polls.getItemAt(i) as Poll; + if (p.id == pollID) return p.hasResponded(); + } + return false; + } + } } \ No newline at end of file diff --git a/bigbluebutton-client/src/org/bigbluebutton/modules/polling/model/PollingViewModel.as b/bigbluebutton-client/src/org/bigbluebutton/modules/polling/model/PollingViewModel.as index 9e70b5c01e..6fcc1c6943 100755 --- a/bigbluebutton-client/src/org/bigbluebutton/modules/polling/model/PollingViewModel.as +++ b/bigbluebutton-client/src/org/bigbluebutton/modules/polling/model/PollingViewModel.as @@ -16,8 +16,8 @@ package org.bigbluebutton.modules.polling.model _model = model; } - public function hasUserResponded(pollID:String):void { - return _model.userHasResponded(pollID); + public function hasUserResponded(pollID:String):Boolean { + return _model.hasUserResponded(pollID); } public function getPoll(pollID:String):PollVO { diff --git a/bigbluebutton-client/src/org/bigbluebutton/modules/polling/views/CreatedPollsRenderer.mxml b/bigbluebutton-client/src/org/bigbluebutton/modules/polling/views/CreatedPollsRenderer.mxml index 221a1a4660..3b7460afce 100755 --- a/bigbluebutton-client/src/org/bigbluebutton/modules/polling/views/CreatedPollsRenderer.mxml +++ b/bigbluebutton-client/src/org/bigbluebutton/modules/polling/views/CreatedPollsRenderer.mxml @@ -7,6 +7,7 @@ import org.bigbluebutton.modules.polling.events.TakePollWindowEvent; import org.bigbluebutton.modules.polling.events.PollEvent; import org.bigbluebutton.util.i18n.ResourceUtil; + import org.bigbluebutton.modules.polling.events.PollMainWindowEvent; private static const LOG:String = "CreatedPollsRenderer - "; @@ -15,7 +16,10 @@ private function startPoll():void { trace(LOG + "::startPoll() " + data.id); var event:PollEvent = new PollEvent(PollEvent.START_POLL, data.id); - globalDispatch.dispatchEvent(event); + globalDispatch.dispatchEvent(event); + + //Close main window because we are just going to focus on the polling + globalDispatch.dispatchEvent(new PollMainWindowEvent(PollMainWindowEvent.CLOSE_WINDOW)); } private function deletePoll():void { diff --git a/bigbluebutton-client/src/org/bigbluebutton/modules/polling/views/PollResultPanel.mxml b/bigbluebutton-client/src/org/bigbluebutton/modules/polling/views/PollResultPanel.mxml index da7853a6de..f1f3bd14ba 100755 --- a/bigbluebutton-client/src/org/bigbluebutton/modules/polling/views/PollResultPanel.mxml +++ b/bigbluebutton-client/src/org/bigbluebutton/modules/polling/views/PollResultPanel.mxml @@ -12,6 +12,7 @@ import org.bigbluebutton.core.UsersUtil; import org.bigbluebutton.modules.polling.events.PollEvent; import org.bigbluebutton.modules.polling.model.PollingViewModel; + import org.bigbluebutton.modules.polling.events.PollResultWindowEvent; [Bindable] public var viewModel:PollingViewModel; [Bindable] public var pollID:String; @@ -33,8 +34,13 @@ } private function stop():void { + btnStop.visible = false; dispatchEvent(new PollEvent(PollEvent.STOP_POLL, pollID)); } + + private function close():void { + dispatchEvent(new PollResultWindowEvent()); + } ]]> @@ -48,9 +54,11 @@ - + - + + +