org.activemath.tutor.coursegen.learnerModel
Class TempLearnerModel

java.lang.Object
  extended by org.activemath.webapp.user.UserGroup
      extended by org.activemath.tutor.coursegen.learnerModel.AbstractLearnerModel
          extended by org.activemath.tutor.coursegen.learnerModel.TempLearnerModel
All Implemented Interfaces:
Comparable

public class TempLearnerModel
extends AbstractLearnerModel

This class implementes a simple learnermodel that simulates a temporary learnermodel for storing the information of learner. Its information is only useful for queries from the course generator. This class can be used for systems that do not have a learnermodel but still want to use the course generator.


Field Summary
static String JOINT_CONNECTOR
           
protected static Category log
           
 
Fields inherited from class org.activemath.webapp.user.UserGroup
allowedBookIds, allowedGroupingIds, allowedSurveys, availableTests, controlGroup, exerciseStrategy, exerciseStrategyDefault, field, hidden, id, learnerModel, name, parent, parentId, skin, testCompulsoryMap, testTimeouts, tutorIds
 
Method Summary
 String addLearner(Map learnerKnowledge)
          Add information about a learner to this learnermodel.
 CompetencyLevel getCompetencyLevel(String userId, String contentId)
          Currently returns CompetencyLevel.SIMPLE_CONCEPTUAL as default.
 CompetencyLevel getCompetencyLevel(String userId, String contentId, Competency competency)
          Currently returns CompetencyLevel.SIMPLE_CONCEPTUAL as default.
 String getField(String learnerId)
          Currently returns a default domain of the learner.
static TempLearnerModel getInstance()
           
 int getKnowledgeValue(String userId, String contentId)
          Calls the methode getMastery(userId, contentId)
 int[] getKnowledgeValues(String userId, List listOfContentIds)
          Get all the knowledge values of the given list of identiers.
 String getLearningContextAsString(String learnerId)
          Returns the learning context of the learner.
 int getMastery(String learnerId, String contentId)
          Returns the mastery of the learner regarding the given content.
 String getName()
           
 boolean hasAlreadySeen(String learnerId, String contentId)
          Returns whether the learner has already seen the given content.
 boolean isValidKnowledgeMap(Map knowledgeMap)
          Verify the given Map.
 double queryLearnerPropertyBoolean(String learnerId, String property, String arg1)
          Get the value of the given learner property (e.g. has-already-seen).
 List queryLearnerPropertyList(String learnerId, String property, String arg1)
          Get the value of the given learner property (e.g. allowed educational levels).
 double queryLearnerPropertyNumber(String learnerId, String property, String arg1)
          Get the value of the given learner property (e.g. competency level, mastery).
 String queryLearnerPropertyString(String learnerId, String property, String arg1)
          Get the value of the given learner property (e.g. educational level and field).
protected  Map removeLearner(String learnerId)
          Removes the knowledge Map of a learner.
 
Methods inherited from class org.activemath.webapp.user.UserGroup
addTutor, buildAllowedBookIds, buildAllowedGroupingIds, compareTo, filterBooks, filterGroupings, getAllowedBookIds, getAllowedGroupingIds, getAllowedGroupings, getAllowedRecBooks, getAllowedSurveyNames, getAllowedSurveys, getAvailableTests, getAvailableTestsIds, getCompulsoryTests, getExerciseStrategy, getField, getGroupSpecificAndInheritedGroupingIds, getGroupSpecificAndInheritedRecBookIds, getGroupSpecificAndInheritedSurveys, getGroupSpecificGroupingIds, getGroupSpecificRecBookIds, getGroupSpecificSurveys, getId, getInheritedGroupingIds, getInheritedRecBookIds, getInheritedSurveys, getLearnerModel, getParent, getParentId, getParentIds, getProperty, getRecBooks, getSkin, getTargetCompetencies, getTestCompulsoryMap, getTestTimeout, getTestTimeouts, getTutors, getTutorsCSV, getUserIds, isActive, isAllowedGrouping, isAllowedSurvey, isAllowedTutor, isCompulsoryTest, isControlGroup, isDefaultGroup, isHidden, removeTutor, setAllowedBookIds, setAllowedGroupingIds, setAllowedSurveys, setControlGroup, setExerciseStrategy, setField, setHidden, setId, setIsCompulsoryTest, setLearnerModel, setName, setParentId, setSkin, setTestCompulsoryMap, setTestTimeout, setTestTimeouts, setTutors, setTutorsCSV, splitString, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

log

protected static Category log

JOINT_CONNECTOR

public static final String JOINT_CONNECTOR
See Also:
Constant Field Values
Method Detail

getInstance

public static TempLearnerModel getInstance()

addLearner

public String addLearner(Map learnerKnowledge)
Add information about a learner to this learnermodel. His "knowledge" is provided as a Map. The learner information is used once for course generation, afterwards it is deleted.

Parameters:
learnerKnowledge -
Returns:
the learnerId unique in this learnerModel
Throws:
WrongLearnerKnowledgeMapException

removeLearner

protected Map removeLearner(String learnerId)
Removes the knowledge Map of a learner.

Parameters:
learnerId -
Returns:
the knowledge Map of the Learner or null, if the given Id can't be found in our learner Storage.

queryLearnerPropertyString

public String queryLearnerPropertyString(String learnerId,
                                         String property,
                                         String arg1)
Description copied from class: AbstractLearnerModel
Get the value of the given learner property (e.g. educational level and field).

Specified by:
queryLearnerPropertyString in class AbstractLearnerModel
arg1 - (this argument is some extension that can attribute a specific purpose of query, like the contentId)
Returns:
the learner property as String

queryLearnerPropertyList

public List queryLearnerPropertyList(String learnerId,
                                     String property,
                                     String arg1)
Description copied from class: AbstractLearnerModel
Get the value of the given learner property (e.g. allowed educational levels).

Specified by:
queryLearnerPropertyList in class AbstractLearnerModel
arg1 - (this argument is some extension that can attribute a specific purpose of query, like the contentId)
Returns:
the learner property as a List

queryLearnerPropertyNumber

public double queryLearnerPropertyNumber(String learnerId,
                                         String property,
                                         String arg1)
Description copied from class: AbstractLearnerModel
Get the value of the given learner property (e.g. competency level, mastery).

Specified by:
queryLearnerPropertyNumber in class AbstractLearnerModel
Returns:
the learner property as a double value

queryLearnerPropertyBoolean

public double queryLearnerPropertyBoolean(String learnerId,
                                          String property,
                                          String arg1)
Description copied from class: AbstractLearnerModel
Get the value of the given learner property (e.g. has-already-seen).

Specified by:
queryLearnerPropertyBoolean in class AbstractLearnerModel
Returns:
the learner property as boolean

getLearningContextAsString

public String getLearningContextAsString(String learnerId)
Returns the learning context of the learner. The learning context should be specified like ("hasEducationalLevel" , "university_first_cycle"). If no value was specified, then a default value is returned.

Parameters:
learnerId -
Returns:
learning context of the learner

getField

public String getField(String learnerId)
Currently returns a default domain of the learner.

Parameters:
learnerId -
Returns:
"computer_science"

getMastery

public int getMastery(String learnerId,
                      String contentId)
Returns the mastery of the learner regarding the given content. If no value was specified, then a default value of 1 (the lowest value) is returned.

Parameters:
learnerId -
Returns:
a value between 1..4

hasAlreadySeen

public boolean hasAlreadySeen(String learnerId,
                              String contentId)
Returns whether the learner has already seen the given content. If no value is given in the map, then the default value (false) is returned. In the learner knowledge map, the "has already seen" of one content should be specified with ("contentId_hasAlreadySeen" , "anyValue"), where the contentId is identifier for different content.

Parameters:
learnerId -
contentId -
Returns:
the boolean value in the learnerKnowledge Map (or false, if not specified).

isValidKnowledgeMap

public boolean isValidKnowledgeMap(Map knowledgeMap)
Verify the given Map. Currently there's nothing to validate.

Parameters:
knowledgeMap -
Returns:
true if the Map is valid. Otherwise false.

getCompetencyLevel

public CompetencyLevel getCompetencyLevel(String userId,
                                          String contentId,
                                          Competency competency)
Currently returns CompetencyLevel.SIMPLE_CONCEPTUAL as default.


getCompetencyLevel

public CompetencyLevel getCompetencyLevel(String userId,
                                          String contentId)
Currently returns CompetencyLevel.SIMPLE_CONCEPTUAL as default.


getKnowledgeValue

public int getKnowledgeValue(String userId,
                             String contentId)
Calls the methode getMastery(userId, contentId)


getKnowledgeValues

public int[] getKnowledgeValues(String userId,
                                List listOfContentIds)
Get all the knowledge values of the given list of identiers.


getName

public String getName()
Overrides:
getName in class UserGroup