org.activemath.abstractcontent
Interface AbstractUserModel

All Superinterfaces:
AbstractStudentModel
All Known Implementing Classes:
UserModelAdapter

public interface AbstractUserModel
extends AbstractStudentModel

Mostly everything you read below is deprecated. See AbstractStudentModel This interface is to be implemented by anything that claims to be a student model for ActiveMath.
However, be aware that the interface in fact represents more than just a bare student model. The methods notifying the student model of actions the student performed have to evaluate these actions first. The output of these evaluating processes can then be fed to then student model itself. Methods that have to pass through the evaluation process are:

Furthermore, the whole nextBest suggestion mechanism is also hidden behind this interface. Our classes implementing this interface dispatch all the requests to three principal classes:

Description of the three parts of an AbstractUserModel:

The bare student model: should contain the general preferences of the user like language, name or field. It should also contain some model of the student's knowledge (maybe multi-dimensional, see for instance Blooms Taxonomy), and the student's history (which we store in a RDBS).
The evaluators: They have to get something meaningful out of the requests mentioned above, and should be separated according to the kind of event they evaluate. We have reading, exercise and navigation evaluators.
The suggestion mechanism: Should be informed of what the student did by the evaluators, and then generate some suggestions if needed.
In the method description, we write SM if the request is delegated to the student model, EV if the request is delegated to the evaluators, and NB if it's dispatched to the NextBest mechanism.


Method Summary
 void addBook(String user, org.jdom.Document book)
          Attaches a Document representing a user-generated book to the given user.
 int addToHistory(String string, String[] itemIds, String page, String type, long start, int duration, double success, String session)
          Temporary method needed for the connection to the history in the userModel server.
 boolean alreadySeen(String userId, String con)
          tells wether the user has already seen the given item.
 void createNewUser(Hashtable hashtable)
          creates a new user from the given Hashtable.
 boolean doesUserExist(String user)
          checks if there is a student model for the student with login name user.
 Map getBooks(String user)
          Fetches a Map of all books attached to the given user
 Vector getConceptsKnown(String user)
          gets a Vector containing the MBase IDs of all Items the user has a mastery assessment for.
 Hashtable getJustificatingSteps(String user, String concept)
          gets a Hashtable containing the history elements responsible for the mastery assessment of the given concept, keyed by their id.
 Hashtable getKnowledge(String userID, String mBaseID)
          fetches a Hashtable from the studentmodel containing the students mastery values for the supplied concept.
 Date getLastTimeSeen(String userID, String mBaseID)
          gets the Date of the last time the given Item has been seen by the student.
 double getMastery(String userID, String mBaseID)
          gets the student's mastery value for the given item.
 Hashtable getMultipleKnowledge(String userID, Vector mBaseIDs)
          gets a Hashtable containing the supplied mBaseIds as keys, and the corresponding mastery Hashtable as Value as returned by getKnowledge(java.lang.String, java.lang.String).
 Hashtable getProperties(String userId)
          gets the Hashtable containing all the properties stored in the um for the user with login userId.
 String getProperty(String userId, String propertyName)
          gets the value of the requested property for the supplied user as a String.
 List getUserList()
          returns the list of all existing user ids
 void incrementTimesSeen(String userId, String itemId)
          Increments the number of Times an element has been seen
 void logout(String user)
          logs the student with login name user out, that means save her student model to the hard disk and remove it from ram.
 void removeBook(String user, String bookId)
          Removed the given user-generated book from the user.
 boolean removeUser(String userId)
          Deletes the given user from the userModel server
 void setKnowledge(String userID, String mBaseID, Hashtable bloomProps)
          sets user userID's mastery assessment for the given mBaseID to the supplied Hashtable.
 void setProperty(String userId, String propertyName, String value)
          sets the property for the user userId to the supplied key-value pair.
 void update(String userId, String itemId, Map newAssessment, String historyId)
          Temporary: Connectivity for the UM-internal update method.
 

Method Detail

getUserList

List getUserList()
Description copied from interface: AbstractStudentModel
returns the list of all existing user ids

Specified by:
getUserList in interface AbstractStudentModel
Returns:
the list of all existing user ids

getProperties

Hashtable getProperties(String userId)
gets the Hashtable containing all the properties stored in the um for the user with login userId. (SM)

Specified by:
getProperties in interface AbstractStudentModel
Parameters:
userId - the login id of the user whose properties to fetch.
Returns:
the Hashtable containing all the user's properties.
See Also:
getProperty(String,String), setProperty(String,String,String)

getProperty

String getProperty(String userId,
                   String propertyName)
gets the value of the requested property for the supplied user as a String. (SM)

Specified by:
getProperty in interface AbstractStudentModel
Parameters:
userId - the login name of the user to get the property for
propertyName - the name of the property to get the value of
Returns:
the value of the given property as a String
See Also:
getProperties(String), setProperty(String, String, String)

setProperty

void setProperty(String userId,
                 String propertyName,
                 String value)
sets the property for the user userId to the supplied key-value pair. (SM)

Specified by:
setProperty in interface AbstractStudentModel
Parameters:
userId - the login of the user to set the property for
propertyName - the name of the property to set
value - the value to assign to the property
See Also:
getProperty(String,String), getProperties(String)

getKnowledge

Hashtable getKnowledge(String userID,
                       String mBaseID)
fetches a Hashtable from the studentmodel containing the students mastery values for the supplied concept. For information about our implementation, see org.activemath.studentmodel.StudentModelFacade#getKnowledge(String,String).(SM)

Specified by:
getKnowledge in interface AbstractStudentModel
Parameters:
userID - the login of the user to get the mastery assessment for
mBaseID - the MBase ID of the concept to get the mastery assessment for.
Returns:
a Hashtable containing the mastery assessment for the given userID
See Also:
getMultipleKnowledge(String,Vector), setKnowledge(String,String,Hashtable), getMastery(String,String), org.activemath.studentmodel.ModelCentral#getKnowledge(String,String), org.activemath.studentmodel.KnowledgeAtomImpl

getMultipleKnowledge

Hashtable getMultipleKnowledge(String userID,
                               Vector mBaseIDs)
gets a Hashtable containing the supplied mBaseIds as keys, and the corresponding mastery Hashtable as Value as returned by getKnowledge(java.lang.String, java.lang.String).(SM)

Specified by:
getMultipleKnowledge in interface AbstractStudentModel
Parameters:
userID - the login of the user to get the assessments for
mBaseIDs - a Vector containing MBaseIDs to fetch the user's mastery assessment for.
Returns:
a Hashtable containing the mastery assessments for the supplied mBaseIDs (which are strings).
See Also:
getKnowledge(String,String), setKnowledge(String,String,Hashtable), getMastery(String,String), org.activemath.studentmodel.ModelCentral#getMultipleKnowledge(String,Vector), org.activemath.studentmodel.KnowledgeAtomImpl

setKnowledge

void setKnowledge(String userID,
                  String mBaseID,
                  Hashtable bloomProps)
sets user userID's mastery assessment for the given mBaseID to the supplied Hashtable. The Hashtable must have the structure like those returned by getKnowledge(String,String).(SM)

Specified by:
setKnowledge in interface AbstractStudentModel
Parameters:
userID - the login of the user to set the mastery assessment for
mBaseID - the MBase Id of the item to set the mastery assessment for
bloomProps - the Hashtable containing the mastery assessment that is to be set.
See Also:
getKnowledge(String,String), getMultipleKnowledge(String,Vector), getMastery(String,String), org.activemath.studentmodel.ModelCentral#setKnowledge(String,String,Hashtable), org.activemath.studentmodel.KnowledgeAtomImpl

getMastery

double getMastery(String userID,
                  String mBaseID)
gets the student's mastery value for the given item. mastery value means just one double between 0 and 1, representing how good the user masters this concept.(SM)

Specified by:
getMastery in interface AbstractStudentModel
Parameters:
userID - the login name of the user to get the mean value for
mBaseID - the id of the item to get the mastery for.
Returns:
a double representing the student's mastery for the given item.
See Also:
getKnowledge(String,String), getMultipleKnowledge(String,Vector), setKnowledge(String,String,Hashtable), org.activemath.studentmodel.KnowledgeAtomImpl

logout

void logout(String user)
logs the student with login name user out, that means save her student model to the hard disk and remove it from ram.(SM)

Specified by:
logout in interface AbstractStudentModel
Parameters:
user - the login name of the student to log out.

alreadySeen

boolean alreadySeen(String userId,
                    String con)
tells wether the user has already seen the given item.(SM)

Specified by:
alreadySeen in interface AbstractStudentModel
Parameters:
userId - the login name of the student to check
con - the MBase ID of the item to check
Returns:
true if the user has already seen the concept
See Also:
org.activemath.studentmodel.ModelCentral#getTimesSeen(String,String)

getLastTimeSeen

Date getLastTimeSeen(String userID,
                     String mBaseID)
gets the Date of the last time the given Item has been seen by the student.(SM)

Specified by:
getLastTimeSeen in interface AbstractStudentModel
Parameters:
userID - the login name of the student
mBaseID - the MBase ID of the Item.
Returns:
the Date of the last time the item has been seen by the student.
See Also:
alreadySeen(String,String)

createNewUser

void createNewUser(Hashtable hashtable)
                   throws ModelExistsException
creates a new user from the given Hashtable. It has to be in the form specified by the student model component.(SM)

Specified by:
createNewUser in interface AbstractStudentModel
Parameters:
hashtable - the Hashtable containing the information needed to create the model
Throws:
ModelExistsException - if the requested name(contained in the Hashtable) is already in use
See Also:
org.activemath.studentmodel.ModelCentral#createNewUser(Hashtable)

doesUserExist

boolean doesUserExist(String user)
checks if there is a student model for the student with login name user.(SM)

Specified by:
doesUserExist in interface AbstractStudentModel
Parameters:
user - the username to check
Returns:
true if such a student model already exists
See Also:
org.activemath.studentmodel.ModelCentral#doesUserExist

getJustificatingSteps

Hashtable getJustificatingSteps(String user,
                                String concept)
gets a Hashtable containing the history elements responsible for the mastery assessment of the given concept, keyed by their id.(SM)

Specified by:
getJustificatingSteps in interface AbstractStudentModel
Parameters:
user - the login name of the user
concept - the MBase ID of the Item to get the justification for

getConceptsKnown

Vector getConceptsKnown(String user)
gets a Vector containing the MBase IDs of all Items the user has a mastery assessment for.

Specified by:
getConceptsKnown in interface AbstractStudentModel
Parameters:
user - the login of the user
Returns:
the Vector containing the IDs of all the items known to the user
See Also:
org.activemath.studentmodel.ModelCentral#getConceptsKnown(String), getKnowledge(String,String), getMultipleKnowledge(String,Vector), getMastery(String, String), setKnowledge(String,String,Hashtable)

addBook

void addBook(String user,
             org.jdom.Document book)
Attaches a Document representing a user-generated book to the given user.

Specified by:
addBook in interface AbstractStudentModel
Parameters:
user - the user to attach the book to
book - the book as a Document.

removeBook

void removeBook(String user,
                String bookId)
Removed the given user-generated book from the user.

Specified by:
removeBook in interface AbstractStudentModel
Parameters:
user - the user to remove the book from
bookId - the id of the book to remove

getBooks

Map getBooks(String user)
Fetches a Map of all books attached to the given user

Specified by:
getBooks in interface AbstractStudentModel
Parameters:
user - the user id to get the books for.
Returns:
a Map containing the given user's books, keys are the ids, values are the content as String.

update

void update(String userId,
            String itemId,
            Map newAssessment,
            String historyId)
Temporary: Connectivity for the UM-internal update method.

Specified by:
update in interface AbstractStudentModel
Parameters:
userId -
itemId -
newAssessment -
historyId -

addToHistory

int addToHistory(String string,
                 String[] itemIds,
                 String page,
                 String type,
                 long start,
                 int duration,
                 double success,
                 String session)
Temporary method needed for the connection to the history in the userModel server.

Specified by:
addToHistory in interface AbstractStudentModel
Parameters:
string -
itemIds -
page -
type -
start -
duration -
success -

removeUser

boolean removeUser(String userId)
Deletes the given user from the userModel server

Specified by:
removeUser in interface AbstractStudentModel
Parameters:
userId - The id of the user to remove
Returns:
true if the user could be successfully removed

incrementTimesSeen

void incrementTimesSeen(String userId,
                        String itemId)
Increments the number of Times an element has been seen

Specified by:
incrementTimesSeen in interface AbstractStudentModel
Parameters:
userId - the id of the user
itemId - the mbase id of the item.