// Initializes everything. void Start() { SPINState = SPINEnum.Question0; DASSState = DASSEnum.Question0; DatabaseInserts.CreateSession(Constants.SURVEYS_SCENEID); reactionTimer = System.Diagnostics.Stopwatch.StartNew(); data = new List <SurveyAnswerData>(); }
// Move through the DASS survey until the end. Then start WSAP. private void DASSClick() { Debug.Log(reactionTimer.ElapsedMilliseconds / 1000.0 + " seconds"); DASSState = DASSState.next(); if (!DASSState.Equals(DASSEnum.END)) { question.text = DASSState.GetQuestion(); Debug.Log(DASSState.GetQuestion()); reactionTimer.Reset(); reactionTimer.Start(); } else { Invoke("NextScene", COUNT_DOWN); running = false; countDownTimer.Start(); } }
// Gets the next DASS state. public static DASSEnum next(this DASSEnum value) { return(Enum.GetValues(typeof(DASSEnum)).Cast <DASSEnum>() .SkipWhile(e => e != value).Skip(1).First()); }
// Returns the DASS question. public static string GetQuestion(this DASSEnum value) { return(value.GetDASSAttribute <DASSAttribute>().Question); }