public void submitFeedback() { if (username == "") { username = "******"; } DataDump.Initialize(); List <object> surveyAnswers = new List <object>(); surveyAnswers.Add(username); surveyAnswers.Add(answers[0]); surveyAnswers.Add(answers[1]); for (int i = 0; i < 3; i++) { surveyAnswers.Add(textAnswers[i]); } DataDump.CreateEntry("A", "F", surveyAnswers, 1); CameraScript.Instance.CalculateTimes(username); }
private void calculateTimes(List <object> Values) { List <object> values = Values.ToList(); DataDump.Initialize(); bool completed = false; if (endTime != 0) { completed = true; } List <float> fillList(List <float> list) { List <float> tempList = list.ToList(); while (tempList.Count < 3) { tempList.Add(-1); } return(tempList); } void formatList(List <float> list) { List <float> tempList = list.ToList(); float temp = 0; for (int i = 0; i < 3; i++) { values.Add(tempList[i]); if (tempList[i] != -1) { temp += tempList[i]; } } values.Add(temp); } values.Add(completed.ToString()); List <float> _times = new List <float>(); times = fillList(times); for (int i = 0; i < 3; i++) { if (times[i] != -1) { if (i == 0) { _times.Add(Mathf.Abs(times[i] - startTime)); } else { if (times[i - 1] != -1) { _times.Add(Mathf.Abs(times[i] - times[i - 1])); } else { _times.Add(-1); } } } } formatList(_times); List <float> hintsList = fillList(hintsUsed.Select <int, float>(i => i).ToList()); formatList(hintsUsed.Select <int, float>(i => i).ToList()); penalties = fillList(penalties); formatList(penalties); formatList(_times.Zip(penalties, (x, y) => (x != -1 || y != -1 ? ((x != -1 ? x : 0) + (y != -1 ? y : 0)) : -1)).ToList()); if (times.Contains(-1)) { values[values.Count - 1] = -1; } DataDump.CreateEntry("A", "R", values, 0); }