Package org.olat.ims.qti.container

Examples of org.olat.ims.qti.container.ItemsInput


   *
   * @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);
      }
View Full Code Here

TOP

Related Classes of org.olat.ims.qti.container.ItemsInput

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.