Modified method signature for bilateral tapping task and updated ORKTest and ORKCatalog
This commit is contained in:
@@ -363,8 +363,8 @@ typedef NS_OPTIONS(NSUInteger, ORKPredefinedTaskHandOption) {
|
||||
+ (ORKOrderedTask *)twoFingerTappingIntervalTaskWithIdentifier:(NSString *)identifier
|
||||
intendedUseDescription:(nullable NSString *)intendedUseDescription
|
||||
duration:(NSTimeInterval)duration
|
||||
options:(ORKPredefinedTaskOption)options
|
||||
handOptions:(ORKPredefinedTaskHandOption)handOptions;
|
||||
handOptions:(ORKPredefinedTaskHandOption)handOptions
|
||||
options:(ORKPredefinedTaskOption)options;
|
||||
/**
|
||||
@Deprecated
|
||||
*/
|
||||
|
||||
@@ -2,6 +2,8 @@
|
||||
Copyright (c) 2015, Apple Inc. All rights reserved.
|
||||
Copyright (c) 2016, Sage Bionetworks - Added walk back and forth module
|
||||
|
||||
Copyright (c) 2016, Sage Bionetworks - Modified two finger tapping to track tapping speed for both hands
|
||||
|
||||
Redistribution and use in source and binary forms, with or without modification,
|
||||
are permitted provided that the following conditions are met:
|
||||
|
||||
@@ -339,17 +341,16 @@ void ORKStepArrayAddStep(NSMutableArray *array, ORKStep *step) {
|
||||
return [self twoFingerTappingIntervalTaskWithIdentifier:identifier
|
||||
intendedUseDescription:intendedUseDescription
|
||||
duration:duration
|
||||
options:options
|
||||
handOptions:ORKPredefinedTaskHandOptionUndefined];
|
||||
handOptions:ORKPredefinedTaskHandOptionUndefined
|
||||
options:options];
|
||||
}
|
||||
|
||||
/// Copyright (c) 2016, Sage Bionetworks - Modified to track tapping speed for both hands
|
||||
+ (ORKOrderedTask *)twoFingerTappingIntervalTaskWithIdentifier:(NSString *)identifier
|
||||
intendedUseDescription:(NSString *)intendedUseDescription
|
||||
duration:(NSTimeInterval)duration
|
||||
options:(ORKPredefinedTaskOption)options
|
||||
handOptions:(ORKPredefinedTaskHandOption)handOptions
|
||||
{
|
||||
options:(ORKPredefinedTaskOption)options {
|
||||
|
||||
NSString *durationString = [ORKDurationStringFormatter() stringFromTimeInterval:duration];
|
||||
|
||||
NSMutableArray *steps = [NSMutableArray array];
|
||||
|
||||
@@ -1353,7 +1353,7 @@ static ORKStepResult *(^getStepResult)(NSString *, Class, ORKQuestionType, id) =
|
||||
|
||||
- (void)testStepViewControllerWillDisappear {
|
||||
TestTaskViewControllerDelegate *delegate = [[TestTaskViewControllerDelegate alloc] init];
|
||||
ORKOrderedTask *task = [ORKOrderedTask twoFingerTappingIntervalTaskWithIdentifier:@"test" intendedUseDescription:nil duration:30 options:0 handOptions:0];
|
||||
ORKOrderedTask *task = [ORKOrderedTask twoFingerTappingIntervalTaskWithIdentifier:@"test" intendedUseDescription:nil duration:30 handOptions:0 options:0];
|
||||
ORKTaskViewController *taskViewController = [[MockTaskViewController alloc] initWithTask:task taskRunUUID:nil];
|
||||
taskViewController.delegate = delegate;
|
||||
ORKInstructionStepViewController *stepViewController = [[ORKInstructionStepViewController alloc] initWithStep:task.steps.firstObject];
|
||||
@@ -1370,7 +1370,7 @@ static ORKStepResult *(^getStepResult)(NSString *, Class, ORKQuestionType, id) =
|
||||
}
|
||||
|
||||
- (void)testIndexOfStep {
|
||||
ORKOrderedTask *task = [ORKOrderedTask twoFingerTappingIntervalTaskWithIdentifier:@"tapping" intendedUseDescription:nil duration:30 options:0 handOptions:0];
|
||||
ORKOrderedTask *task = [ORKOrderedTask twoFingerTappingIntervalTaskWithIdentifier:@"tapping" intendedUseDescription:nil duration:30 handOptions:0 options:0];
|
||||
|
||||
// get the first step
|
||||
ORKStep *step0 = [task.steps firstObject];
|
||||
@@ -1479,8 +1479,8 @@ static ORKStepResult *(^getStepResult)(NSString *, Class, ORKQuestionType, id) =
|
||||
ORKOrderedTask *task = [ORKOrderedTask twoFingerTappingIntervalTaskWithIdentifier:@"test"
|
||||
intendedUseDescription:nil
|
||||
duration:10
|
||||
options:0
|
||||
handOptions:0];
|
||||
handOptions:0
|
||||
options:0];
|
||||
NSArray *expectedStepIdentifiers = @[ORKInstruction0StepIdentifier,
|
||||
ORKInstruction1StepIdentifier,
|
||||
ORKTappingStepIdentifier,
|
||||
@@ -1499,8 +1499,8 @@ static ORKStepResult *(^getStepResult)(NSString *, Class, ORKQuestionType, id) =
|
||||
ORKOrderedTask *task = [ORKOrderedTask twoFingerTappingIntervalTaskWithIdentifier:@"test"
|
||||
intendedUseDescription:nil
|
||||
duration:10
|
||||
options:0
|
||||
handOptions:ORKPredefinedTaskHandOptionLeft];
|
||||
handOptions:ORKPredefinedTaskHandOptionLeft
|
||||
options:0];
|
||||
// Check assumption around how many steps
|
||||
XCTAssertEqual(task.steps.count, 4);
|
||||
|
||||
@@ -1538,8 +1538,8 @@ static ORKStepResult *(^getStepResult)(NSString *, Class, ORKQuestionType, id) =
|
||||
ORKOrderedTask *task = [ORKOrderedTask twoFingerTappingIntervalTaskWithIdentifier:@"test"
|
||||
intendedUseDescription:nil
|
||||
duration:10
|
||||
options:0
|
||||
handOptions:ORKPredefinedTaskHandOptionRight];
|
||||
handOptions:ORKPredefinedTaskHandOptionRight
|
||||
options:0];
|
||||
// Check assumption around how many steps
|
||||
XCTAssertEqual(task.steps.count, 4);
|
||||
|
||||
@@ -1586,8 +1586,8 @@ static ORKStepResult *(^getStepResult)(NSString *, Class, ORKQuestionType, id) =
|
||||
ORKOrderedTask *task = [ORKOrderedTask twoFingerTappingIntervalTaskWithIdentifier:@"test"
|
||||
intendedUseDescription:nil
|
||||
duration:10
|
||||
options:0
|
||||
handOptions:ORKPredefinedTaskHandOptionBoth];
|
||||
handOptions:ORKPredefinedTaskHandOptionBoth
|
||||
options:0];
|
||||
ORKStep * (^filteredSteps)(NSString*, NSString*) = ^(NSString *part1, NSString *part2) {
|
||||
NSString *keyValue = [NSString stringWithFormat:@"%@.%@", part1, part2];
|
||||
NSPredicate *predicate = [NSPredicate predicateWithFormat:@"%K == %@", NSStringFromSelector(@selector(identifier)), keyValue];
|
||||
|
||||
@@ -522,6 +522,7 @@ static const CGFloat HeaderSideLayoutMargin = 16.0;
|
||||
return [ORKOrderedTask twoFingerTappingIntervalTaskWithIdentifier:TwoFingerTapTaskIdentifier
|
||||
intendedUseDescription:nil
|
||||
duration:20.0
|
||||
handOptions:ORKPredefinedTaskHandOptionBoth
|
||||
options:(ORKPredefinedTaskOption)0];
|
||||
} else if ([identifier isEqualToString:ReactionTimeTaskIdentifier]) {
|
||||
return [ORKOrderedTask reactionTimeTaskWithIdentifier:ReactionTimeTaskIdentifier
|
||||
|
||||
@@ -1181,7 +1181,7 @@ enum TaskListRow: Int, CustomStringConvertible {
|
||||
|
||||
/// This task presents the Two Finger Tapping pre-defined active task.
|
||||
private var twoFingerTappingIntervalTask: ORKTask {
|
||||
return ORKOrderedTask.twoFingerTappingIntervalTaskWithIdentifier(String(Identifier.TwoFingerTappingIntervalTask), intendedUseDescription: exampleDescription, duration: 10, options: [], handOptions: [.Both])
|
||||
return ORKOrderedTask.twoFingerTappingIntervalTaskWithIdentifier(String(Identifier.TwoFingerTappingIntervalTask), intendedUseDescription: exampleDescription, duration: 10, handOptions: [.Both], options: [])
|
||||
}
|
||||
|
||||
/// This task presents a walk back-and-forth task
|
||||
|
||||
Reference in New Issue
Block a user