From dc181437aed0fcfdb9480253a7b19a8438889f8a Mon Sep 17 00:00:00 2001 From: Richard Alam Date: Thu, 11 Jul 2013 21:39:26 +0000 Subject: [PATCH] - implement stop poll --- .../polling/managers/PollingWindowManager.as | 7 ++++++- .../modules/polling/model/PollingViewModel.as | 4 ++++ .../modules/polling/views/PollResultPanel.mxml | 15 +++++++++++++-- 3 files changed, 23 insertions(+), 3 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 c8abcd4560..f3df75ea50 100755 --- a/bigbluebutton-client/src/org/bigbluebutton/modules/polling/managers/PollingWindowManager.as +++ b/bigbluebutton-client/src/org/bigbluebutton/modules/polling/managers/PollingWindowManager.as @@ -117,7 +117,12 @@ package org.bigbluebutton.modules.polling.managers } public function handlePollStoppedEvent(event:PollEvent):void { - + if (! UsersUtil.amIModerator() && ! UsersUtil.amIPresenter()) { + if (! _viewModel.hasUserResponded(event.pollID)) { + closeWindow(takePollWindow); + openPollResultsWindow(event.pollID); + } + } } public function handleUserRespondedEvent(event:PollEvent):void { 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 1c80f6f00c..9e70b5c01e 100755 --- a/bigbluebutton-client/src/org/bigbluebutton/modules/polling/model/PollingViewModel.as +++ b/bigbluebutton-client/src/org/bigbluebutton/modules/polling/model/PollingViewModel.as @@ -16,6 +16,10 @@ package org.bigbluebutton.modules.polling.model _model = model; } + public function hasUserResponded(pollID:String):void { + return _model.userHasResponded(pollID); + } + public function getPoll(pollID:String):PollVO { var poll:Poll = _model.getPoll(pollID); if (poll != null) { 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 42c7754cae..da7853a6de 100755 --- a/bigbluebutton-client/src/org/bigbluebutton/modules/polling/views/PollResultPanel.mxml +++ b/bigbluebutton-client/src/org/bigbluebutton/modules/polling/views/PollResultPanel.mxml @@ -7,14 +7,21 @@ creationComplete="onCreationComplete()"> @@ -39,7 +50,7 @@ - +