"Date" (Comparison Method)
Details
- The "Date" comparison method considers two date objects to be equivalent if they do not differ by a given amount of time.
- This allowed time difference should be given as a time Quantity using the Tolerance option in AssessmentFunction. The default tolerance is zero seconds.
- By default, the date comparison between the answer key and the answer is computed using the DateDifference function. The DistanceFunction option can be used to specify a custom temporal distance metric.
- Using the default distance function DateDifference, when the granularities are not consistent, assessment is based on the smallest granularity and the starting points of dates with larger granularities.
- When multiple values in the answer key are within the tolerance range of an answer, the closest value is selected.
- For convenience, vectors with multiple components are also accepted as input and treated as arguments to DateObject.
Examples
open allclose allBasic Examples (1)
Create an AssessmentFunction for a date question with a tolerance:
Scope (2)
Generalizations & Extensions (1)
Any valid input for DateObject is supported when the "Date" method is explicitly specified:
Applications (1)
Create a QuestionObject using "Date" interpretation on the inputs:
Properties & Relations (1)
Create a QuestionObject treating years as numbers:
Using "Date" comparison with interpretation allows all common date forms:
Possible Issues (2)
Answers with smaller granularities than the answer key are compared to the starting point of the key and may have nonzero distances:
Create a custom distance function conforming the answer to match the granularity of the answer key:
Any value within the answer key date is marked correct:
The date comparison method will be automatically inferred only if the answer key is a DateObject:
Other date specifications will not automatically be treated as dates: