tincan 1.0.6

A Dart library of the Tin Can API #

For more information about the Tin Can API visit:

http://tincanapi.com/

Installation: #

In your pubspec.yaml

dependencies:
  tincan: any

Sample Usage: #

In your code:

import 'package:tincan/tincan.dart';

final lrs = RemoteLRS(
      endpoint: 'https://my.lrs.provider',
      username: 'account key or user name',
      password: 'account secret or password',
    );

final statement = Statement(
  actor: Agent(
    mbox: 'mailto:person@doingsomething.com',
    name: 'Test Agent',
  ),
  verb: Verb(
    id: 'http://adlnet.gov/expapi/verbs/experienced',
    display: {'en-US': 'experienced'},
  ),
  object: Activity(
    id: 'http://tincanapi.com/TinCanDart/Test/Unit/0',
    definition: ActivityDefinition(
      type: 'http://id.tincanapi.com/activitytype/unit-test',
      name: {'en-US': 'TinCanDart Tests: Unit 0'},
      description: {
        'en-US': 'Unit test 0 in the test suite for the Tin Can Dart library.'
      },
    ),
  ),
);

lrs.saveStatement(statement);

1.0.6 #

  • Mainly documentation changes and minor tweaks to make the API more usable

1.0.3 #

  • Improved support for Learning Locker and Yet Analytics LRS servers

1.0.0 #

  • Initial version mainly tested on ScormCloud LRS

example/example.dart

import 'package:tincan/tincan.dart';

main() async {
  final lrs = RemoteLRS(
    endpoint: '',
    username: '',
    password: '',
  );

  final statements = await lrs.queryStatements(StatementsQuery(limit: 10));

  print('Statement count : ${statements.data?.statements?.length}');
  _printStatements(statements?.data?.statements);
  print('more at ${statements.data?.moreUrl}');

  String more = statements.data?.moreUrl;
  while (more != null) {
    _printStatements(statements?.data?.statements);
    final moreStatements = await lrs.moreStatements(more);
    print('more at ${moreStatements.data?.moreUrl}');
    more = moreStatements.data?.moreUrl;
  }
}

void _printStatements(List<Statement> statements) {
  statements?.forEach((statement) {
    print('  Statement - ${statement.id}');
  });
}

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:


dependencies:
  tincan: ^1.0.6

2. Install it

You can install packages from the command line:

with pub:


$ pub get

with Flutter:


$ flutter pub get

Alternatively, your editor might support pub get or flutter pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:


import 'package:tincan/tincan.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
0
Health:
Code health derived from static analysis. [more]
99
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
100
Overall:
Weighted score of the above. [more]
50
Learn more about scoring.

We analyzed this package on Jul 17, 2019, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.4.0
  • pana: 0.12.19

Platforms

Detected platforms: Flutter, web, other

No platform restriction found in primary library package:tincan/tincan.dart.

Health suggestions

Fix lib/src/statement.dart. (-1 points)

Analysis of lib/src/statement.dart reported 2 hints:

line 83 col 17: 'voided' is deprecated and shouldn't be used.

line 122 col 30: 'voided' is deprecated and shouldn't be used.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.0.0 <3.0.0
crypto ^2.0.6 2.0.6
http ^0.12.0 0.12.0+2
http_parser ^3.1.3 3.1.3
uuid ^2.0.0 2.0.2
Transitive dependencies
async 2.3.0
charcode 1.1.2
collection 1.14.11
convert 2.1.1
meta 1.1.7
path 1.6.2
pedantic 1.8.0+1
source_span 1.5.5
string_scanner 1.0.4
term_glyph 1.1.0
typed_data 1.1.6
Dev dependencies
build_runner ^1.0.0
build_web_compilers ^0.4.0
test ^1.0.0

Admin