Things cannot be here defined in a "binary way": We must introduce a threshold and consider that the played duration d is right if we have:
(expected duration - ) < d < (expected duration +
)
Threshold value should depend on note's own duration, and not exceed 50% of this duration. The precise definition of this value will depend on what the player (or the teacher) wants: it can not be the same value for a beginner and for an experienced musician, and from a musical piece to another. Let's take an example:
A piece of J.S. Bach, with a lot of repeated and regular notes, has to be played with a strong exactitude. The value should not be too high. On the other hand, in a piece of Chopin where player's own "feeling" affects the general rhythm, we should not consider that would be an interpretation as an error. The threshold value should be here higher.
A good compromise would be to give the possibility to the user to define the value corresponding to the musical piece. This threshold value would become a parameter of the score, and directly correspond to the musical style of the piece.