Exemplo n.º 1
0
  public synchronized ActionRendering action(ActionParams ap) throws OmException {
    arCurrent = new ActionRendering();

    // Pass to document
    qd.action(ap);

    // Render current state
    if (!arCurrent.isSessionEnd()) {
      qd.render(arCurrent, false);
    }
    fixPlaceholders(arCurrent);

    ActionRendering ar = arCurrent;
    arCurrent = null;
    return ar;
  }
Exemplo n.º 2
0
 /**
  * Sets the progress information text, which is displayed outside the question to give the user an
  * idea of their progress through this question (e.g. 'You have 3 attempts left'.)
  *
  * <p>If you don't call this, the progress info remains the same as it was before (blank, if you
  * never set it).
  *
  * @param sProgressInfo Progress string
  */
 protected void setProgressInfo(String sProgressInfo) throws OmDeveloperException {
   if (arCurrent == null)
     throw new OmDeveloperException("Cannot call setProgressInfo() when not within action()");
   arCurrent.setProgressInfo(sProgressInfo);
 }
Exemplo n.º 3
0
 /**
  * Causes the information in the Results object to be sent to the test navigator and stored. You
  * should call this only once per question; it doesn't have to be right at the end of the question
  * (although it can be).
  *
  * @throws OmDeveloperException
  */
 protected void sendResults() throws OmDeveloperException {
   if (arCurrent == null)
     throw new OmDeveloperException("Cannot call sendResults() when not within action()");
   arCurrent.sendResults(rResults);
 }
Exemplo n.º 4
0
 /**
  * Causes the question to end. (Call from within action processing; you can't end a question in
  * the init() call.) Control returns from this method as usual, although you probably shouldn't do
  * anything else afterwards.
  */
 protected void end() throws OmDeveloperException {
   if (arCurrent == null)
     throw new OmDeveloperException("Cannot call end() when not within action()");
   arCurrent.setSessionEnd();
 }