UPT is a proprietary format devised by Neptun (a Hungarian LMS) to export and import questions and answers in their Unipol online quiz system.
In 2021, business requirement arose that a tool to convert UPT export files to a "more friendly" format should be made.
Of course, being a proprietary format, .upt files needed to be "reverse engineered" first. Essentially, they are UTF-16LE encoded XML files with a custom extension. They can contain folder(s) with n levels of subfolders, with questions and answers in any of them. I will not go into details about the format itself, I believe the code documents itself in this regard as much as necessary.
However, it's worth noting that only a subset of the format is being used in this conversion, both horizontally (ie. the numbed of questions types that may be converted) and vertically (ie. the number of features on any one question). This is due to the ultimate business requirement, the output format.
This tool is a rewrite of the original one, written in Go.
TODO.
The output format of the conversion is flattened in nature, ie. subfolders are recursively processed. Folders themselves, however, are preserved.
This is the top-level object that is generated
Property | Type | Note |
---|---|---|
name |
string |
User provided |
folders |
Folder[] |
Property | Type | Note |
---|---|---|
name |
string |
|
questions |
Question[] |
Property | Type | Note |
---|---|---|
text |
string |
The body of the question |
type |
QuestionType |
Enum |
possibleAnswers |
string[] |
Empty when type is ExactText |
possibleOptions |
string[] |
Possible options. Only applicable for MultipleAnswers , Table and Grouping |
answers |
AnswerWrapper |
Despite the naming, it's a single object |
Property | Type | Note |
---|---|---|
singleAnswer |
string | null |
Deprecated |
textAnswers |
string[] |
All valid free text answers |
answers |
Answer[] |
Non-free text answers |
Property | Type | Note |
---|---|---|
answerIndex |
number |
The index of the valid answer |
optionIndex |
number |
The index of the matching option, -1 if not applicable |
ExactText
SingleAnswer
MultipleAnswers
Table
Grouping
This project is public for demonstration purposes only. Contact me at [email protected] if you are interested in using it.