- implement stop poll

This commit is contained in:
Richard Alam 2013-07-11 21:39:26 +00:00
parent ef7c97d848
commit dc181437ae
3 changed files with 23 additions and 3 deletions

View File

@ -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 {

View File

@ -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) {

View File

@ -7,14 +7,21 @@
creationComplete="onCreationComplete()">
<mx:Script>
<![CDATA[
import mx.events.ItemClickEvent;
import mx.events.ItemClickEvent;
import org.bigbluebutton.core.UsersUtil;
import org.bigbluebutton.modules.polling.events.PollEvent;
import org.bigbluebutton.modules.polling.model.PollingViewModel;
[Bindable] public var viewModel:PollingViewModel;
[Bindable] public var pollID:String;
[Bindable] private var _showStopButton:Boolean = false;
private function onCreationComplete():void{
setCurrentState("PieChart");
if (UsersUtil.amIModerator() || UsersUtil.amIPresenter()) {
_showStopButton = true;
}
}
private function switchChart(event:ItemClickEvent):void {
@ -25,6 +32,10 @@
}
}
private function stop():void {
dispatchEvent(new PollEvent(PollEvent.STOP_POLL, pollID));
}
]]>
</mx:Script>
@ -39,7 +50,7 @@
<mx:Spacer width="5"/>
<mx:Label text="Time remaining:" fontSize="12" styleName="micSettingsWindowTitleStyle"/>
<mx:Spacer width="100%"/>
<mx:Button label="Stop"/>
<mx:Button label="Stop" visible="{_showStopButton}" click="stop()"/>
<mx:Spacer width="5"/>
</mx:HBox>
</mx:VBox>