Package org.cast.cwm.data

Examples of org.cast.cwm.data.Response


    else
      return "img/icons/response_negative.png";
  }
 
  private boolean isCorrect() {
    Response r = mResponse.getObject();
    return (r!=null && r.isCorrect());
  }
View Full Code Here


  protected Integer getScore() {
    List<Response> responses = getResponses();
    if (responses.isEmpty())
      return null;
    Response response = responses.get(0);
    ISIPrompt prompt = (ISIPrompt) response.getPrompt();
    PromptType type = prompt.getType();
    if (type.equals(PromptType.SINGLE_SELECT))
      return response.getResponseData().getScore();
    else
      return response.getScore();
  }
View Full Code Here

 
  /* (non-Javadoc)
   * @see org.cast.isi.service.IISIResponseService#saveSingleSelectResponse(org.apache.wicket.model.IModel, java.lang.String, boolean, java.lang.String)
   */
  public void saveSingleSelectResponse(IModel<Response> mResponse, String text, boolean correct, String pageName) {
    Response r = mResponse.getObject();
    int score = correct ? 1 : 0;
    // Number of tries counts up until a correct response is recorded, then stops.
    if (!r.isCorrect()) {
      Set<ResponseData> previousResponses = r.getAllResponseData();
      r.setTries(previousResponses==null ? 1 : previousResponses.size()+1);
    }
    // New score is recorded if it is better than previous tries
    if (r.getScore()==null || score > r.getScore())
      r.setScore(score);
    // Multiple choice always has total points = 1
    r.setTotal(1);
    super.genericSaveResponse(mResponse, text, score, 1, 1, null, pageName);
  }
View Full Code Here

    user.setLastName("Mouse");
    return user;
  }
 
  private Response makeResponse(Prompt prompt) {
    Response response = new Response();
    response.setPrompt(prompt);
    return response;
  }
View Full Code Here

      return new TeacherScoreResponseButtonPanel(panelId, makeResponseModelList());
    }
  }

  private Response makeResponse(Prompt prompt) {
    Response response = new Response();
    response.setPrompt(prompt);
    return response;
  }
View Full Code Here

TOP

Related Classes of org.cast.cwm.data.Response

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.