Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/rusticisoftware/tincanobjc
Objective-C library for TinCanAPI
https://github.com/rusticisoftware/tincanobjc
Last synced: 26 days ago
JSON representation
Objective-C library for TinCanAPI
- Host: GitHub
- URL: https://github.com/rusticisoftware/tincanobjc
- Owner: RusticiSoftware
- License: apache-2.0
- Created: 2013-04-23T03:57:35.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2020-09-09T16:45:50.000Z (over 4 years ago)
- Last Synced: 2024-03-26T01:21:27.949Z (9 months ago)
- Language: Objective-C
- Size: 137 KB
- Stars: 16
- Watchers: 25
- Forks: 5
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
TinCanObjC
==========
[![Build Status](https://travis-ci.org/RusticiSoftware/TinCanObjC.png)](https://travis-ci.org/RusticiSoftware/TinCanObjC)ObjC version of TinCan SDK
##Creating and Sending A Statement
NSMutableDictionary *options = [[NSMutableDictionary alloc] init];
NSMutableDictionary *lrs = [[NSMutableDictionary alloc] init];
[lrs setValue:@"https://cloud.scorm.com/ScormEngineInterface/TCAPI/public/" forKey:@"endpoint"];
[lrs setValue:@"Basic abcd1234abcd1234ETmM1bWFwYk5wckg5aE1KQmNaNTFabcdefghijklmnop123" forKey:@"auth"];// just add one LRS for now
[options setValue:[NSArray arrayWithObject:lrs] forKey:@"recordStore"];
RSTinCanConnector *tincan = [[RSTinCanConnector alloc]initWithOptions:options];
// create a TCActor with the user's information
TCAgent *actor = [[TCAgent alloc] initWithName:@"Joe User" withMbox:@"mailto:[email protected]"];
// create a very basic TCActivityDefinition that doesn't contain any extensions or interaction detail.
TCActivityDefinition *actDef = [[TCActivityDefinition alloc] initWithName:[[TCLocalizedValue alloc] initWithLanguageCode:@"en-US" withValue:@"http://tincanapi.com/testCourse"]
withDescription:[[TCLocalizedValue alloc] initWithLanguageCode:@"en-US" withValue:@"Description for test statement"]
withType:@"http://adlnet.gov/expapi/activities/course"
withExtensions:nil
withInteractionType:nil
withCorrectResponsesPattern:nil
withChoices:nil
withScale:nil
withTarget:nil
withSteps:nil];
TCActivity *activity = [[TCActivity alloc] initWithId:@"http://tincanapi.com/test" withActivityDefinition:actDef];
TCVerb *verb = [[TCVerb alloc] initWithId:@"http://adlnet.gov/expapi/verbs/experienced" withVerbDisplay:[[TCLocalizedValue alloc] initWithLanguageCode:@"en-US" withValue:@"experienced"]];
TCStatement *statementToSend = [[TCStatement alloc] initWithId:[TCUtil GetUUID] withActor:actor withTarget:activity withVerb:verb];
[tincan sendStatement:statementToSend withCompletionBlock:^(){
// do your completion stuff here
}withErrorBlock:^(TCError *error){
NSLog(@"ERROR: %@", error.localizedDescription);
STAssertNil(error, @"There was no error with the request");
}];