Esempio n. 1
0
        private void ShowAnswers(AnswerMode mode)
        {
            foreach (var check in checks)
            {
                check.IsChecked = false;
            }
            switch (mode)
            {
            case AnswerMode.Correct:
                ChangeAnswerButton.Text = Resx.AppResources.Showmyanswers;
                foreach (var index in questionsToView.CorrectAnswer)
                {
                    checks[index].IsChecked = true;
                }
                break;

            case AnswerMode.Given:
                ChangeAnswerButton.Text = Resx.AppResources.Showcorrectanswers;
                foreach (var index in questionsToView.GivenAnswers)
                {
                    checks[index].IsChecked = true;
                }
                break;
            }
        }
Esempio n. 2
0
 public TrainingHistory(double averageSpeed,
                        DateTime date,
                        TimeSpan duration,
                        string listName,
                        int minimumVerbs,
                        AnswerMode mode,
                        double objectiveSpeed,
                        bool objectiveWon,
                        int score,
                        bool timeOver,
                        TimeSpan timerObjectiveTime,
                        int totalVerbs,
                        double winPercentage,
                        int wonVerbs,
                        VerbAnswer[] verbAnswers)
 {
     AverageSpeed       = averageSpeed;
     Date               = date;
     Duration           = duration;
     ListName           = listName;
     MinimumVerbs       = minimumVerbs;
     Mode               = mode;
     ObjectiveSpeed     = objectiveSpeed;
     ObjectiveWon       = objectiveWon;
     Score              = score;
     TimeOver           = timeOver;
     TimerObjectiveTime = timerObjectiveTime;
     TotalVerbs         = totalVerbs;
     WinPercentage      = winPercentage;
     WonVerbs           = wonVerbs;
     VerbAnswers        = verbAnswers;
 }
Esempio n. 3
0
        public VisualStimuli(string name,
                             string text,
                             Separator separator,
                             AnswerMode answerMode,
                             Randomisation randomisation,
                             Type type,
                             string externalRandomisation,
                             bool separatorFirst,
                             float fixationTime,
                             float decisionTime,
                             float expositionTime,
                             List <string> stimuli)
        {
            Name          = name;
            Text          = text;
            Configuration = new Configuration
            {
                Separator      = separator,
                AnswerMode     = answerMode,
                Randomisation  = randomisation,
                Type           = type,
                SeparatorFirst = separatorFirst
            };
            ExternalRandomisation = externalRandomisation;
            Times = new Times
            {
                Fixation   = fixationTime,
                Exposition = expositionTime,
                Decision   = decisionTime
            };
            Stimuli = stimuli;

            _answers = new Dictionary <int, string>();
        }
Esempio n. 4
0
        public EndScreenForm(int score, bool objectiveWon, bool timeOver, int wonVerbs, int totalVerbs, int minimumVerbs, TimeSpan timerObjectiveTime,
                             TimeSpan duration, VerbAnswer[] verbAnswers, DateTime date, string listName)
        {
            InitializeComponent();

            Score              = score;
            Mode               = AnswerMode.Timer;
            ObjectiveWon       = objectiveWon;
            TimeOver           = timeOver;
            WonVerbs           = wonVerbs;
            TotalVerbs         = totalVerbs;
            Duration           = duration;
            MinimumVerbs       = minimumVerbs;
            TimerObjectiveTime = timerObjectiveTime;
            VerbAnswers        = verbAnswers;
            Date               = date;
            ListName           = listName;

            ObjectiveSpeed = MinimumVerbs / TimerObjectiveTime.TotalMinutes;

            if (TotalVerbs != 0)
            {
                WinPercentage = WonVerbs * 100d / TotalVerbs;
            }
            else
            {
                WinPercentage = 0;
            }
            AverageSpeed = WonVerbs / Duration.TotalMinutes;

            if (TimeOver)
            {
                titleLbl.Text          = "Time over!";
                statsTitleLbl.Text     = "Stats";
                statsTitleLbl.Location = new Point(statsTitleLbl.Location.X + 19, statsTitleLbl.Location.Y);
            }

            if (ObjectiveWon)
            {
                scoreBtn.Text      = "Against the Watch:" + Environment.NewLine + "Objective reached!";
                scoreBtn.ForeColor = Color.Green;
            }
            else
            {
                scoreBtn.Text      = "Against the Watch:" + Environment.NewLine + "Objective failed.";
                scoreBtn.ForeColor = Color.Red;
            }
            scoreBtn.Image     = null;
            scoreBtn.TextAlign = ContentAlignment.MiddleCenter;

            winPercentageLbl.Text = "Win Percentage: " + Math.Round(WinPercentage, 1) + "%";
            wonOutOfTotalLbl.Text = WonVerbs + " verb" + StringTool.AddSOrNot(WonVerbs) + " won out of " + TotalVerbs + ", objective was " + MinimumVerbs;
            averageSpeedLbl.Text  = "Average Speed: " + Math.Round(AverageSpeed, 2).ToString() + " verbs/minute";
            totalTimeLbl.Text     = "Speed objective: " + Math.Round(ObjectiveSpeed, 2).ToString() + " verbs/minute";

            AddToHistorical();
        }
Esempio n. 5
0
        private void Update()
        {
            if (position == 0)
            {
                previousButton.IsEnabled = false;
            }
            else
            {
                previousButton.IsEnabled = true;
            }
            if (position == Singleton.Quiz.UncorrectQuestions.Count - 1)
            {
                nextButton.IsEnabled = false;
            }
            else
            {
                nextButton.IsEnabled = true;
            }

            answerMode      = AnswerMode.Correct;
            questionsToView = Singleton.Quiz.UncorrectQuestions[position];
            checks          = new List <CheckBox>();
            var numberText = position + 1;

            Correct.Text  = $"{numberText.ToString()}/{Singleton.Quiz.UncorrectQuestions.Count}";
            TaskText.Text = questionsToView.Task;
            QuestionsGrid.Children.Clear();
            QuestionsGrid.RowDefinitions = new RowDefinitionCollection();
            for (var i = 0; i < questionsToView.Answers.Length; i++)
            {
                QuestionsGrid.RowDefinitions.Add(new RowDefinition());
                var checkbox = new CheckBox()
                {
                    ClassId = $"{i}", IsEnabled = false
                };
                checkbox.VerticalOptions = new LayoutOptions(LayoutAlignment.Center, false);
                checks.Add(checkbox);

                var text = new Label()
                {
                    Text = questionsToView.Answers[i]
                };
                TapGestureRecognizer touch = new TapGestureRecognizer();
                text.VerticalOptions = new LayoutOptions(LayoutAlignment.Center, false);
                text.GestureRecognizers.Add(touch);

                QuestionsGrid.Children.Add(checkbox);
                QuestionsGrid.Children.Add(text);

                Grid.SetColumn(checkbox, 0);
                Grid.SetColumn(text, 1);
                Grid.SetRow(checkbox, i);
                Grid.SetRow(text, i);
            }
            ShowAnswers(answerMode);
        }
Esempio n. 6
0
 private void ChangeAnswerButton_Clicked(object sender, EventArgs e)
 {
     if (answerMode == AnswerMode.Correct)
     {
         answerMode = AnswerMode.Given;
     }
     else
     {
         answerMode = AnswerMode.Correct;
     }
     ShowAnswers(answerMode);
 }
Esempio n. 7
0
        public EndScreenForm(int score, int wonVerbs, int totalVerbs, TimeSpan duration, VerbAnswer[] verbAnswers, DateTime date, string listName)
        {
            InitializeComponent();

            Mode        = AnswerMode.Normal;
            Score       = score;
            WonVerbs    = wonVerbs;
            TotalVerbs  = totalVerbs;
            Duration    = duration;
            VerbAnswers = verbAnswers;
            Date        = date;
            ListName    = listName;

            if (TotalVerbs != 0)
            {
                WinPercentage = WonVerbs * 100 / TotalVerbs;
            }
            else
            {
                WinPercentage = 0;
            }
            AverageSpeed = WonVerbs / Duration.TotalMinutes;

            scoreBtn.Text = "Final score: " + score;
            if (Score >= 20)
            {
                scoreBtn.ForeColor = Color.Green;
            }
            else if (Score >= 0)
            {
                scoreBtn.ForeColor = Color.Orange;
            }
            else
            {
                scoreBtn.ForeColor = Color.Red;
            }
            scoreBtn.Image        = Properties.Resources.flame16;
            winPercentageLbl.Text = "Win Percentage: " + WinPercentage + "%";
            wonOutOfTotalLbl.Text = WonVerbs + " verb" + StringTool.AddSOrNot(WonVerbs) + " won out of " + TotalVerbs;
            averageSpeedLbl.Text  = "Average Speed: " + Math.Round(AverageSpeed, 2).ToString() + " verbs/minute";
            totalTimeLbl.Text     = "Total time: " + Duration.ToString(@"hh\:mm\:ss");

            AddToHistorical();
        }
Esempio n. 8
0
 public OptionsArgs(AnswerMode mode,
                    int timerNumberOfVerbs, TimeSpan timerTiming,
                    bool infinitiveGap, bool preteritGap, bool ppGap, bool translationGap, bool randomGaps,
                    VerbsAppartionMode apparitionMode,
                    int availableChances,
                    int wonAddPoint,
                    int lostRemovePoints,
                    int passedRemovePoints)
 {
     this.mode = mode;
     this.timerNumberOfVerbs = timerNumberOfVerbs;
     this.timerTiming        = timerTiming;
     this.infinitiveGap      = infinitiveGap;
     this.preteritGap        = preteritGap;
     this.ppGap              = ppGap;
     this.translationGap     = translationGap;
     this.randomGaps         = randomGaps;
     this.apparitionMode     = apparitionMode;
     this.availableChances   = availableChances;
     this.wonAddPoint        = wonAddPoint;
     this.lostRemovePoints   = lostRemovePoints;
     this.passedRemovePoints = passedRemovePoints;
 }
Esempio n. 9
0
	public void TrySwitchToAnswerMode()
	{
		if( m_AnswerMode != AnswerMode.AnswerMode_WaitPressOption )
		{
			Debug.LogWarning("m_AnswerMode=" +m_AnswerMode);
			return ;
		}
		m_AnswerMode = AnswerMode.AnswerMode_ChangeToAnswerMode ;
	}
Esempio n. 10
0
	private void AnswerMode_WaitCorrectAnimation()
	{
		if( Time.timeSinceLevelLoad > m_CorrectAnswerWaitTime )
		{
			m_AnswerMode = AnswerMode.AnswerMode_ChangeToOptionMode ;		
			PlayCorrectAnimation( false ) ;
		}
		
	}
Esempio n. 11
0
	// Update is called once per frame
	void Update () 
	{
		switch( m_AnswerMode )
		{
		case AnswerMode.AnswerMode_Invalid :
			m_AnswerMode = AnswerMode.AnswerMode_ChangeToAnswerMode ;
			break ;
		case AnswerMode.AnswerMode_ChangeToAnswerMode :
			AnswerMode_ChangeToAnswerMode() ;
			m_AnswerMode = AnswerMode.AnswerMode_WaitAtAnswerMode ;
			break ;
		case AnswerMode.AnswerMode_WaitAtAnswerMode :
			if( true == this.IsInAnimation )
			{
				if( true == UpdateReference() )
				{
					NGUITools.SetActive( answerLabel.gameObject , true ) ;
					NGUITools.SetActiveChildren( answerLabel.gameObject , true ) ;
					ResetExampleTimer() ;
				}
			}
			else
			{
				CheckExampleTimer() ;
			}
			break ;
		case AnswerMode.AnswerMode_ChangeToOptionMode :
			RandomizeTheOptions() ;
			AnswerMode_ChangeToOptionMode() ;
			m_AnswerMode = AnswerMode.AnswerMode_WaitAnimation ;
			break ;
		case AnswerMode.AnswerMode_WaitAnimation :
			if( true == this.IsInAnimation )
			{
				if( true == UpdateReference() )
				{

				}
			}
			else
			{
				m_AnswerMode = AnswerMode.AnswerMode_WaitPressOption ;
			}
			break ;
		case AnswerMode.AnswerMode_WaitPressOption :

			break ;
		case AnswerMode.AnswerMode_WaitCorrectAnimation :
			AnswerMode_WaitCorrectAnimation() ;
			break ;			
			
		}
		
	
	}
Esempio n. 12
0
	public void TryPress( int _OptionIndex )
	{
		// Debug.Log("TryPress" + _OptionIndex ) ;
		
		int pressAnserIndex = m_RemapTable[ _OptionIndex ] ;
		if( m_TargetIndex == pressAnserIndex )
		{
			// turn option to green
			PlayCorrectAnimation( true ) ;
			m_CorrectAnswerWaitTime = Time.timeSinceLevelLoad + m_CorrectAnswerWaitSec ;
			m_AnswerMode = AnswerMode.AnswerMode_WaitCorrectAnimation ;
		}
		else
		{
			// turn option to red
			TweenColor tween = m_Options[ _OptionIndex ].gameObject.GetComponent<TweenColor>() ;
			if( null != tween )
			{
				tween.PlayForward() ;
			}
		}
	}
Esempio n. 13
0
	public void TrySwitchToOptionMode()
	{
		if( m_AnswerMode != AnswerMode.AnswerMode_WaitAtAnswerMode )
		{
			return ;
		}
		m_AnswerMode = AnswerMode.AnswerMode_ChangeToOptionMode ;
	}