示例#1
0
    /// <summary>Called when a client send an answer.</summary>
    /// <param name="c">The client that sent the answer.</param>
    /// <param name="rep">The id of the response.</param>
    /// <returns>void</returns>
    public void rcvAnswer(ref Client c, int rep)
    {
        AnswerKeeper a = new AnswerKeeper();

        a.question     = oldQuestions[oldQuestions.Count - 1];
        a.rep          = rep;
        a.answerTime   = Time.time - questionSendTime;
        a.result       = (a.question.bonneReponse == rep);
        c.AnsweredLast = true;
        c.addAnswer(a, courseId);
    }
示例#2
0
    /// <summary>Check the answers of the clients for the last question.</summary>
    /// <returns>void</returns>
    void checkClientsAnswers()
    {
        foreach (KeyValuePair <string, Client> e in C3PONetworkManager.Instance.ClientsInfos)
        {
            if (!e.Value.AnsweredLast)
            {
                AnswerKeeper a = new AnswerKeeper();
                a.question   = oldQuestions[oldQuestions.Count - 1];
                a.rep        = a.question.bonneReponse + 1;
                a.answerTime = 999;
                a.result     = false;

                e.Value.addAnswer(a, courseId);
                Debug.Log("Didn't answer, creating default answer");
            }
            e.Value.AnsweredLast = false;
        }
    }