- fix show poll result

This commit is contained in:
Richard Alam 2013-07-03 19:14:14 +00:00
parent 4460612462
commit 6dd2dc0a26
6 changed files with 61 additions and 12 deletions

View File

@ -10,20 +10,58 @@ class PollModel {
createSamplePoll
def createSamplePoll() {
val r1 = new ResponseVO("0", "Answer 1")
val r2 = new ResponseVO("1", "Answer 2")
val r3 = new ResponseVO("2", "Answer 3")
val r4 = new ResponseVO("3", "Answer 4")
addSamplePoll1()
addSamplePoll2()
addSamplePoll3()
}
def addSamplePoll1() {
val r1 = new ResponseVO("0", "Visa")
val r2 = new ResponseVO("1", "MasterCard")
val r3 = new ResponseVO("2", "AmEx")
val r4 = new ResponseVO("3", "Diners Club")
var q = new QuestionVO("q1", true, "What is my name?", Array(r1, r2, r3))
val pvo = new PollVO("pollID-100", "sample poll", Array(q))
var q = new QuestionVO("q1", false, "What type of credit card do you prefer?", Array(r1, r2, r3, r4))
val pvo = new PollVO("pollID-101", "Preferred Credit Card", Array(q))
createPoll(pvo)
respondToQuestion("pollID-100", "q1", "1", new Responder("user1", "Juan Tamad"))
respondToQuestion("pollID-100", "q1", "0", new Responder("user2", "Asyong Aksaya"))
respondToQuestion("pollID-101", "q1", "1", new Responder("user1", "Juan Tamad"))
respondToQuestion("pollID-101", "q1", "0", new Responder("user2", "Asyong Aksaya"))
}
def addSamplePoll2() {
val r1 = new ResponseVO("0", "Visa")
val r2 = new ResponseVO("1", "MasterCard")
val r3 = new ResponseVO("2", "AmEx")
val r4 = new ResponseVO("3", "Diners Club")
var q = new QuestionVO("q1", true, "Which credit cards do you own?", Array(r1, r2, r3, r4))
val pvo = new PollVO("pollID-102", "Owned Credit Cards", Array(q))
createPoll(pvo)
respondToQuestion("pollID-102", "q1", "1", new Responder("user1", "Juan Tamad"))
respondToQuestion("pollID-102", "q1", "0", new Responder("user2", "Asyong Aksaya"))
}
def addSamplePoll3() {
val r1 = new ResponseVO("0", "Dumaguete")
val r2 = new ResponseVO("1", "Cebu")
val r3 = new ResponseVO("2", "Zamboanga")
val r4 = new ResponseVO("3", "None of the above")
var q = new QuestionVO("q1", true, "What is the capital of the Philippines?", Array(r1, r2, r3, r4))
val pvo = new PollVO("pollID-103", "Philippine Capital", Array(q))
createPoll(pvo)
respondToQuestion("pollID-103", "q1", "1", new Responder("user1", "Juan Tamad"))
respondToQuestion("pollID-103", "q1", "0", new Responder("user2", "Asyong"))
respondToQuestion("pollID-103", "q1", "2", new Responder("user3", "Pedro"))
respondToQuestion("pollID-103", "q1", "3", new Responder("user4", "Aksaya"))
}
def numPolls():Int = {
polls.size
}

View File

@ -15,6 +15,7 @@ package org.bigbluebutton.modules.polling.events
public static const STOP_POLL:String = "stop poll event";
public static const REMOVE_POLL:String = "remove poll event";
public static const EDIT_POLL_REQUEST:String = "request to edit poll event";
public static const SHOW_POLL_RESULT:String = "request to show result poll event";
private var _pollID:String;

View File

@ -34,7 +34,7 @@ package org.bigbluebutton.modules.polling.managers
public function handleInitPollModuleEvent():void {
dispatcher.dispatchEvent(new GetPollsEvent());
createSamplePolls();
// createSamplePolls();
}
private function createSamplePolls():void {

View File

@ -110,7 +110,7 @@ package org.bigbluebutton.modules.polling.managers
openWindow(takePollWindow);
}
public function handleOpenPollResultWindowEvent(event:OpenPollResultWindowEvent):void {
public function handleOpenPollResultWindowEvent(event:PollEvent):void {
resultsWindow.viewModel = _viewModel;
resultsWindow.pollID = event.pollID;

View File

@ -63,7 +63,7 @@
<MethodInvoker generator="{PollingWindowManager}" method="handleOpenPollMainWindowEvent" />
</EventHandlers>
<EventHandlers type="{OpenPollResultWindowEvent.OPEN_RESULT_WINDOW}">
<EventHandlers type="{PollEvent.SHOW_POLL_RESULT}">
<MethodInvoker generator="{PollingWindowManager}" method="handleOpenPollResultWindowEvent" arguments="{event}"/>
</EventHandlers>

View File

@ -29,9 +29,19 @@
globalDispatch.dispatchEvent(event);
}
private function showPollResult():void {
var event:PollEvent = new PollEvent(PollEvent.SHOW_POLL_RESULT, data.id);
globalDispatch.dispatchEvent(event);
}
]]>
</mx:Script>
<mx:Label id="pollTitleLabel" text="{data.title}" styleName="presentationNameLabelStyle" width="80%"/>
<mx:Button id="resultBtn" label="Result"
toolTip="{ResourceUtil.getInstance().getString('bbb.fileupload.showBtn.toolTip')}"
styleName="presentationUploadShowButtonStyle"
click="showPollResult()" enabled="true"/>
<mx:Button id="startBtn" label="Start"
toolTip="{ResourceUtil.getInstance().getString('bbb.fileupload.showBtn.toolTip')}"
styleName="presentationUploadShowButtonStyle"