Ejemplo n.º 1
0
    /// <summary>
    /// Returns the players response accuracy.
    /// The perfect accuracy would be 1, most inaccuracy is 0.
    /// </summary>
    protected float GetAccuracy(Trial t, float time)
    {
        TippingPointData data = sessionData.gameData as TippingPointData;
        bool             hasResponseTimeLimit = data.ResponseTimeLimit > 0;

        float rTime           = time - data.GuessTimeLimit;
        float totalTimeWindow = hasResponseTimeLimit ?
                                data.ResponseTimeLimit : (t as TippingPointTrial).duration;

        return(1f - (rTime / (totalTimeWindow - data.GuessTimeLimit)));
    }
Ejemplo n.º 2
0
    /// <summary>
    /// Parses Game specific variables for this Trial from the given XmlElement.
    /// If no parsable attributes are found, or fail, then it will generate some from the given GameData.
    /// Used when parsing a Trial that IS defined in the Session file.
    /// </summary>
    public override void ParseGameSpecificVars(XmlNode n, SessionData session)
    {
        base.ParseGameSpecificVars(n, session);

        TippingPointData data = (TippingPointData)(session.gameData);

        if (!XMLUtil.ParseAttribute(n, TippingPointData.ATTRIBUTE_DURATION, ref duration, true))
        {
            duration = data.GeneratedDuration;
        }

        XMLUtil.ParseAttribute(n, TippingPointData.ATTRIBUTE_SIDE, ref side);
    }
Ejemplo n.º 3
0
    /// <summary>
    /// Returns True if the given response time is considered valid.
    /// </summary>
    protected bool IsValidResponse(float time)
    {
        TippingPointData data = sessionData.gameData as TippingPointData;

        return(data.ResponseTimeLimit <= 0 || time < data.ResponseTimeLimit);
    }
Ejemplo n.º 4
0
    /// <summary>
    /// Returns True if the given response time is considered a guess.
    /// </summary>
    protected bool IsGuessResponse(float time)
    {
        TippingPointData data = sessionData.gameData as TippingPointData;

        return(data.GuessTimeLimit > 0 && time < data.GuessTimeLimit);
    }