*
* @param ureq The request to extract item responses from.
* @return ItemsInput
*/
public ItemsInput getItemsInput(UserRequest ureq) {
ItemsInput result = new ItemsInput();
Enumeration params = ureq.getHttpReq().getParameterNames();
while (params.hasMoreElements()) {
String paramKey = (String) params.nextElement();
StringTokenizer st = new StringTokenizer(paramKey, "§", false);
String value = ureq.getParameter(paramKey);
if (st.countTokens() == 4) {
String itemType = st.nextToken();
String itemIdent = st.nextToken();
String responseID = st.nextToken();
HttpItemInput itemInput = (HttpItemInput) result.getItemInput(itemIdent);
if (itemInput == null) {
itemInput = new HttpItemInput(itemIdent);
result.addItemInput(itemInput);
}
// 'dummy' type is used to make sure iteminput is constructed for
// all items. it does not provide any response data
if (itemType.equals("qti")) itemInput.putSingle(responseID, value);
}