ITR file formats

From ITR Wiki

The ITR can save almost everything you build to a file: tests, reports, screen templates, batteries and translations. With these files you make a backup, move your work to another ITR server or share it with others. The ITR also produces files with results: session archives, research data and credit overviews.

This page describes every file format, what is inside and what happens when you upload it again. It is written for developers, administrators and authors who want to know exactly what they are working with. The formats follow the ITR data model, so read that page first if you want the details of the objects. The code is leading: when this page and the code differ, the code is right.

Overview

File What it holds Made with Read by
.itrtesttemplate One test definition, as JSON. A single download also holds the media files. Test editor: Download template definition or Download all templates as ZIP Test editor, central test installation
.itrreporttemplate One report definition, as JSON Report editor Report editor, central report installation
.itrscreentemplate One screen template, as JSON Screen template editor Screen template editor, central template installation
.itrbatterytemplate One battery, as JSON Battery editor Battery editor
.itrlanguagetemplate All translated texts of one language, as JSON Translation editor Translation editor
itrtesttemplates.zip, itrreporttemplates.zip, itrscreentemplates.zip A ZIP file with one definition file per item Download all templates as ZIP in the editors Upload ZIP in the same editor
Session results archive (.zip) Score overview, answers, reports and the raw data of a session, a group session or a public session Download session results archive People and other software
itr_data_download.csv or .tsv Anonymised research data Download test data Statistics software, spreadsheets
itr_creditsused_download.csv, itr_CreditsGranted_download.csv and itr_creditsusedserver_download.csv Credit overviews The credit lists Spreadsheets

Definition files

What is inside

All definition files (.itrtesttemplate, .itrreporttemplate, .itrscreentemplate and .itrbatterytemplate) are plain JSON text in UTF-8, made by ITSJSONStringify. They contain exactly what is saved on the server: the properties in persistentProperties, with every object marked by its _objectType. A test file starts like this:

{"_objectType":"ITSTest","ID":"5f0c…","TestName":"MyTest","Description":"My test", …
 "screens":[{"_objectType":"ITSTestScreen","id":"9a1e…","varName":"Screen1", …

You can open these files in any text editor. Edit them by hand only if you know the data model well: a missing comma makes the whole file unreadable.

The file name is the name of the item in lower case, with every character other than a letter or a digit replaced by _.

IDs travel with the file

A definition file keeps the IDs of the item and of everything it refers to. A report keeps the TestID of its test, a battery keeps the IDs of its tests, reports and norms, and a screen component keeps the templateID of its screen template. As long as you move tests, reports, screen templates and batteries together through files, all these links keep working on the other server.

When you build a test on a server where a screen template it uses is missing, upload the screen template first.

Media files in a test

Download template definition in the test editor adds the media files of the test to the file, in the property files_binary.list. Every entry holds:

  • name: the file name;
  • type: media for the files used in the test screens (folder test on the server), or catalog for the files of the test catalog (folder media on the server);
  • data: the content of the file as a binary string, one character per byte.

When you upload such a file into a test, the ITR uploads these files to the server again.

Download all templates as ZIP does not include media files. Use it for the definitions only, and move media files with single downloads.

Uploading into an item that is open

The editors have an Upload … definition button that loads a file into the item that is open:

  • Simple values, such as the name, the texts and the scripts, are replaced by those in the file.
  • Lists are added to, because ITSJSONLoad adds to lists (see ITSJSONLoad). Screens, scales, score lines and norms of a test, graphs of a report, variables of a screen template and the tests and reports of a battery from the file are added to the ones the item already has.
  • The test and report editors keep the ID of the open item, unless it is a new item. The battery editor always keeps the ID of the open battery. The screen template editor takes the ID from the file, so saving afterwards writes to the template with that ID.

So for an exact copy, first create a new, empty item and upload into that. For a new test, the editor removes the default scale first, so the result is exactly the test from the file.

Uploading a ZIP file

Upload ZIP in the test, report and screen template editors reads every file in the ZIP file and saves it under the ID that is in the file:

  • If an item with that ID exists in your organisation, it is overwritten. This is the case when you upload a ZIP file that was made on the same server.
  • If not, the item is created with that ID. This is the case on another server.

The editors also look for an item with the same name in the list on your screen (for reports: the same name for the same test) and show the uploaded item in its place. On another server, an item that only has the same name is not overwritten: after reloading the page you see both. Remove the one you do not need.

All items from a ZIP file go to the database of your own organisation. See also Merging tests with a ZIP upload.

Translation files

The server keeps the translations as one JSON file per language in the folder translations of the instance folder, for example nl.json. Every text has an entry like:

"ITSSessionEditor.ScoreOverview": {
 "id": "ITSSessionEditor.ScoreOverview",
 "value": "Scoreoverzicht",
 "originalValue": "Score overview",
 "valueAsOriginal": "N",
 "changeDateTime": "…",
 "changedBy": "…"
}

Download translation file saves these texts as <language code>.itrlanguagetemplate. Upload translation file sends a file to the server, which then replaces the whole translation file of that language. The language is taken from the file name: the part before the first dot must be a two letter language code, such as nl.itrlanguagetemplate. Only server administrators and translators can upload. See Translations.

Session results archive

Download session results archive on an individual, group or public session makes a ZIP file. It contains:

File What it holds
Score overview.html The score overview of the session, as on the session screen.
<test>/Answers overview.html The answers per test, when you chose to include the answers.
<test>/<report>.html Every report of every test, when you chose to include the reports. When a report was saved after editing, the saved version is used, and the freshly generated version is added as <report>.original.html.
data.json The raw answers and scores, see below.
coupons.txt The coupon codes that candidates entered, one per line. Only when there are any.

For group and public sessions every candidate gets a folder, named with a number, the name of the candidate and the session description. The file names in italics are translated into the language of the user. The HTML files load their styles and fonts from the internet, so they look best when you are online.

data.json holds an object per folder (the test name, or the candidate folder). In it, <TestName>.answers is the Results object of the test and <TestName>.scores is the Scores object, exactly as described on ITR data model. When a test occurs more than once, a number is added, such as .answers.1.

Research data

Download test data (see Tests and Reports menu) makes one file with anonymised research data:

  • CSV: comma separated. Every value is between double quotes, double quotes inside a value are doubled and line breaks are removed.
  • TSV: tab separated. Every value is between double quotes, and tabs inside a value are removed.

The first line holds the column names. Columns are dotted paths built from names, such as the test name and the names of scales, screens and components; the internal IDs are left out. By default there is one line per test per session. With All session results in one line there is one line per session. Remove empty columns and Remove session description are switched on by default.

Credit overviews

The credit lists (see Credits) can be downloaded as CSV: comma separated, every value between double quotes, with the column names on the first line. Internal IDs such as CompanyID, UserID and SessionID are left out of the overview of granted credits.

Public repositories on GitHub

A server administrator can install ready made content from the public repositories itr-testtemplates, itr-reporttemplates, itr-testscreentemplates and itr-translations (see Server settings and tools). The server keeps a copy of each repository in the folder cache/git of the instance folder.

  • The repositories contain the same .itrtesttemplate, .itrreporttemplate and .itrscreentemplate files as described above, and the translation files as <language code>.json.
  • A file named like the content file plus .itrinfo, for example mytest.itrtesttemplate.itrinfo, holds the explanation that is shown in the list.
  • Tests, reports and screen templates are installed in the central (master) database, so every organisation on the server can use them. Translation files are copied to the translations folder.

To share your own content this way, put the files in such a repository, with an .itrinfo file next to each.

Where to go next