Beispiel #1
0
 public static void PollFIcon(int type)
 {
     s_lastPollType = PollType.EVENT_SCRIPT;
     s_FIconPolled  = true;
     s_FIconType    = type;
     CloseHereIcon();
 }
Beispiel #2
0
 public static void PollFIcon(Int32 type)
 {
     lastPollType = PollType.EVENT_SCRIPT;
     sFIconPolled = true;
     sFIconType   = type;
     CloseHereIcon();
 }
Beispiel #3
0
        public void SetOptions(PollType type, ArrayList options)
        {
            ChangeWindowState(type);
            switch (type)
            {
            case PollType.FreeResponse:
                groupCheckboxes.Visible = false;
                groupRadio.Visible      = false;
                groupTextBox.Visible    = true;
                this.textBox1.Focus();
                break;

            case PollType.SingleSelect:
                SetRadioOptions(options);
                break;

            case PollType.MultipleSelect:
                SetCheckOptions(options);
                break;

            case PollType.TrueFalse:
            case PollType.YesNo:
                SetRadioOptions(options);
                break;
                //case PollType.FreeResponse:
            }
            if (anonymous)
            {
                lblInfo.Text = "This answer will be submitted anonymously";
            }
        }
Beispiel #4
0
        public new void WriteXml(System.Xml.XmlWriter writer)
        {
            base.WriteXml(writer);

            writer.WriteElementString("PollType", PollType.ToString("D"));
            writer.WriteElementString("ShowAnswerCount", ShowAnswerCount.ToString("D"));
            writer.WriteElementString("ShowResult", ShowResult.ToString("D"));
            writer.WriteElementString("PollLayout", PollLayout.ToString("D"));
            writer.WriteElementString("AnonymousAllowed", AnonymousAllowed.ToString());
            writer.WriteElementString("HasAnswers", HasAnswers.ToString());
            writer.WriteElementString("AnswerAnonnymous", AnswerAnonnymous.ToString());
            writer.WriteElementString("AnswerRegisterd", AnswerRegisterd.ToString());
            writer.WriteElementString("AnswerTotal", AnswerTotal.ToString());
            writer.WriteElementString("TextRight", TextRight);
            writer.WriteElementString("TextFalse", TextFalse);
            writer.WriteElementString("TextPartially", TextPartially);

            writer.WriteStartElement("Answers");
            foreach (PollAnswer kvp in Answers)
            {
                writer.WriteStartElement("Answer");
                writer.WriteAttributeString("Position", kvp.Position.ToString());
                writer.WriteAttributeString("Anonnymous", kvp.Anonnymous.ToString());
                writer.WriteAttributeString("Registerd", kvp.Registerd.ToString());
                writer.WriteAttributeString("IsRight", kvp.IsRight.ToString());
                writer.WriteString(kvp.Answer);
                writer.WriteEndElement();
            }
            writer.WriteEndElement();
        }
Beispiel #5
0
            public void CopiedPollHasSameValuesAsOriginal()
            {
                Guid           pollId        = new Guid("00DB2F1B-C4F5-44D3-960C-386CEB9690C4");
                const string   creator       = "Someone";
                const PollType pollType      = PollType.UpDown;
                const int      maxPoints     = 9;
                const int      maxPerVote    = 2;
                const bool     inviteOnly    = true;
                const bool     namedVoting   = true;
                DateTime?      expiryDateUtc = new DateTime(2015, 6, 2, 14, 2, 56, DateTimeKind.Utc);
                const bool     optionAdding  = true;

                var existingPoll = new Poll()
                {
                    UUID            = pollId,
                    Creator         = creator,
                    CreatorIdentity = UserId1,
                    PollType        = pollType,
                    MaxPoints       = maxPoints,
                    MaxPerVote      = maxPerVote,
                    InviteOnly      = inviteOnly,
                    NamedVoting     = namedVoting,
                    ExpiryDateUtc   = expiryDateUtc,
                    ChoiceAdding    = optionAdding
                };

                var dbPolls = new InMemoryDbSet <Poll>(clearDownExistingData: true)
                {
                    existingPoll
                };

                IContextFactory     mockContextFactory = CreateContextFactory(dbPolls);
                DashboardController controller         = CreateDashboardController(mockContextFactory);

                controller.User = CreateAuthenticatedUser(UserId1);

                var request = new CopyPollRequestModel()
                {
                    UUIDToCopy = pollId
                };


                controller.Copy(request);

                List <Poll> polls      = dbPolls.ToList();
                Poll        copiedPoll = polls[1];


                Assert.AreEqual(creator, copiedPoll.Creator);
                Assert.AreEqual(UserId1, copiedPoll.CreatorIdentity);
                Assert.AreEqual(pollType, copiedPoll.PollType);
                Assert.AreEqual(maxPoints, copiedPoll.MaxPoints);
                Assert.AreEqual(maxPerVote, copiedPoll.MaxPerVote);
                Assert.AreEqual(inviteOnly, copiedPoll.InviteOnly);
                Assert.AreEqual(namedVoting, copiedPoll.NamedVoting);
                Assert.AreEqual(expiryDateUtc, copiedPoll.ExpiryDateUtc);
                Assert.AreEqual(optionAdding, copiedPoll.ChoiceAdding);
            }
Beispiel #6
0
 public Poll(string token = null, string password = null, int count = 0, PollType type = default(PollType), bool trueAnon = false)
 {
     this.Token    = token;
     this.Password = password;
     this.Count    = count;
     this.Type     = type;
     this.TrueAnon = trueAnon;
     Questions     = new List <Question>();
 }
Beispiel #7
0
 /// <summary>
 /// QQ消息事件类.
 /// </summary>
 /// <param name="myqq"></param>
 /// <param name="recode"></param>
 /// <param name="poll"></param>
 /// <param name="data"></param>
 /// <param name="msgtext"></param>
 public QQMessageEventArgs(string myqq, int recode, PollType poll,
                           Message data, string msgtext)
 {
     _MyQQNumber  = myqq;
     _Recode      = recode;
     _PollMsgType = poll;
     _MsgText     = msgtext;
     _Data        = data;
 }
Beispiel #8
0
 public static void InitFIcon()
 {
     sFIconPolled = sFIconLastPolled = false;
     dialogBubble = false;
     lastPollType = PollType.NONE;
     hereIconShow = false;
     processFIcon = true;
     ShowDelay    = 0.0f;
     HideDelay    = 0.0f;
 }
Beispiel #9
0
 public static void HideBubble()
 {
     if (!(Singleton <BubbleUI> .Instance != null) || !Singleton <BubbleUI> .Instance.IsActive)
     {
         return;
     }
     HideDelay      = Singleton <BubbleUI> .Instance.AnimationDuration;
     s_lastPollType = PollType.NONE;
     Singleton <BubbleUI> .Instance.Hide();
 }
Beispiel #10
0
 public static void InitFIcon()
 {
     s_FIconPolled     = s_FIconLastPolled = false;
     IsDialogBubble    = false;
     s_lastPollType    = PollType.NONE;
     s_hereIconShow    = false;
     IsProcessingFIcon = true;
     ShowDelay         = 0.0f;
     HideDelay         = 0.0f;
 }
Beispiel #11
0
 public Poll(SocketUser receiver, PollType type, SocketCommandContext context, ulong messageId, CardGivings cardGiving, Cards card)
 {
     Receiver   = receiver;
     Type       = type;
     Context    = context;
     MessageId  = messageId;
     CardGiving = cardGiving;
     Card       = card;
     _startTime = DateTime.Now;
 }
            public void InviteOnly_XTokenGuidHeader_BallotInPoll_ReturnsPoll()
            {
                const string   pollName = "Why are we here?";
                const PollType pollType = PollType.UpDown;

                var ballot = new Ballot()
                {
                    TokenGuid = TokenGuid
                };

                var poll = new Poll()
                {
                    UUID     = PollId,
                    Name     = pollName,
                    PollType = pollType,

                    MaxPoints  = 5,
                    MaxPerVote = 1,

                    ExpiryDateUtc = null,

                    NamedVoting  = false,
                    ChoiceAdding = false,
                    InviteOnly   = true
                };

                poll.Ballots.Add(ballot);

                IDbSet <Poll> polls = DbSetTestHelper.CreateMockDbSet <Poll>();

                polls.Add(poll);
                IDbSet <Ballot> ballots = DbSetTestHelper.CreateMockDbSet <Ballot>();

                ballots.Add(ballot);
                IContextFactory contextFactory = ContextFactoryTestHelper.CreateContextFactory(polls, ballots);

                PollController controller = CreatePollController(contextFactory);

                AddXTokenGuidHeader(controller, TokenGuid);


                PollRequestResponseModel response = controller.Get(PollId);


                Assert.AreEqual(pollName, response.Name);
                Assert.AreEqual(pollType.ToString(), response.PollType);
                Assert.IsNull(response.ExpiryDateUtc);

                Assert.AreEqual(5, response.MaxPoints);
                Assert.AreEqual(1, response.MaxPerVote);

                Assert.IsFalse(response.NamedVoting);
                Assert.IsFalse(response.ChoiceAdding);
                Assert.IsFalse(response.UserHasVoted);
            }
        public void QQMessageEventArgsConstructorTest()
        {
            string             myqq    = string.Empty;
            int                recode  = 0;
            PollType           poll    = new PollType();
            MessageData        data    = null;
            string             msgtext = string.Empty;
            QQMessageEventArgs target  = new QQMessageEventArgs(myqq, recode, poll, data, msgtext);

            Assert.Inconclusive("TODO: 实现用来验证目标的代码");
        }
Beispiel #14
0
 internal void CreateNewQuestionary(PollType type)
 {
     if (type == PollType.ROOM_QUESTIONARY)
     {
         this.roomPoll = new RoomQuestionary();
     }
     else if (type == PollType.VOTE_QUESTIONARY)
     {
         this.roomPoll = new VoteQuestionary();
     }
 }
Beispiel #15
0
Datei: Poll.cs Projekt: sgf/Yupi
 /// <summary>
 ///     Initializes a new instance of the <see cref="Poll" /> class.
 /// </summary>
 /// <param name="id">The identifier.</param>
 /// <param name="roomId">The room identifier.</param>
 /// <param name="pollName">Name of the poll.</param>
 /// <param name="pollInvitation">The poll invitation.</param>
 /// <param name="thanks">The thanks.</param>
 /// <param name="prize">The prize.</param>
 /// <param name="type">The type.</param>
 /// <param name="questions">The questions.</param>
 internal Poll(uint id, uint roomId, string pollName, string pollInvitation, string thanks, string prize, int type, List<PollQuestion> questions)
 {
     Id = id;
     RoomId = roomId;
     PollName = pollName;
     PollInvitation = pollInvitation;
     Thanks = thanks;
     Type = (PollType) type;
     Prize = prize;
     Questions = questions;
     AnswersPositive = 0;
     AnswersNegative = 0;
 }
        public void HandlePollTypeChangedEvent(PollType pollType, int maxPerVote, int maxPerPoll, Guid pollId)
        {
            Metric setPollType = new Metric(MetricType.SetPollType, pollId);

            setPollType.Value = pollType.ToString();

            if (pollType == PollType.Points)
            {
                setPollType.Detail = "{ MaxPerPoll: " + maxPerPoll + ", MaxPerVote: " + maxPerVote + " }";
            }

            StoreEvent(setPollType);
        }
Beispiel #17
0
Datei: Poll.cs Projekt: sgf/Yupi
 /// <summary>
 ///     Initializes a new instance of the <see cref="Poll" /> class.
 /// </summary>
 /// <param name="id">The identifier.</param>
 /// <param name="roomId">The room identifier.</param>
 /// <param name="pollName">Name of the poll.</param>
 /// <param name="pollInvitation">The poll invitation.</param>
 /// <param name="thanks">The thanks.</param>
 /// <param name="prize">The prize.</param>
 /// <param name="type">The type.</param>
 /// <param name="questions">The questions.</param>
 internal Poll(uint id, uint roomId, string pollName, string pollInvitation, string thanks, string prize, int type, List <PollQuestion> questions)
 {
     Id              = id;
     RoomId          = roomId;
     PollName        = pollName;
     PollInvitation  = pollInvitation;
     Thanks          = thanks;
     Type            = (PollType)type;
     Prize           = prize;
     Questions       = questions;
     AnswersPositive = 0;
     AnswersNegative = 0;
 }
Beispiel #18
0
 /// <summary>
 /// Initializes a new instance of the <see cref="Poll"/> class.
 /// </summary>
 /// <param name="id">The identifier.</param>
 /// <param name="roomId">The room identifier.</param>
 /// <param name="pollName">Name of the poll.</param>
 /// <param name="pollInvitation">The poll invitation.</param>
 /// <param name="thanks">The thanks.</param>
 /// <param name="prize">The prize.</param>
 /// <param name="type">The type.</param>
 /// <param name="questions">The questions.</param>
 internal Poll(uint id, uint roomId, string pollName, string pollInvitation, string thanks, string prize, int type, List <PollQuestion> questions)
 {
     this.Id              = id;
     this.RoomId          = roomId;
     this.PollName        = pollName;
     this.PollInvitation  = pollInvitation;
     this.Thanks          = thanks;
     this.Type            = (PollType)type;
     this.Prize           = prize;
     this.Questions       = questions;
     this.answersPositive = 0;
     this.answersNegative = 0;
 }
Beispiel #19
0
        public void GetQuestion()
        {
            try
            {
                this.question = pqd.GetQuestion();
                NewPollMessage msg = new NewPollMessage(pqd.IsEvaluation);
                msg.sessionID    = this.sessionID;
                msg.ConferenceID = NetworkManager.thisInstance.profile.ConferenceID;

                anonymous         = pqd.checkAnonymous.Checked;
                msg.Question      = this.question;
                msg.anonymousPoll = pqd.checkAnonymous.Checked;
                msg.hostID        = NetworkManager.getInstance().profile.ClientId;
                switch (pqd.comboType.SelectedIndex)
                {
                case 0:
                    msg.pollType = PollType.FreeResponse;
                    break;

                case 1:
                    msg.pollType = PollType.SingleSelect;
                    break;

                case 2:
                    msg.pollType = PollType.MultipleSelect;
                    break;

                case 3:
                    msg.pollType = PollType.TrueFalse;
                    break;

                case 4:
                    msg.pollType = PollType.YesNo;
                    break;
                }
                thisPollType = msg.pollType;
                choices      = pqd.GetChoices(msg.pollType);
                msg.choices  = this.choices;

                NetworkManager.getInstance().SendLoadPacket(msg);

                //			msg.hostID=this.host;
                //network mannager . send msg;
            }
            catch (Exception exp)
            {
                WebMeeting.Client.ClientUI.getInstance().ShowExceptionMessage("Polling ===>Polling.cs @GetQuestion() line==> 230", exp, null, false);
            }
        }
            public void ElectionPoll_BallotHasVoted_UserHasVotedIsTrue()
            {
                const string   pollName = "Why are we here?";
                const PollType pollType = PollType.Basic;

                var ballot = new Ballot()
                {
                    TokenGuid = TokenGuid, HasVoted = true
                };

                var poll = new Poll()
                {
                    UUID     = PollId,
                    Name     = pollName,
                    PollType = pollType,

                    ExpiryDateUtc = null,

                    NamedVoting  = false,
                    ChoiceAdding = false,
                    InviteOnly   = true
                };

                poll.Ballots.Add(ballot);

                IDbSet <Poll> polls = DbSetTestHelper.CreateMockDbSet <Poll>();

                polls.Add(poll);
                IDbSet <Ballot> ballots = DbSetTestHelper.CreateMockDbSet <Ballot>();

                ballots.Add(ballot);
                IContextFactory contextFactory = ContextFactoryTestHelper.CreateContextFactory(polls, ballots);

                PollController controller = CreatePollController(contextFactory);

                AddXTokenGuidHeader(controller, TokenGuid);


                PollRequestResponseModel response = controller.Get(PollId);

                Assert.IsTrue(response.UserHasVoted);
            }
        public IVoteValidator CreateValidator(PollType voteType)
        {
            switch (voteType)
            {
            case PollType.Basic:
                return(new BasicVoteValidator());

            case PollType.Points:
                return(new PointsVoteValidator());

            case PollType.UpDown:
                return(new UpDownVoteValidator());

            case PollType.Multi:
                return(new MultiVoteValidator());

            default:
                return(new BasicVoteValidator());
            }
        }
Beispiel #22
0
        public void ChangeWindowState(WebMeeting.Common.PollType pollType)
        {
            testPollType = pollType;
            switch (pollType)
            {
            case PollType.FreeResponse:
                panel1.Controls.Clear();
                panel1.Controls.Add(groupTextBox);
                panel1.Controls.Remove(groupRadio);
                groupTextBox.Dock = DockStyle.Fill;
                break;

            case PollType.SingleSelect:
                panel1.Controls.Clear();
                panel1.Controls.Add(groupRadio);
                panel1.Controls.Remove(groupCheckboxes);
                groupRadio.Dock = DockStyle.Fill;
                break;

            case PollType.MultipleSelect:
                panel1.Controls.Clear();
                panel1.Controls.Add(groupCheckboxes);
                panel1.Controls.Remove(groupRadio);
                groupCheckboxes.Dock = DockStyle.Fill;
                break;

            case PollType.TrueFalse:
                panel1.Controls.Clear();
                panel1.Controls.Add(groupRadio);
                panel1.Controls.Remove(groupCheckboxes);
                groupRadio.Dock = DockStyle.Fill;
                break;

            case PollType.YesNo:
                panel1.Controls.Clear();
                panel1.Controls.Add(groupRadio);
                panel1.Controls.Remove(groupCheckboxes);
                groupRadio.Dock = DockStyle.Fill;
                break;
            }
        }
        private void btnEventVoteYes_Click(object sender, EventArgs e)
        {
            if (dgvEvents.SelectedCells.Count <= 0)
            {
                MessageBox.Show("Please select an event to vote on.");
            }
            else
            {
                int      eventId = Convert.ToInt32(dgvEvents.CurrentRow.Cells[0].Value);
                int      voterId = currentUser.Id;
                PollType answer  = PollType.Yes;

                bool hasVoted = studentsHousing.VoteEvent(eventId, voterId, answer);
                UpdateEventsList();
                // If student already voted on this event
                if (!hasVoted)
                {
                    MessageBox.Show("You already voted for this event");
                }
            }
        }
        public bool VoteEvent(int eventId, int voterId, PollType answer)
        {
            Event foundEvent = FindEventById(eventId);

            List <Poll> polls = foundEvent.Polls;

            foreach (var poll in polls)
            {
                // If user already voted
                if (poll.VoterId == voterId)
                {
                    return(false);
                }
            }
            // Create poll object
            Poll newPoll = new Poll(voterId, answer);

            // Add it to list
            polls.Add(newPoll);

            foundEvent.VotersNr++;

            return(true);
        }
Beispiel #25
0
        public string GetAnswerText(PollType pollType)
        {
            int    a   = 0;
            string str = "";

            switch (pollType)
            {
            case PollType.SingleSelect:
            case PollType.TrueFalse:
            case PollType.YesNo:
                str = GetAnswerTextRadio();
                break;

            case PollType.MultipleSelect:
                str = GetAnswerTextMultipleChoice();
                break;

            case PollType.FreeResponse:
                str = this.textBox1.Text.ToString();

                str = str.Replace("\r", " ");
                str = str.Replace("\n", " ");

                //a=str.Length;

                /*
                 * if(a>1)
                 * {
                 * str=str.Substring(0,a-1);
                 * }
                 */
                break;
            }

            return(str + " ");
        }
Beispiel #26
0
 public Poll(string token, int count, string password, PollType type)
 {
     this.count = count;
     this.token = token;
     this.type  = type;
 }
Beispiel #27
0
        public void ShowAttendeeForm(PollType type)
        {
            this.testtype=type;
            //			Del_Attendeeform del_Attendee=new Del_Attendeeform(test1);
            //			ClientUI.getInstance().BeginInvoke(del_Attendee);
            //
            new Thread(new ThreadStart(AttendeeFormBlock)).Start();

            /*
            try
            {
                if((type == PollType.MultipleSelect ) && (type == PollType.FreeResponse))
                    pr.DisableCharting();

                attendeeForm.SetAnonymousPoll(this.anonymous);
                attendeeForm.SetQuestion(this.question);
                attendeeForm.SetOptions(type,this.choices);

                if(attendeeForm.Text.IndexOf("Evaluation") == -1)
                    attendeeForm.Text = "Poll By: " + ClientName;
                else
                    attendeeForm.Text = "Evaluation By: " + ClientName;

                attendeeForm.thisWindowPollingObject = this;

                if(DialogResult.OK == attendeeForm.ShowDialog())
                {
                    PollAnswerMessage msg=new PollAnswerMessage();
                    if((type != PollType.MultipleSelect ) && (type != PollType.FreeResponse))
                        msg.choice=attendeeForm.GetAnswerIndex();
                    else
                        msg.choice= -2;
                    msg.choiceText=attendeeForm.GetAnswerText(type);
                    msg.sessionID=this.sessionID;
                    msg.clientName=NetworkManager.getInstance().profile.Name;
                    msg.clientID=NetworkManager.thisInstance.profile.ClientId;
                    msg.questiontext = attendeeForm.getQuestionText();
                    msg.pollType = type;

                    msg.choices = getChoicesString(this.choices);

                    msg.ConferenceID = NetworkManager.getInstance().profile.ConferenceID ;
                    NetworkManager.getInstance().SendLoadPacket(msg);
                }

                return false;
            }
            catch (Exception exp)
            {
                WebMeeting.Client.ClientUI.getInstance().ShowExceptionMessage("Polling ===>Polling.cs @ShowAttendeeForm(PollType type) line==> 596",exp,null,false);
                return false;
            }

            */
        }
Beispiel #28
0
        private void SetResultData(PollType type)
        {
            try
            {

                ArrayList values = new ArrayList();
                ArrayList tooltips=new ArrayList();
                bool notNull=false;
                int count=0;
                // get the "waiting for reply " count
                for(int j=0;j<this.AnswersList.Count;j++)
                {
                    if(((PollingAnswer)this.AnswersList[j]).choiceIndex==-1)
                    {
                        count++;
                        notNull=true;
                    }
                }

                //			if(count != 0)
                //			{
                if(this.AnswersList.Count<1)
                {
                    values.Add((decimal)count);
                    tooltips.Add("waiting for reply");
                }
                //			}

                // get the count for each option
                if(( type != PollType.MultipleSelect) && (type != PollType.FreeResponse))
                {
                    //Trace.WriteLine("how many options there " + this.choices.Count.ToString());
                    for(int i=0;i<this.choices.Count;i++)
                    {
                        // get their values and insert them
                        count=0;
                        for(int j=0;j<this.AnswersList.Count;j++)
                        {

                            if(((PollingAnswer)AnswersList[j]).choiceIndex==i)
                            {
                                count++;
                                notNull=true;
                            }
                        }
                        //					if(count != 0)
                        //					{
                        values.Add((decimal)count);
                        tooltips.Add((string)choices[i]);

                        //					}

                    }
                }
                else if(type == PollType.MultipleSelect)
                {
                    //Trace.WriteLine("how many options in multi select : " + this.choices.Count.ToString());
                    for(int i=0;i<this.choices.Count;i++)
                    {
                        // get their values and insert them
                        count=0;
                        for(int j=0;j<this.AnswersList.Count;j++)
                        {
                            if((((PollingAnswer)AnswersList[j]).choice != "") && (((PollingAnswer)AnswersList[j]).choice !=null))
                            {
                                if(IsChoiceExistsInMulitpleChoicies(((PollingAnswer)AnswersList[j]).choice,(string)choices[i]))
                                {
                                    count++;
                                    notNull=true;
                                }
                            }
                        }
                        //					if(count != 0)
                        //					{
                        values.Add((decimal)count);
                        tooltips.Add((string)choices[i]);
                        //					}
                    }
                }

                pr.SetToolTips(tooltips);
                /*          Zaeem  Asif           */
                //There are some checks introduced in order to avoid
                // Array Index out of bound @ -ve Index occurance in code
                /*	                              */

                try
                {
                    if(notNull==false)
                    {
                            decimal i=1;
                        if(values.Count!=0)
                        {
                            values.RemoveAt(0);
                            values.Insert(0,i);//=i;//=(decimal)1;
                        }

                    }
                    if((type != PollType.MultipleSelect) && (type != PollType.FreeResponse))
                    {
                        pr.SetValues(values);
                    }
                }
                catch(Exception exp)
                {
                WebMeeting.Client.ClientUI.getInstance().ShowExceptionMessage("Polling ===>Polling.cs @SetResultData(PollType type)   line==> 398",exp,null,false);
                }

                pr.SetSummary(values,tooltips);
                pr.SetAttendeeAnswers(this.AnswersList,type);
                pr.Text=this.question;

            }
            catch(Exception exp)
            {
            WebMeeting.Client.ClientUI.getInstance().ShowExceptionMessage("Polling ===>Polling.cs @SetResultData(PollType type)   line==> 408",exp,null,false);

            }
        }
Beispiel #29
0
        public void LunchFromMangeGetQuestion()
        {
            try
            {
                this.question=pqd.GetQuestion();
                NewPollMessage msg=new NewPollMessage(pqd.IsEvaluation);
                msg.sessionID=this.sessionID;
                msg.ConferenceID = NetworkManager.thisInstance.profile.ConferenceID ;

                anonymous = pqd.checkAnonymous.Checked;
                msg.Question=this.question;
                msg.anonymousPoll =  pqd.checkAnonymous.Checked;
                msg.hostID = NetworkManager.getInstance().profile.ClientId;
                switch(pqd.comboType.SelectedIndex)
                {
                    case 0:
                        msg.pollType = PollType.FreeResponse;
                        break;
                    case 1:
                        msg.pollType = PollType.SingleSelect;
                        break;
                    case 2:
                        msg.pollType = PollType.MultipleSelect;
                        break;
                    case 3:
                        msg.pollType = PollType.TrueFalse;
                        break;
                    case 4:
                        msg.pollType = PollType.YesNo;
                        break;

                }
                thisPollType= msg.pollType;
                choices=pqd.GetChoices(msg.pollType);
                msg.choices=this.choices;

                NetworkManager.getInstance().SendLoadPacket(msg);

                //			msg.hostID=this.host;
                //network mannager . send msg;
            }
            catch (Exception exp)
            {
            WebMeeting.Client.ClientUI.getInstance().ShowExceptionMessage("Polling ===>Polling.cs @LunchFromMangeGetQuestion() line==> 179",exp,null,false);
            }
        }
Beispiel #30
0
        public void SendWebPollMessage(PollType type,bool IsEvaluation)
        {
            try
            {
                thisPollType= type;
                NewPollMessage msg = new NewPollMessage(false);
                msg.sessionID = this.sessionID;
                msg.choices = this.choices;
                msg.Question = this.question;
                msg.anonymousPoll = false;
                msg.hostID = NetworkManager.getInstance().profile.ClientId;
                msg.pollType = type;
                msg.IsEvaluation = IsEvaluation;

                msg.ConferenceID = NetworkManager.thisInstance.profile.ConferenceID;
                NetworkManager.getInstance().SendLoadPacket(msg);
            }
            catch(Exception exp)
            {
                WebMeeting.Client.ClientUI.getInstance().ShowExceptionMessage("Polling ===>Polling.cs @SendWebPollMessage(PollType type,bool IsEvaluation) line==> 255",exp,null,false);

            }
        }
Beispiel #31
0
        public string GetAnswerText(PollType pollType)
        {
            int a=0;
            string str = "";
            switch(pollType)
            {
                case PollType.SingleSelect: case PollType.TrueFalse: case PollType.YesNo:
                    str = GetAnswerTextRadio();
                    break;
                case PollType.MultipleSelect:
                    str = GetAnswerTextMultipleChoice();
                    break;
                case PollType.FreeResponse:
                    str = this.textBox1.Text.ToString();

                    str=str.Replace("\r"," ");
                    str=str.Replace("\n"," ");

                    //a=str.Length;
                    /*
                    if(a>1)
                    {
                    str=str.Substring(0,a-1);
                    }
                    */
                    break;

            }

            return str+" ";
        }
Beispiel #32
0
 public void SetOptions(PollType type,ArrayList options)
 {
     ChangeWindowState(type);
     switch(type)
     {
         case PollType.FreeResponse:
             groupCheckboxes.Visible=false;
             groupRadio.Visible=false;
             groupTextBox.Visible=true;
             this.textBox1.Focus();
             break;
         case PollType.SingleSelect:
             SetRadioOptions(options);
             break;
         case PollType.MultipleSelect:
             SetCheckOptions(options);
             break;
         case PollType.TrueFalse: case PollType.YesNo:
             SetRadioOptions(options);
             break;
             //case PollType.FreeResponse:
     }
     if(anonymous)
         lblInfo.Text="This answer will be submitted anonymously";
 }
 public PollAccess(Direct3D.Device ParentDevice, string TextureLocation, float NewX, float NewY, float NewZ, int NewWidth, int NewHeight, int NewSheetWidth, int NewSheetHeight, Color NewMaskColor, uint CollisionRectWidth, uint CollisionRectHeight, PollType NewTypeOfPoll)
     : base(ParentDevice, TextureLocation, NewX, NewY, NewZ, NewWidth, NewHeight, NewSheetWidth, NewSheetHeight, NewMaskColor, CollisionRectWidth, CollisionRectHeight)
 {
     this.TypeOfPoll = NewTypeOfPoll;
 }
Beispiel #34
0
 public void ChangeWindowState(WebMeeting.Common.PollType pollType)
 {
     testPollType = pollType;
     switch(pollType)
     {
         case PollType.FreeResponse:
             panel1.Controls.Clear();
             panel1.Controls.Add(groupTextBox);
             panel1.Controls.Remove(groupRadio);
             groupTextBox.Dock = DockStyle.Fill;
             break;
         case PollType.SingleSelect:
             panel1.Controls.Clear();
             panel1.Controls.Add(groupRadio);
             panel1.Controls.Remove(groupCheckboxes);
             groupRadio.Dock = DockStyle.Fill;
             break;
         case PollType.MultipleSelect:
             panel1.Controls.Clear();
             panel1.Controls.Add(groupCheckboxes);
             panel1.Controls.Remove(groupRadio);
             groupCheckboxes.Dock = DockStyle.Fill;
             break;
         case PollType.TrueFalse:
             panel1.Controls.Clear();
             panel1.Controls.Add(groupRadio);
             panel1.Controls.Remove(groupCheckboxes);
             groupRadio.Dock = DockStyle.Fill;
             break;
         case PollType.YesNo:
             panel1.Controls.Clear();
             panel1.Controls.Add(groupRadio);
             panel1.Controls.Remove(groupCheckboxes);
             groupRadio.Dock = DockStyle.Fill;
             break;
     }
 }
Beispiel #35
0
 // Constructor
 public Poll(int voterId, PollType answer)
 {
     this.voterId = voterId;
     this.answer  = answer;
 }
 public PollType GetTypeEx()
 {
     PollType type = new PollType();
     switch(comboType.SelectedIndex)
     {
         case 0:
             type = PollType.FreeResponse;
             break;
         case 1:
             type = PollType.SingleSelect;
             break;
         case 2:
             type = PollType.MultipleSelect;
             break;
         case 3:
             type = PollType.TrueFalse;
             break;
         case 4:
             type = PollType.YesNo;
             break;
     }
     return type;
 }
 public PollAccess(SpriteAccess ParentSprite, float NewX, float NewY, float NewZ, PollType NewTypeOfPoll)
     : base(ParentSprite, NewX, NewY, NewZ)
 {
     this.TypeOfPoll = NewTypeOfPoll;
 }
 public ArrayList GetChoices(PollType pollType)
 {
     ArrayList list = new ArrayList();
     switch(pollType)
     {
         case PollType.SingleSelect:
             list =  GetRadioChoicies();
             break;
         case PollType.MultipleSelect:
             list = GetRadioChoicies();
             break;
         case PollType.FreeResponse:
             break;
         case PollType.TrueFalse:
             list = GetTrueFalseChoicies();
             break;
         case PollType.YesNo:
             list = GetYesNoChoices();
             break;
     }
     return list;
 }
Beispiel #39
0
        public void SetAttendeeAnswers(ArrayList answers,PollType type)
        {
            try
            {
                //Thread.Sleep(10);
                lblQuestion.Text = polling.question;

                listViewAttendeeAnswers.Clear();
                ArrayList colors = new ArrayList();
                if (buttonColor1.Enabled)
                    colors.Add(buttonColor1.BackColor);
                if (buttonColor2.Enabled)
                    colors.Add(buttonColor2.BackColor);
                if (buttonColor3.Enabled)
                    colors.Add(buttonColor3.BackColor);
                if (buttonColor4.Enabled)
                    colors.Add(buttonColor4.BackColor);
                if (buttonColor5.Enabled)
                    colors.Add(buttonColor5.BackColor);
                if (buttonColor6.Enabled)
                    colors.Add(buttonColor6.BackColor);
                //this.listViewAttendeeAnswers.Dock = System.Windows.Forms.DockStyle.Left;
                this.listViewAttendeeAnswers.Columns.Add(this.columnName);
                this.listViewAttendeeAnswers.Columns.Add(this.columnOptionSelected);

                this.listViewAttendeeAnswers.Name = "listViewAttendeeAnswers";

                //this.listViewAttendeeAnswers.Width=this.panel4.Width-2;
                //this.listViewAttendeeAnswers.Size = new System.Drawing.Size(272, 96);
                this.listViewAttendeeAnswers.Sorting = System.Windows.Forms.SortOrder.Descending;
                this.listViewAttendeeAnswers.TabIndex = 0;
                this.listViewAttendeeAnswers.View = System.Windows.Forms.View.Details;
                //this.listViewAttendeeAnswers.Location = new System.Drawing.Point(3, 0);
                if(type != PollType.FreeResponse)
                {
                    //	Trace.WriteLine(barGraphBox.Top.ToString());
                    this.listViewAttendeeAnswers.Location = new System.Drawing.Point(3, 0);
                    //listViewAttendeeAnswers.Top = barGraphBox.Top;

                }
                else
                {
                    this.listViewAttendeeAnswers.Location = new System.Drawing.Point(0,0);
                    //this.listViewAttendeeAnswers.Top=0;
                }

                if(Client.ClientUI.RunOnceListAnswer)
                {

                    if(type != PollType.FreeResponse)
                    {
                        //Trace.WriteLine("TYPe is not poll of Free Response...");
                        this.listViewAttendeeAnswers.Size = new System.Drawing.Size(985, 221);
                    }
                    else
                        this.listViewAttendeeAnswers.Size = new System.Drawing.Size(985,2000);
                    Client.ClientUI.RunOnceListAnswer=false;
                }
                else
                    this.listViewAttendeeAnswers.Dock=System.Windows.Forms.DockStyle.Fill;

                this.columnName.Text = "Respondent";
                this.columnName.Width = 195;

                this.columnOptionSelected.Text = "Answer";
                this.columnOptionSelected.Width = 462;
                this.listViewAttendeeAnswers.Scrollable=false;

                if(type == PollType.FreeResponse)
                {
                    this.barGraphBox.Visible = false;
                    this.panelTop.Size= new System.Drawing.Size(656, 35);
                    //this.m_panelDrawing.Visible = false;
                    //panelTop.Visible = false;
                    //btnBarGraph.Visible = false;
                    //btnOption.Visible = false;
                    if(Client.ClientUI.RunOnceListAnswer==false)
                        listViewAttendeeAnswers.Top=0;
                        //listViewAttendeeAnswers.Top = barGraphBox.Top;
                    else
                        listViewAttendeeAnswers.Top = barGraphBox.Top;
                    //listViewAttendeeAnswers.Top=0;
                }
                if(!polling.anonymous)
                {
                    for(int i = 0 ; i < answers.Count ; i ++)
                    {
                        string strChoice = ((PollingAnswer)answers[i]).choice;
                        if(strChoice == null)
                            continue;
                        if((type != PollType.MultipleSelect )  && (type != PollType.FreeResponse))
                        {
                            ListViewItem lv = listViewAttendeeAnswers.Items.Add(((PollingAnswer)answers[i]).clientName);
                            lv.SubItems.Add(strChoice);
                        }
                        else if (type == PollType.MultipleSelect)
                        {
                            if(strChoice.Length > 0)
                            {
                                string []strChoicies = strChoice.Split('^');
                                ListViewItem lv2 = listViewAttendeeAnswers.Items.Add(((PollingAnswer)answers[i]).clientName);
                                string _answer="";

                                foreach (string choice  in strChoicies)
                                {
                                    _answer += choice + ",";
                                }
                                _answer = _answer.Substring(0,_answer.Length-2);
                                lv2.SubItems.Add(_answer);
                            }
                        }
                        else
                        {
                            try
                            {
                                if(strChoice.Length > 0)
                                {
                                    ListViewItem lv2 = listViewAttendeeAnswers.Items.Add(((PollingAnswer)answers[i]).clientName);
                                    lv2.Tag = strChoice;
                                    strChoice.Replace("\r"," ");
                                    strChoice.Replace("\n"," ");
                                    lv2.SubItems.Add(strChoice);

                                }
                            }
                            catch (Exception exp)
                            {
                                WebMeeting.Client.ClientUI.getInstance().ShowExceptionMessage("Polling ===>PollResult.cs @SetAttendeeAnswers(ArrayList answers,PollType type) line==> 1527",exp,null,false);
                            }

                        }

                    }
                }
                else if(type == PollType.FreeResponse)
                {

                    for(int i = 0 ; i < answers.Count ; i ++)
                    {
                        string strChoice = ((PollingAnswer)answers[i]).choice;
                        if(strChoice == null)
                            continue;
                        ListViewItem lv2 = listViewAttendeeAnswers.Items.Add("Anonymous");
                        lv2.Tag = strChoice;
                        lv2.SubItems.Add(strChoice);

                    }
                }
                else
                {

                    for(int i = 0 ; i < answers.Count ; i ++)
                    {
                        string strChoice = ((PollingAnswer)answers[i]).choice;
                        if(strChoice == null)
                            continue;
                        ListViewItem lv2 = listViewAttendeeAnswers.Items.Add("Anonymous");
                        lv2.Tag = strChoice;
                        strChoice=strChoice.Replace("^",",");
                        lv2.SubItems.Add(strChoice);

                    }

                }
                    //listViewAttendeeAnswers.Enabled = false;

            }
            catch (Exception exp)
            {
            WebMeeting.Client.ClientUI.getInstance().ShowExceptionMessage("Polling ===>PollResult.cs @SetAttendeeAnswers(ArrayList answers,PollType type) line==> 1556",exp,null,false);
            }
        }
Beispiel #40
0
 public void HandlePollTypeChangedEvent(PollType pollType, int maxPerVote, int maxPerPoll, Guid pollId)
 {
 }
 private void SetPollParameters()
 {
     _count += 1;
     if (_count == POLL_MAX)
     {
         _count = 0;
         _pollType = PollType.UpdateAll;
     }
     else
     {
         _pollType = PollType.CheckNew;
     }
     PIFitnessLog.Write(TraceEventType.Information, 0, string.Format("Fitbit counter: {0}", _count));
 }