Package org.cast.cwm.data

Examples of org.cast.cwm.data.User


      }
      return new ScoreCounts(CONTEXT_STUDENTS, correctCount, incorrectCount, unscoredCount, responseMap.size());
    }

    private Integer score(Entry<User, List<ISIResponse>> entry) {
      User user = entry.getKey();
      List<ISIResponse> responses = entry.getValue();
      if (responses.isEmpty())
        return null;
      ISIResponse firstResponse = responses.get(0);
      ISIPrompt prompt = (ISIPrompt) firstResponse.getPrompt();
View Full Code Here


    }
   
    private Map<User, List<ISIResponse>> mapResponses(List<ISIResponse> responses) {
      Map<User, List<ISIResponse>> result = new HashMap<User, List<ISIResponse>>();
      for (ISIResponse response: responses) {
        User user = response.getUser();
        if (!(result.containsKey(user))) {
          result.put(user, new ArrayList<ISIResponse>());
        }
        result.get(user).add(response);
      }
View Full Code Here

    super(id, model, targetUserModel);
  }

  @Override
  protected void handleClick() {
    User student = getUser();
    boolean newState = !isComplete();
    sectionService.setReviewed(student, sectionContentLocation, newState);
    if (isLockResponse())
      sectionService.setLocked(student, sectionContentLocation, newState);
  }
View Full Code Here

 
  protected boolean isTeacher = false;

  public ISIXmlComponent(String id, ICacheableModel<? extends IXmlPointer> rootEntry, String transformName) {
    super(id, rootEntry, transformName);
    User user = cwmSessionService.getUser();
    isTeacher = user!=null ? user.getRole().subsumes(Role.TEACHER) : false;
  }
View Full Code Here

     
      @Override
      public void onSubmit() {
        super.onSubmit();
        FeedbackMessage m = getModelObject();
        User student;

        m.setAuthor(ISISession.get().getUser());
        m.setTimestamp(new Date());
        if (m.getAuthor().getRole().equals(Role.STUDENT)) {
          student = ISISession.get().getUser();
View Full Code Here

      return null;
    return mTargetUser.getObject();
  }

  private boolean isTeacher() {
    User user = getUser();
    return (user != null) && user.getRole().subsumes(Role.TEACHER);
  }
View Full Code Here

    add(resetLink);
    resetLink.setVisible(false);

    // User may come in with a secret key from the "Forgot Password" page.
    if (params.containsKey("username") && params.containsKey("key")) {
      User user = UserService.get().getByUsername(params.getString("username")).getObject();
      if (user != null && params.getString("key").equals(user.getSecurityToken())) {
        haveKey = true;
        add (new ChangePasswordForm ("form", user));
      } else {
        log.warn("Failed reset-password attempt: username={}, key={}", params.getString("username"), params.getString("key"));
        String failed = new StringResourceModel("Password.failed", this, null, "Incorrect URL").getString();
View Full Code Here

      add(new EqualPasswordConvertedInputValidator(password, verifyPassword));
    }

    @Override
    protected void onSubmit()  {
      User user = getModelObject();
      // TODO:  commit this change in a better way
      Databinder.getHibernateSession().beginTransaction();
      user.setPassword(password.getModelObject());
      user.setSecurityToken(null);
      user.setValid(true); // if the user was not validated previously, changing password from email link will validate user
      Databinder.getHibernateSession().getTransaction().commit();
      info("Password changed.");
      fields.setVisible(false); // don't show form when confirming success
      if (CwmSession.get().isSignedIn())
        eventService.saveEvent("user:change password", null, null); // TODO - do we care about this? If so, make it work for non-logged-in case.
View Full Code Here

    return status.getReviewed();
  }
 
  @Override
  protected void handleClick() {
    User student = getUser();
    boolean newState = !isReviewed();
    sectionService.setReviewed(student, sectionContentLocation, newState);
    if (isLockResponse())
      sectionService.setLocked(student, sectionContentLocation, newState);
  }
View Full Code Here

          private static final long serialVersionUID = 1L;

          // for each student add the following fields
          @Override
          protected void populateItem(ListItem<User> userItem) {
            final User student = userItem.getModelObject();
            userItem.add(new StudentFlagPanel("flagPanel", student, mFlagMap.getObject()));
            userItem.add(new Label("studentName", student.getSortName()));

            // The cells in the table are status indications
            userItem.add(new ListView<ISIXmlSection>("statusCell", rootSection.getSectionChildren()) {
              private static final long serialVersionUID = 1L;
View Full Code Here

TOP

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

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.