org.activemath.webapp.exercises
Class ExerciseController

java.lang.Object
  extended by org.infohazard.maverick.ctl.Throwaway2
      extended by org.infohazard.maverick.ctl.ThrowawayBean2
          extended by org.activemath.webapp.base.ControllerBase
              extended by org.activemath.webapp.exercises.ExerciseController
All Implemented Interfaces:
Controller
Direct Known Subclasses:
CasConsoleController, DRConsoleController, ExerciseSequencerExtensionController

public class ExerciseController
extends ControllerBase

Generate a bean for an exercise. Request parameters:


Nested Class Summary
protected  class ExerciseController.ExerciseSheetItem
           
 
Field Summary
protected  InteractionManager _teacherAssistant
           
protected  Vector<InteractionManager.UserInputHistoryEntry> _userInputHistory
           
protected  String bookId
           
protected  String confidence
           
protected  boolean confidenceEnabled
           
protected  Configuration config
           
protected  String defaultInputSyntax
           
protected  boolean displayOutputFormatOptions
           
protected  boolean displayUserInputSyntaxOptions
           
static String EXERCISE_CONTAINER
          key for exercise container attached to user
protected  String exerciseId
           
protected  Vector<ExerciseController.ExerciseSheetItem> exerciseSheetItems
           
protected  boolean isAssessment
           
protected static Logger log
          The logger for this class
protected  boolean logExerciseResult
           
protected  String presentationStrategy
           
protected  boolean showFinishButton
           
protected  String speechContent
           
protected  String strategy
           
protected  String type
          Bean properties / Request parameters Each set function corresponds to a request parameter of the same name.
protected  String userInput
           
protected  int userInputDelay
           
protected  String userInputPartition
           
protected  int userInputPosition
           
protected  String userInputSyntax
           
protected  String[] userRequests
           
protected  String vmFileName
           
 
Fields inherited from class org.activemath.webapp.base.ControllerBase
appContext, defaultContentType, JSON, REDIRECT, REDIRECT_LOGIN, request, response, stopwatch
 
Fields inherited from class org.infohazard.maverick.ctl.Throwaway2
ERROR, SUCCESS
 
Constructor Summary
ExerciseController()
           
 
Method Summary
protected  String action()
          Implements the controller's action
protected static void checkRedirect(User user, String exerciseId, AppModel model, InteractionManager exerciseInteractionManager)
          Check whether there is a pending redirect, and if so enable it.
protected  void destroyExercise(User user)
           
protected  String getBookId()
           
 String getPresentationStrategy()
           
 String getVmFileName()
           
protected  org.activemath.webapp.exercises.ExerciseStateContainer initExercise(User user, AppModel model)
           
 void setAssessment(String value)
           
 void setBook(String bookId)
          This variant is here to match the parameter name used by the ViewBook controller.
 void setBookId(String bookId)
           
 void setConfidence(String confidence)
           
 void setExerciseId(String exerciseId)
           
protected  void setInteractionManager(InteractionManager manager)
           
 void setPresentationStrategy(String presentationStrategy)
           
 void setStrategy(String strategy)
           
 void setType(String type)
           
 void setUserInput(String userInput)
           
 void setUserInputDelay(int value)
           
protected  void setUserInputHistory(Vector<InteractionManager.UserInputHistoryEntry> history)
           
 void setUserInputPartition(String userInputPartition)
           
 void setUserInputPosition(int userInputPosition)
           
 void setUserInputSyntax(String userInputSyntax)
           
 void setVmFileName(String vmFileName)
           
 
Methods inherited from class org.activemath.webapp.base.ControllerBase
addError, addError, enableNoCache, escapeForHtmlSafety, getAccountManager, getAppSession, getCmdName, getCurrentUser, getErrors, getHttpSession, getLanguage, getModel, getOutputFormat, getRequest, getResponse, getSkin, hasErrors, perform, publishControllerEvent, sendError, sendError, sendJson, sendLoginRequired, sendRedirect, sendRedirect, setPasswd, setUser
 
Methods inherited from class org.infohazard.maverick.ctl.ThrowawayBean2
go
 
Methods inherited from class org.infohazard.maverick.ctl.Throwaway2
getCtx, go
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

protected static Logger log
The logger for this class


EXERCISE_CONTAINER

public static final String EXERCISE_CONTAINER
key for exercise container attached to user

See Also:
Constant Field Values

_userInputHistory

protected Vector<InteractionManager.UserInputHistoryEntry> _userInputHistory

_teacherAssistant

protected InteractionManager _teacherAssistant

exerciseSheetItems

protected Vector<ExerciseController.ExerciseSheetItem> exerciseSheetItems

type

protected String type
Bean properties / Request parameters Each set function corresponds to a request parameter of the same name. When action() is called, properties are already filled in.


exerciseId

protected String exerciseId

bookId

protected String bookId

userInput

protected String userInput

userInputPartition

protected String userInputPartition

userInputPosition

protected int userInputPosition

config

protected Configuration config

defaultInputSyntax

protected String defaultInputSyntax

userRequests

protected String[] userRequests

userInputSyntax

protected String userInputSyntax

userInputDelay

protected int userInputDelay

displayUserInputSyntaxOptions

protected boolean displayUserInputSyntaxOptions

displayOutputFormatOptions

protected boolean displayOutputFormatOptions

showFinishButton

protected boolean showFinishButton

speechContent

protected String speechContent

strategy

protected String strategy

presentationStrategy

protected String presentationStrategy

vmFileName

protected String vmFileName

isAssessment

protected boolean isAssessment

confidence

protected String confidence

confidenceEnabled

protected boolean confidenceEnabled

logExerciseResult

protected boolean logExerciseResult
Constructor Detail

ExerciseController

public ExerciseController()
Method Detail

setConfidence

public void setConfidence(String confidence)

setType

public void setType(String type)

setBook

public void setBook(String bookId)
This variant is here to match the parameter name used by the ViewBook controller.

Parameters:
bookId - book identifier @see org.activemath.contoller.ViewBook#setBook(String)

setBookId

public void setBookId(String bookId)

getBookId

protected String getBookId()

setExerciseId

public void setExerciseId(String exerciseId)

setStrategy

public void setStrategy(String strategy)

setPresentationStrategy

public void setPresentationStrategy(String presentationStrategy)

getPresentationStrategy

public String getPresentationStrategy()

setVmFileName

public void setVmFileName(String vmFileName)

getVmFileName

public String getVmFileName()

setUserInput

public void setUserInput(String userInput)

setUserInputPosition

public void setUserInputPosition(int userInputPosition)

setUserInputDelay

public void setUserInputDelay(int value)

setUserInputSyntax

public void setUserInputSyntax(String userInputSyntax)

setUserInputPartition

public void setUserInputPartition(String userInputPartition)

setAssessment

public void setAssessment(String value)

action

protected String action()
                 throws Exception
Implements the controller's action

Overrides:
action in class ControllerBase
Throws:
Exception
See Also:
ControllerBase.action()

initExercise

protected org.activemath.webapp.exercises.ExerciseStateContainer initExercise(User user,
                                                                              AppModel model)
                                                                       throws IOException
Throws:
IOException

setInteractionManager

protected void setInteractionManager(InteractionManager manager)

setUserInputHistory

protected void setUserInputHistory(Vector<InteractionManager.UserInputHistoryEntry> history)

destroyExercise

protected void destroyExercise(User user)

checkRedirect

protected static void checkRedirect(User user,
                                    String exerciseId,
                                    AppModel model,
                                    InteractionManager exerciseInteractionManager)
Check whether there is a pending redirect, and if so enable it.

Parameters:
user - user object, for access to user model.
exerciseId - identifier of the current exercise.
model - controller model.
exerciseInteractionManager - interaction manager running the exercise. This will be removed once the score computation gets moved to the user model, or some other component.