Esempio n. 1
0
        private void CorrectAnswer(float multiplier = 1f)
        {
            var resultPoints = Mathf.RoundToInt(QuestionPrice * multiplier);

            SetAsAnswering(_answeringPlayer, false);

            _answeringPlayer.UpdatePoints(resultPoints);
            _uiController.SetDecisionMaker(_answeringPlayer);

            _questionTimer.Unpause();
            _audioSource.UnPause();
            _videoPlayer.SetPauseStatus(false);

            _answeringPlayer.SendMessage(new QuizCommand
            {
                Command   = SocketServer.CorrectAnswer,
                Parameter = resultPoints.ToString(CultureInfo.InvariantCulture)
            });

            _playerTimer?.Stop();
            _playerTimer = null;

            _answeringPlayer = null;

            Close();
        }
Esempio n. 2
0
        private void QuizTimer_Tick(object sender, EventArgs e)
        {
            duration--;
            if (duration == 10)
            {
                lbltimerSet.ForeColor = Color.Red;
            }
            if (duration == 0)
            {
                QuizTimer.Stop();
                int      qmarks   = Convert.ToInt16(marks);
                DateTime today    = DateTime.Now;
                string   current  = today.ToString("MM/dd/yyyy");
                string   getMarks = Session.logedInType.ToString();
                int      cal      = qmarks * 10;
                string   qmark    = "" + cal + "";
                try
                {
                    db.marksAdd(getMarks, qmark, qmarks);
                    MessageBox.Show("Your marks is   :" + cal + "   successfuly added to the database......");
                    FormMainPage log = new FormMainPage();
                    this.Hide();
                    log.Show();
                }
                catch (Exception ex)
                {
                    MessageBox.Show(ex.Message);
                }
            }

            lbltimerSet.Text = duration.ToString();
        }