/// <summary> /// Returns the next Problem for the Player as an instance of the Problem class. If there aren't /// enough Problems left in the queue, an asynchronous task will retrieve more from the Senseix /// server. /// </summary> public static Problem NextProblem() { if (AllAnswerPartsGiven() && !GetMostRecentProblem().HasBeenSubmitted()) { ThinksyPlugin.GetMostRecentProblem().SubmitAnswer(); } Senseix.Message.Problem.ProblemData protobufsProblem = Senseix.SenseixSession.PullProblem(); Senseix.Logger.BasicLog("Next problem! Problem ID: " + protobufsProblem.uuid + " Category: " + protobufsProblem.category_name); //Debug.Log ("Next problem! Problem ID: " + protobufsProblem.uuid + " Category: " + protobufsProblem.category_name); mostRecentProblem = new Problem(protobufsProblem); ThinksyQuestionDisplay.DisplayCurrentQuestion(); return(mostRecentProblem); }
void Start() { ThinksyQuestionDisplay.DisplayCurrentQuestion(); }
/// <summary> /// Removes the most recent answer part. You might use this if you want to give your player /// a chance to retry an incorrect answer part, without retrying the whole problem. /// </summary> public void RemoveMostRecentAnswerPart() { answerParts.RemoveAt(answerParts.Count - 1); ThinksyQuestionDisplay.DisplayCurrentQuestion(); }
/// <summary> /// Adds a part to this answer. /// </summary> /// <param name="part">Added Part.</param> public void AddAnswerPart(ProblemPart part) { answerParts.Add(part); ThinksyQuestionDisplay.DisplayCurrentQuestion(); }