org.activemath.learner.model
Class SlmAdapter

java.lang.Object
  extended by org.activemath.learner.model.SlmAdapter
All Implemented Interfaces:
LearnerModelInterface

public class SlmAdapter
extends Object
implements LearnerModelInterface

This class wraps a LearnerModel to support the methods required by the LearnerModelInterface.


Field Summary
protected static Logger log
           
 
Fields inherited from interface org.activemath.learner.model.LearnerModelInterface
MASTERY_MAX, MASTERY_MIN, MASTERY_UNKNOWN
 
Constructor Summary
SlmAdapter()
           
 
Method Summary
 boolean createModel(String userId)
           
 boolean destroyModel(String userId)
           
 boolean existsModel(String userId)
           
 CompetencyLevel getCompetencyLevel(String userId, String contentId)
          Must return the competency level of the given user on the specified content item.
 CompetencyLevel getCompetencyLevel(String userId, String contentId, Competency competency)
          Must return the competency level of the given user on the given content item, with respect to the specified Competency.
 CompetencyLevel getCompetencyLevelByCompetencySystem(String userId, String contentId, String competency, String competencySystemId)
          Same as getCompetencyLevel(String userId, String contentId), just that a specific competency system can be supplied relative to which the competency level is returned
 int getKnowledgeValue(String userId, String contentId)
          Must return a value in [0..100] (0=worst, 100=best) describing the given user's knowledge about the specified content.
 int getKnowledgeValue(String userId, String contentId, Competency competency)
           
 int getKnowledgeValueByCompetencySystem(String userId, String contentId, String competencyId, String competencySystemId)
          Same as getKnowledgeValue(String userId, String contentId), just that a specific competency system can be supplied relative and a competency to which the knowledge value is returned.
 int[] getKnowledgeValues(String userId, List listOfContentIds)
          Must return an array of values in [0..100] as described in LearnerModelInterface.getKnowledgeValue(String, String), where returnedArray[i] = getKnowledgeValue(userId, listOfContentIds.get(i).
 String getName()
          Return name of the learner model.
 
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
Constructor Detail

SlmAdapter

public SlmAdapter()
Method Detail

getName

public String getName()
Description copied from interface: LearnerModelInterface
Return name of the learner model. This value can be used to create the model at the LearnerModelProvider.

Specified by:
getName in interface LearnerModelInterface
Returns:
The name of this learner model.

createModel

public boolean createModel(String userId)
Specified by:
createModel in interface LearnerModelInterface

destroyModel

public boolean destroyModel(String userId)
Specified by:
destroyModel in interface LearnerModelInterface

existsModel

public boolean existsModel(String userId)
Specified by:
existsModel in interface LearnerModelInterface

getCompetencyLevel

public final CompetencyLevel getCompetencyLevel(String userId,
                                                String contentId)
Description copied from interface: LearnerModelInterface
Must return the competency level of the given user on the specified content item.

Specified by:
getCompetencyLevel in interface LearnerModelInterface
Parameters:
userId - The user to get the competency level of
contentId - The id of the content item to get the competency level of
Returns:
The competency level of the given user on the given content item

getCompetencyLevel

public final CompetencyLevel getCompetencyLevel(String userId,
                                                String contentId,
                                                Competency competency)
Description copied from interface: LearnerModelInterface
Must return the competency level of the given user on the given content item, with respect to the specified Competency.

Specified by:
getCompetencyLevel in interface LearnerModelInterface
Parameters:
userId - The id of the user to get the competency level of
contentId - The if of the piece of content to get the competency level of
competency - The target competency
Returns:
The user's competency level on the given content item wrt. to the specified comepetency.

getKnowledgeValue

public final int getKnowledgeValue(String userId,
                                   String contentId)
Description copied from interface: LearnerModelInterface
Must return a value in [0..100] (0=worst, 100=best) describing the given user's knowledge about the specified content.
Must return (-1) if the user's knowledge about the specified content is undefined.

Specified by:
getKnowledgeValue in interface LearnerModelInterface
Parameters:
userId - The id of the user to get the knowledge value of
contentId - The id of the piece of content to get the knowledge value of.
Returns:
A value in [0..100] describing the user's knowledge about the specified content, or (-1) if it was undefined.

getKnowledgeValue

public final int getKnowledgeValue(String userId,
                                   String contentId,
                                   Competency competency)

getKnowledgeValues

public final int[] getKnowledgeValues(String userId,
                                      List listOfContentIds)
Description copied from interface: LearnerModelInterface
Must return an array of values in [0..100] as described in LearnerModelInterface.getKnowledgeValue(String, String), where returnedArray[i] = getKnowledgeValue(userId, listOfContentIds.get(i).

Specified by:
getKnowledgeValues in interface LearnerModelInterface
Parameters:
userId - The id of the user to get the knowledge values of
listOfContentIds - a List containing the ids of the pieces of content to get the knowledge value of
Returns:
An array containing the desired knowledge values

getCompetencyLevelByCompetencySystem

public CompetencyLevel getCompetencyLevelByCompetencySystem(String userId,
                                                            String contentId,
                                                            String competency,
                                                            String competencySystemId)
Description copied from interface: LearnerModelInterface
Same as getCompetencyLevel(String userId, String contentId), just that a specific competency system can be supplied relative to which the competency level is returned

Specified by:
getCompetencyLevelByCompetencySystem in interface LearnerModelInterface
Parameters:
userId - The id of the user to get the competency level of
contentId - The if of the piece of content to get the competency level of
competencySystemId - - the Id of the competency system for which the knowledge values (KV) shall be returned, e.g. return the KVs for "apply" and "model" competencies of the PISA system - competencySystemId would hold "PISA".
Returns:
The user's competency level on the given content item wrt. to the specified comepetency.

getKnowledgeValueByCompetencySystem

public final int getKnowledgeValueByCompetencySystem(String userId,
                                                     String contentId,
                                                     String competencyId,
                                                     String competencySystemId)
Description copied from interface: LearnerModelInterface
Same as getKnowledgeValue(String userId, String contentId), just that a specific competency system can be supplied relative and a competency to which the knowledge value is returned.

Specified by:
getKnowledgeValueByCompetencySystem in interface LearnerModelInterface
Parameters:
userId - The id of the user to get the knowledge value of
contentId - The id of the piece of content to get the knowledge value of.
competencyId - The target competency
competencySystemId - - the Id of the competency system for which the knowledge values (KV) shall be returned, e.g. return the KVs for "apply" and "model" competencies of the PISA system - competencySystemId would hold "PISA".
Returns:
A value in [0..100] describing the user's knowledge about the specified content, or (-1) if it was undefined.