some small fixes in the polling workflow

This commit is contained in:
Markos Calderon 2013-07-18 18:24:50 -05:00
parent 1df0a4c4ba
commit 5697f7c30a
5 changed files with 27 additions and 6 deletions

View File

@ -95,5 +95,14 @@ package org.bigbluebutton.modules.polling.model
if (p.id == pollID) p.userResponded(); 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;
}
} }
} }

View File

@ -16,8 +16,8 @@ package org.bigbluebutton.modules.polling.model
_model = model; _model = model;
} }
public function hasUserResponded(pollID:String):void { public function hasUserResponded(pollID:String):Boolean {
return _model.userHasResponded(pollID); return _model.hasUserResponded(pollID);
} }
public function getPoll(pollID:String):PollVO { public function getPoll(pollID:String):PollVO {

View File

@ -7,6 +7,7 @@
import org.bigbluebutton.modules.polling.events.TakePollWindowEvent; import org.bigbluebutton.modules.polling.events.TakePollWindowEvent;
import org.bigbluebutton.modules.polling.events.PollEvent; import org.bigbluebutton.modules.polling.events.PollEvent;
import org.bigbluebutton.util.i18n.ResourceUtil; import org.bigbluebutton.util.i18n.ResourceUtil;
import org.bigbluebutton.modules.polling.events.PollMainWindowEvent;
private static const LOG:String = "CreatedPollsRenderer - "; private static const LOG:String = "CreatedPollsRenderer - ";
@ -16,6 +17,9 @@
trace(LOG + "::startPoll() " + data.id); trace(LOG + "::startPoll() " + data.id);
var event:PollEvent = new PollEvent(PollEvent.START_POLL, 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 { private function deletePoll():void {

View File

@ -12,6 +12,7 @@
import org.bigbluebutton.core.UsersUtil; import org.bigbluebutton.core.UsersUtil;
import org.bigbluebutton.modules.polling.events.PollEvent; import org.bigbluebutton.modules.polling.events.PollEvent;
import org.bigbluebutton.modules.polling.model.PollingViewModel; import org.bigbluebutton.modules.polling.model.PollingViewModel;
import org.bigbluebutton.modules.polling.events.PollResultWindowEvent;
[Bindable] public var viewModel:PollingViewModel; [Bindable] public var viewModel:PollingViewModel;
[Bindable] public var pollID:String; [Bindable] public var pollID:String;
@ -33,9 +34,14 @@
} }
private function stop():void { private function stop():void {
btnStop.visible = false;
dispatchEvent(new PollEvent(PollEvent.STOP_POLL, pollID)); dispatchEvent(new PollEvent(PollEvent.STOP_POLL, pollID));
} }
private function close():void {
dispatchEvent(new PollResultWindowEvent());
}
]]> ]]>
</mx:Script> </mx:Script>
@ -48,9 +54,11 @@
<mx:Spacer height="5"/> <mx:Spacer height="5"/>
<mx:HBox height="5%" width="100%" horizontalAlign="right"> <mx:HBox height="5%" width="100%" horizontalAlign="right">
<mx:Spacer width="5"/> <mx:Spacer width="5"/>
<mx:Label text="Time remaining:" fontSize="12" styleName="micSettingsWindowTitleStyle"/> <mx:Label text="Time remaining:" fontSize="12" styleName="micSettingsWindowTitleStyle" visible="false" />
<mx:Spacer width="100%"/> <mx:Spacer width="100%"/>
<mx:Button label="Stop" visible="{_showStopButton}" click="stop()"/> <mx:Button id="btnStop" label="Stop Polling" visible="{_showStopButton}" click="stop()"/>
<mx:Spacer width="5"/>
<mx:Button id="btnClose" label="Close" click="close()"/>
<mx:Spacer width="5"/> <mx:Spacer width="5"/>
</mx:HBox> </mx:HBox>
</mx:VBox> </mx:VBox>