open take poll window

This commit is contained in:
Richard Alam 2013-06-29 21:53:17 -07:00
parent 4002b3d2d1
commit 0b16f969ee
10 changed files with 129 additions and 200 deletions

View File

@ -0,0 +1,21 @@
package org.bigbluebutton.modules.polling.events
{
import flash.events.Event;
public class OpenTakePollWindowEvent extends Event
{
public static const OPEN_TAKE_POLL_WINDOW:String = "open take poll window event";
private var _pollID:String;
public function OpenTakePollWindowEvent(pollID:String)
{
super(OPEN_TAKE_POLL_WINDOW, true, false);
_pollID = pollID;
}
public function get pollID():String {
return _pollID;
}
}
}

View File

@ -19,14 +19,10 @@
package org.bigbluebutton.modules.polling.managers
{
import com.asfusion.mate.events.Dispatcher;
import flash.events.FocusEvent;
import flash.events.IEventDispatcher;
import flash.events.TimerEvent;
import flash.utils.Timer;
import mx.collections.ArrayCollection;
import mx.managers.IFocusManager;
import org.bigbluebutton.common.IBbbModuleWindow;
@ -38,6 +34,7 @@ package org.bigbluebutton.modules.polling.managers
import org.bigbluebutton.modules.polling.events.OpenPollResultWindowEvent;
import org.bigbluebutton.modules.polling.events.OpenPollUpdateWindowEvent;
import org.bigbluebutton.modules.polling.events.OpenSavedPollEvent;
import org.bigbluebutton.modules.polling.events.OpenTakePollWindowEvent;
import org.bigbluebutton.modules.polling.events.PollGetTitlesEvent;
import org.bigbluebutton.modules.polling.events.PollRefreshEvent;
import org.bigbluebutton.modules.polling.events.PollingInstructionsWindowEvent;
@ -62,19 +59,19 @@ package org.bigbluebutton.modules.polling.managers
public class PollingWindowManager {
// Injected by Mate
public var model:PollingModel;
public var dispatcher:IEventDispatcher;
// Injected by Mate
public var model:PollingModel;
public var dispatcher:IEventDispatcher;
private var _viewModel:PollingViewModel;
private var _viewModel:PollingViewModel;
private var pollingWindow:PollingViewWindow;
private var statsWindow:PollingStatsWindow;
private var updatePollWindow:UpdatePollWindow = new UpdatePollWindow();
private var takePollWindow:TakePollWindow = new TakePollWindow();
private var updatePollWindow:UpdatePollWindow = new UpdatePollWindow();
private var takePollWindow:TakePollWindow = new TakePollWindow();
private var pollMainWindow:PollMainWindow = new PollMainWindow();
private var createPollWindow:CreatePollWindow;
private var resultsWindow:DisplayResultWindow = new DisplayResultWindow();
private var createPollWindow:CreatePollWindow;
private var resultsWindow:DisplayResultWindow = new DisplayResultWindow();
private var testCreateWindow:PollCreateWindow;
private var service:PollingService;
@ -90,15 +87,22 @@ package org.bigbluebutton.modules.polling.managers
public static const LOG:String = "[Polling::PollingWindowManager] ";
public function initialize():void {
_viewModel = new PollingViewModel(model);
_viewModel.addSamplePolls();
_viewModel = new PollingViewModel(model);
_viewModel.addSamplePolls();
}
public function handleOpenPollMainWindowEvent():void{
pollMainWindow.viewModel = _viewModel;
pollMainWindow.viewModel = _viewModel;
openWindow(pollMainWindow);
}
public function handleOpenTakePollWindowEvent(event:OpenTakePollWindowEvent):void {
takePollWindow.viewModel = _viewModel;
takePollWindow.pollID = event.pollID;
openWindow(takePollWindow);
}
public function handleOpenPollResultWindowEvent(event:OpenPollResultWindowEvent):void {
resultsWindow.viewModel = _viewModel;
resultsWindow.pollID = event.pollID;

View File

@ -22,165 +22,73 @@
<mx:Script>
<![CDATA[
import mx.events.FlexEvent;
import org.bigbluebutton.main.events.BBBEvent;
import org.bigbluebutton.main.events.MadePresenterEvent;
import org.bigbluebutton.main.events.ShortcutEvent;
import org.bigbluebutton.modules.polling.events.*;
import org.bigbluebutton.modules.polling.managers.PollingManager;
import org.bigbluebutton.modules.polling.managers.PollingWindowManager;
import org.bigbluebutton.modules.polling.model.PollingModel;
import org.bigbluebutton.modules.polling.model.PollingViewModel;
]]>
import org.bigbluebutton.main.events.MadePresenterEvent;
import org.bigbluebutton.main.events.ShortcutEvent;
import org.bigbluebutton.modules.polling.events.GenerateWebKeyEvent;
import org.bigbluebutton.modules.polling.events.ModuleEvent;
import org.bigbluebutton.modules.polling.events.OpenPollMainWindowEvent;
import org.bigbluebutton.modules.polling.events.OpenPollResultWindowEvent;
import org.bigbluebutton.modules.polling.events.OpenPollUpdateWindowEvent;
import org.bigbluebutton.modules.polling.events.OpenSavedPollEvent;
import org.bigbluebutton.modules.polling.events.OpenTakePollWindowEvent;
import org.bigbluebutton.modules.polling.events.PollGetPollEvent;
import org.bigbluebutton.modules.polling.events.PollGetTitlesEvent;
import org.bigbluebutton.modules.polling.events.PollReturnTitlesEvent;
import org.bigbluebutton.modules.polling.events.PollingInstructionsWindowEvent;
import org.bigbluebutton.modules.polling.events.PollingViewWindowEvent;
import org.bigbluebutton.modules.polling.events.ReviewResultsEvent;
import org.bigbluebutton.modules.polling.managers.PollingManager;
import org.bigbluebutton.modules.polling.managers.PollingWindowManager;
import org.bigbluebutton.modules.polling.model.PollingModel;
]]>
</mx:Script>
<EventHandlers type="{ModuleEvent.START}">
<ObjectBuilder generator="{PollingWindowManager}"/>
<MethodInvoker generator="{PollingWindowManager}" method="initialize"/>
<ObjectBuilder generator="{PollingWindowManager}"/>
<MethodInvoker generator="{PollingWindowManager}" method="initialize"/>
<MethodInvoker generator="{PollingManager}" method="handleStartModuleEvent" arguments="{event.module}"/>
</EventHandlers>
<EventHandlers type="{ModuleEvent.STOP}">
</EventHandlers>
<EventHandlers type="{OpenPollMainWindowEvent.OPEN_POLL_MAIN_WINDOW}">
<EventHandlers type="{OpenPollMainWindowEvent.OPEN_POLL_MAIN_WINDOW}">
<MethodInvoker generator="{PollingWindowManager}" method="handleOpenPollMainWindowEvent" />
</EventHandlers>
</EventHandlers>
<EventHandlers type="{OpenPollResultWindowEvent.OPEN_RESULT_WINDOW}">
<MethodInvoker generator="{PollingWindowManager}" method="handleOpenPollResultWindowEvent" arguments="{event}"/>
</EventHandlers>
<EventHandlers type="{OpenPollResultWindowEvent.OPEN_RESULT_WINDOW}">
<MethodInvoker generator="{PollingWindowManager}" method="handleOpenPollResultWindowEvent" arguments="{event}"/>
</EventHandlers>
<EventHandlers type="{OpenPollUpdateWindowEvent.OPEN_UPDATE_WINDOW}">
<MethodInvoker generator="{PollingWindowManager}" method="handleOpenPollUpdateWindowEvent" arguments="{event}"/>
</EventHandlers>
<EventHandlers type="{OpenPollUpdateWindowEvent.OPEN_UPDATE_WINDOW}">
<MethodInvoker generator="{PollingWindowManager}" method="handleOpenPollUpdateWindowEvent" arguments="{event}"/>
</EventHandlers>
<EventHandlers type="{PollingInstructionsWindowEvent.CLOSE}">
<EventHandlers type="{PollingInstructionsWindowEvent.CLOSE}">
<MethodInvoker generator="{PollingManager}" method="handleClosePollingInstructionsWindowEvent" arguments="{event}"/>
</EventHandlers>
</EventHandlers>
<EventHandlers type="{PollingViewWindowEvent.OPEN}">
<MethodInvoker generator="{PollingManager}" method="handleOpenPollingViewWindow" arguments="{event}"/>
</EventHandlers>
<EventHandlers type="{OpenTakePollWindowEvent.OPEN_TAKE_POLL_WINDOW}">
<MethodInvoker generator="{PollingWindowManager}" method="handleOpenTakePollWindowEvent" arguments="{event}"/>
</EventHandlers>
<EventHandlers type="{PollingViewWindowEvent.CLOSE}">
<EventHandlers type="{PollingViewWindowEvent.CLOSE}">
<MethodInvoker generator="{PollingManager}" method="handleClosePollingViewWindow" arguments="{event}"/>
</EventHandlers>
</EventHandlers>
<EventHandlers type="{StartPollingEvent.START}">
<MethodInvoker generator="{PollingManager}" method="handleStartPollingEvent" arguments="{event}"/>
</EventHandlers>
<EventHandlers type="{MadePresenterEvent.SWITCH_TO_PRESENTER_MODE}">
<MethodInvoker generator="{PollingManager}" method="handleMadePresenterEvent" arguments="{event}"/>
</EventHandlers>
<EventHandlers type="{MadePresenterEvent.SWITCH_TO_PRESENTER_MODE}">
<MethodInvoker generator="{PollingManager}" method="handleMadePresenterEvent" arguments="{event}"/>
</EventHandlers>
<EventHandlers type="{MadePresenterEvent.SWITCH_TO_VIEWER_MODE}">
<MethodInvoker generator="{PollingManager}" method="handleMadeViewerEvent" arguments="{event}"/>
</EventHandlers>
<!-- Event to save Poll to db -->
<EventHandlers type="{SavePollEvent.SAVE}">
<MethodInvoker generator="{PollingManager}" method="handleSavePollEvent" arguments="{event}"/>
</EventHandlers>
<EventHandlers type="{PublishPollEvent.PUBLISH}">
<MethodInvoker generator="{PollingManager}" method="handlePublishPollEvent" arguments="{event}"/>
</EventHandlers>
<EventHandlers type="{PublishPollEvent.REPOST}">
<MethodInvoker generator="{PollingManager}" method="handleRepostPollEvent" arguments="{event}"/>
</EventHandlers>
<EventHandlers type="{VoteEvent.START}">
<MethodInvoker generator="{PollingManager}" method="handleVoteEvent" arguments="{event}"/>
</EventHandlers>
<!-- PollingStatsWindow Events -->
<EventHandlers type="{PollingStatsWindowEvent.OPEN}">
<MethodInvoker generator="{PollingManager}" method="handleOpenPollingStatsWindow" arguments="{event}"/>
</EventHandlers>
<EventHandlers type="{PollingStatsWindowEvent.CLOSE}">
<MethodInvoker generator="{PollingManager}" method="handleClosePollingStatsWindow" arguments="{event}"/>
</EventHandlers>
<EventHandlers type="{PollRefreshEvent.REFRESH}">
<MethodInvoker generator="{PollingManager}" method="handleRefreshPollingStatsWindow" arguments="{event}"/>
</EventHandlers>
<EventHandlers type="{PollRefreshEvent.GET}">
<MethodInvoker generator="{PollingManager}" method="handleGetPollingStats" arguments="{event}"/>
</EventHandlers>
<EventHandlers type="{StopPollEvent.STOP_POLL}">
<MethodInvoker generator="{PollingManager}" method="handleStopPolling" arguments="{event}"/>
</EventHandlers>
<!-- Event to check if a poll is already open before allowing presenter to publish a second poll -->
<EventHandlers type="{PollingStatusCheckEvent.CHECK}">
<MethodInvoker generator="{PollingManager}" method="handleCheckStatusEvent" arguments="{event}"/>
</EventHandlers>
<!-- Events to update the list of poll titles and statuses to display in the Polling Menu -->
<EventHandlers type="{PollGetTitlesEvent.INIT}">
<MethodInvoker generator="{PollingManager}" method="handleInitializePollMenuEvent" arguments="{event}"/>
</EventHandlers>
<EventHandlers type="{PollGetTitlesEvent.UPDATE}">
<MethodInvoker generator="{PollingManager}" method="handleUpdateTitlesEvent" arguments="{event}"/>
</EventHandlers>
<EventHandlers type="{PollGetTitlesEvent.REMOTE_CHECK}">
<MethodInvoker generator="{PollingManager}" method="handleRemoteInitializePollMenuEvent" arguments="{event}"/>
</EventHandlers>
<EventHandlers type="{PollReturnTitlesEvent.UPDATE}">
<MethodInvoker generator="{PollingManager}" method="handleReturnTitlesEvent" arguments="{event}"/>
</EventHandlers>
<EventHandlers type="{PollReturnTitlesEvent.REMOTE_RETURN}">
<MethodInvoker generator="{PollingManager}" method="handleRemoteReturnTitlesEvent" arguments="{event}"/>
</EventHandlers>
<EventHandlers type="{PollGetPollEvent.INIT}">
<MethodInvoker generator="{PollingManager}" method="handlePopulateMenuEvent" arguments="{event}"/>
</EventHandlers>
<EventHandlers type="{PollGetPollEvent.RETURN}">
<MethodInvoker generator="{PollingManager}" method="handleReturnPollEvent" arguments="{event}"/>
</EventHandlers>
<EventHandlers type="{PollGetTitlesEvent.CHECK}">
<MethodInvoker generator="{PollingManager}" method="handleCheckTitlesEvent" arguments="{event}"/>
</EventHandlers>
<EventHandlers type="{PollGetTitlesEvent.RETURN}">
<MethodInvoker generator="{PollingManager}" method="handleCheckTitlesEvent" arguments="{event}"/>
</EventHandlers>
<EventHandlers type="{OpenSavedPollEvent.OPEN}">
<MethodInvoker generator="{PollingManager}" method="handleOpenSavedPollEvent" arguments="{event}"/>
</EventHandlers>
<EventHandlers type="{ReviewResultsEvent.REVIEW}">
<MethodInvoker generator="{PollingManager}" method="handleReviewResultsEvent" arguments="{event}"/>
</EventHandlers>
<EventHandlers type="{GenerateWebKeyEvent.GENERATE}">
<MethodInvoker generator="{PollingManager}" method="handleGenerateWebKeyEvent" arguments="{event}"/>
</EventHandlers>
<EventHandlers type="{GenerateWebKeyEvent.RETURN}">
<MethodInvoker generator="{PollingManager}" method="handleReturnWebKeyEvent" arguments="{event}"/>
</EventHandlers>
<EventHandlers type="{ShortcutEvent.POLL_BUTTON_CLICK}">
<MethodInvoker generator="{PollingManager}" method="handleGlobalPollHotkey" arguments="{event}"/>
</EventHandlers>
<Injectors target="{PollingWindowManager}">
<PropertyInjector targetKey="model" source="{PollingModel}" />
<PropertyInjector targetKey="dispatcher" source="{scope.dispatcher}"/>
</Injectors>
<Injectors target="{PollingWindowManager}">
<PropertyInjector targetKey="model" source="{PollingModel}" />
<PropertyInjector targetKey="dispatcher" source="{scope.dispatcher}"/>
</Injectors>
<Debugger level="{Debugger.ALL}" />
</EventMap>

View File

@ -37,7 +37,6 @@ package org.bigbluebutton.modules.polling.model
}
public function getSamplePoll():PollVO {
var _poll:Poll = _model.getPoll("pollID");
var _pollVO:PollVO = new PollVO(_poll);

View File

@ -2,26 +2,22 @@
<mx:HBox xmlns:mx="http://www.adobe.com/2006/mxml" width="90%">
<mx:Script>
<![CDATA[
import com.asfusion.mate.events.Dispatcher;
import org.bigbluebutton.modules.present.events.RemovePresentationEvent;
import org.bigbluebutton.modules.present.events.UploadEvent;
import org.bigbluebutton.util.i18n.ResourceUtil;
import com.asfusion.mate.events.Dispatcher;
import org.bigbluebutton.modules.polling.events.OpenTakePollWindowEvent;
import org.bigbluebutton.util.i18n.ResourceUtil;
private static const LOG:String = "CreatedPollsRenderer - ";
private var globalDispatch:Dispatcher = new Dispatcher();
private function startPoll():void {
trace(LOG + "::startPoll() " + data);
var readyEvent:UploadEvent = new UploadEvent(UploadEvent.PRESENTATION_READY);
readyEvent.presentationName = data as String;
globalDispatch.dispatchEvent(readyEvent);
globalDispatch.dispatchEvent(new UploadEvent(UploadEvent.CLOSE_UPLOAD_WINDOW));
trace(LOG + "::startPoll() " + data.id);
var event:OpenTakePollWindowEvent = new OpenTakePollWindowEvent(data.id);
globalDispatch.dispatchEvent(event);
}
private function deletePoll():void {
trace(LOG + "::deletePoll() " + data);
trace(LOG + "::deletePoll() " + data.id);
}
]]>
</mx:Script>

View File

@ -23,8 +23,8 @@
<MDIWindow xmlns="flexlib.mdi.containers.*"
xmlns:mx="http://www.adobe.com/2006/mxml"
xmlns:poll="org.bigbluebutton.modules.polling.views.*"
height="150"
width="410"
height="300"
width="500"
xmlns:mate="http://mate.asfusion.com/"
implements="org.bigbluebutton.common.IBbbModuleWindow"
label="{ResourceUtil.getInstance().getString('bbb.polling.toolbar.toolTip')}"

View File

@ -13,7 +13,7 @@
[Bindable] private var _polls:Array = new Array();
private function onPreInit():void {
if (viewModel == null) trace("********** PollMainPanel viewModel is NULL!!!!!!");
_polls = viewModel.polls;
}

View File

@ -6,10 +6,8 @@
import mx.controls.RadioButton;
import mx.controls.RadioButtonGroup;
import mx.events.ItemClickEvent;
import org.bigbluebutton.modules.polling.model.QuestionVO;
import org.bigbluebutton.modules.polling.model.Response;
import org.bigbluebutton.modules.polling.vo.QuestionsVO;
public var qvo:QuestionVO;
public var responseCollector:ResponseCollector;

View File

@ -3,36 +3,36 @@
xmlns:poll="org.bigbluebutton.modules.polling.views.*"
borderStyle="none" horizontalAlign="center"
headerHeight="0" borderThicknessBottom="0" borderThicknessLeft="0"
borderThicknessRight="0" borderThicknessTop="0" preinitialize="preInit()">
borderThicknessRight="0" borderThicknessTop="0" creationComplete="preInit()">
<mx:Script>
<![CDATA[
import mx.events.ItemClickEvent;
import org.bigbluebutton.modules.polling.events.CreatePollEvent;
import org.bigbluebutton.modules.polling.model.Poll;
import org.bigbluebutton.modules.polling.model.PollVO;
import org.bigbluebutton.modules.polling.model.PollingViewModel;
import org.bigbluebutton.modules.polling.model.QuestionVO;
import org.bigbluebutton.modules.polling.vo.CreatePollVO;
import org.bigbluebutton.modules.polling.vo.CreateQuestionVO;
import org.bigbluebutton.util.i18n.ResourceUtil;
[Bindable] private var baseIndex:int;
public var viewModel:PollingViewModel = new PollingViewModel(null);
public var viewModel:PollingViewModel;
public var pollID:String;
private var poll:PollVO;
[Bindable] private var _title:String;
[Bindable] private var qvo:QuestionVO;
[Bindable] private var _qvo:QuestionVO;
private var _pollID:String;
[Bindable] private var responseCollector:ResponseCollector;
private function preInit():void {
poll = viewModel.getSamplePoll();
//poll = viewModel.getPoll(pollID);
_title = poll.title;
_pollID = poll.id;
qvo = poll.questions[0] as QuestionVO;
_qvo = poll.questions[0] as QuestionVO;
trace("*********************Title = [" + _title + "]");
if (_qvo == null) trace("*********************_qvo is null!!!!!!!**************");
else trace("*********************_qvo is NOT null!!!!!!!**************");
responseCollector = new ResponseCollector(_pollID);
}
@ -99,7 +99,7 @@
</mx:HBox>
<mx:Spacer height="3"/>
<poll:QuestionRenderer qvo="{qvo}" responseCollector="{responseCollector}"/>
<poll:QuestionRenderer qvo="{_qvo}" responseCollector="{responseCollector}"/>
<mx:Spacer height="5"/>

View File

@ -29,8 +29,11 @@ Notes.mxml is the main view of the SharedNotes application
<mx:Script>
<![CDATA[
import org.bigbluebutton.main.views.MainCanvas;
import org.bigbluebutton.util.i18n.ResourceUtil;
import org.bigbluebutton.main.views.MainCanvas;
import org.bigbluebutton.modules.polling.model.PollingViewModel;
[Bindable] public var viewModel:PollingViewModel;
[Bindable] public var pollID:String;
public function getPrefferedPosition():String{
return MainCanvas.POPUP;
@ -40,5 +43,5 @@ Notes.mxml is the main view of the SharedNotes application
</mx:Script>
<poll:TakePollPanel width="100%" height="100%"/>
<poll:TakePollPanel width="100%" height="100%" viewModel="{viewModel}" pollID="{pollID}"/>
</MDIWindow>