Importing Items

Smarter Balanced Test Item Bank Component
Post Reply
rael9
Posts: 1
Joined: Thu Dec 10, 2015 8:18 pm

Importing Items

Post by rael9 » Thu Dec 10, 2015 8:26 pm

I have been unable to find any documentation on importing Test Items using the TIB. From what I have gathered, it seems like you have to upload the .zip file to the sftp directory, and then call the /sftpFileImport REST API with the correct JSON to do this. I have 2 questions:

1) Assuming the method laid out above is correct, why would I be getting a "You are not authorized to access this portion of the application, please verify your roles with your Administrator" message, when I do in fact have the "TIB Import" permission assigned to me?

2) *Is* this the correct method, or is there an easier way to do these imports that I'm just not aware of?

Jim

User avatar
ramilevy
Posts: 160
Joined: Thu Jun 27, 2013 1:07 am

Re: Importing Items

Post by ramilevy » Wed Jan 06, 2016 8:27 pm

Hello Jim,

Thanks for your post, and apologies for the delayed reply. Here is a detailed set of instructions to follow for importing items into TIB:
1. Create a ZIP file (item package) containing one or more items (and/or stimuli) in the SmarterApp item packaging format (http://www.smarterapp.org/documents/Sma ... kaging.pdf). This package must include a manifest file and all associated content resources for those items/stims, as per the specification.
2. Ensure TIB is configured properly in Program Management/Configure Component Properties, with credentials to the SFTP site, import directory name, OAuth information, etc.
3. Obtain the tenant ID of the tenant (usually a state) for which this item package is targeted (this ID is available in Program Management/Manage Tenants. Edit the tenant in question and find the ID string in the URL after /tenant/. For example, 53cd5f63e4b0127edfb96ccb).
4. Create a directory with a name matching the tenant ID, under the base path of the SFTP site's user.
5. Upload the item package to an SFTP site, into the tenant ID directory.
6. Obtain an OAuth token on behalf of a user with admin privileges in Test Item Bank (and tenancy of the tenant in question).
7. Call the TIB REST endpoint /sftpFileImport to process the item package. Use the appropriate parameters in the header of the call:

Code: Select all

     Authorization: Bearer oath_access_token_here
     Accept: application/json
     Content-Type: application/json
and the proper information in the body of the call:

Code: Select all

{"tenantId":"tenant_id_here","importFiles":[{"pathName":"item_package_name1.zip"},{"pathName":"item_package_name2.zip"},...}]}
The API will respond with the current status and an identifier for the current import set.
8. Note: depending on the size of the packages, processing could take a while. You can use the TIB /importSet API (with the identifier provided by the sftpFileImport call) to identify the current status of the import.

Hope this helps,
Rami

Post Reply