Files
Pariece McKinney b14e5cfcb0 Public Release 3.0
2024-03-28 19:39:04 -04:00

143 lines
4.7 KiB
Objective-C

/*
Copyright (c) 2015, Shazino SAS. All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation and/or
other materials provided with the distribution.
3. Neither the name of the copyright holder(s) nor the names of any contributors
may be used to endorse or promote products derived from this software without
specific prior written permission. No license is granted to the trademarks of
the copyright holders even if such marks are included in this software.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#import <ResearchKit/ORKResult.h>
NS_ASSUME_NONNULL_BEGIN
@class ORKPSATSample;
/**
The `ORKPSATResult` class records the results of a PSAT test.
The PSAT result object records the initial digit, an array of addition samples, the total of correct answers
and also various attributes of the PSAT test.
The PSAT samples are generated by the framework as the task proceeds.
When the task completes, it may be appropriate to serialize them for transmission to a server,
or to immediately perform analysis on them.
*/
ORK_CLASS_AVAILABLE
@interface ORKPSATResult : ORKResult
/**
The PSAT presentation mode.
*/
@property (nonatomic, assign) ORKPSATPresentationMode presentationMode;
/**
The time interval between two digits presented.
PSAT-2" is 2 seconds; PSAT-3" is 3 seconds.
*/
@property (nonatomic, assign) NSTimeInterval interStimulusInterval;
/**
The amount of time a digit is shown on the screen (0 second for PASAT).
*/
@property (nonatomic, assign) NSTimeInterval stimulusDuration;
/**
The length of the series, that is, the number of additions.
*/
@property (nonatomic, assign) NSInteger length;
/**
The number of correct sums given (out of 'length' possible ones).
*/
@property (nonatomic, assign) NSInteger totalCorrect;
/**
The number of consecutive correct answers (out of 'length - 1' possible ones).
Used to overcome the alternate answer strategy.
*/
@property (nonatomic, assign) NSInteger totalDyad;
/**
The total time needed to answer all additions (that is, the sum of all the samples times).
*/
@property (nonatomic, assign) NSTimeInterval totalTime;
/**
The initial digit.
*/
@property (nonatomic, assign) NSInteger initialDigit;
/**
An array of collected samples, in which each item is an `ORKPSATSample`
object that represents an addition sample.
*/
@property (nonatomic, copy, nullable) NSArray<ORKPSATSample *> *samples;
@end
/**
The `ORKPSATSample` class represents a numeric answer to an addition question.
If the answer is correct, the sample object records the presented digit and the numeric answer.
A PSAT sample is included in an `ORKPSATResult` object and is recorded
by the step view controller for the corresponding task.
A PSAT sample is typically generated by the framework as the task proceeds.
When the task completes, it may be appropriate to serialize the sample for
transmission to a server, or to immediately perform analysis on it.
*/
ORK_CLASS_AVAILABLE
@interface ORKPSATSample : NSObject <NSCopying, NSSecureCoding>
/**
A Boolean value indicating whether the addition answer was the correct one.
The value of this property is `YES` when the addition result is the correct
one, and `NO` otherwise.
*/
@property (nonatomic, assign, getter=isCorrect) BOOL correct;
/**
The presented digit.
*/
@property (nonatomic, assign) NSInteger digit;
/**
The numeric answer;
`-1` if no answer is provided.
*/
@property (nonatomic, assign) NSInteger answer;
/**
The time interval between the new digit and the answer, or test duration if no answer is provided.
*/
@property (nonatomic, assign) NSTimeInterval time;
@end
NS_ASSUME_NONNULL_END