org.activemath.studentmodel2.data
Class EvidenceCollector

java.lang.Object
  extended by org.activemath.studentmodel2.data.EvidenceCollector

public class EvidenceCollector
extends Object

This class keeps a record of all evidences for a user. It also stores references to EvidenceContainers for every competency of any concept.


Field Summary
protected static Logger log
          Access to logging facility
 String version
          for XStream
 
Constructor Summary
EvidenceCollector()
          Default constructor(empty)
 
Method Summary
 void addIndirectEvidence(Evidence ev, String conceptId, int depth)
          Add an ExerciseResult to the evidences
 List<Evidence> addResult(ExerciseResult exResult, String conceptId)
          Add an ExerciseResult to the evidences
 void addResult(ExerciseResult exResult, String conceptId, CognitiveProcess cognitiveProcess)
          Add an ExerciseResult to the evidences
 List<Evidence> addResult(ExerciseResult exResult, String conceptId, Collection<CognitiveProcess> cognitiveProcesses)
          Add an ExerciseResult to the evidences
 void discardIndirectEvidence(String userId, String conceptId, CognitiveProcess cognitiveProcess)
          Discard indirect evidence - not needed anymore for enough direct evidence is available
 Collection<Evidence> getAllEvidences(String userId, String conceptId, CognitiveProcess cognitiveProcess)
          Get all direct and indirect evidences for a competency and concept.
 Collection<Evidence> getDirectEvidences(String userId, String conceptId, CognitiveProcess cognitiveProcess)
          Get direct evidences for a competency and concept.
 Collection<Evidence> getDirectEvidences(String userId, String conceptId, CognitiveProcess cognitiveProcess, boolean updateCognitiveProcesses)
          Get direct evidences for a competency and concept.
protected  String getEvidenceContainerKey(String userId, String conceptId, CognitiveProcess cognitiveProcess)
          Creates a key to access a particular EvidenceContainer
 HashMap<String,EvidenceContainer> getEvidenceContainers()
           
 Collection<Evidence> getIndirectEvidences(String userId, String conceptId, CognitiveProcess cognitiveProcess)
          Get indirect evidences for a competency and concept.
 Collection<Evidence> getRemainingIndirectEvidences(String userId, String conceptId, CognitiveProcess cognitiveProcess, int directEvidenceCnt)
           
 boolean hasEvidence(ExerciseResult r, String conceptId, CognitiveProcess cognitiveProcess)
          Checks whether a specific exercise result has already been added for a given concept/competency
 boolean hasIndirectEvidence(ExerciseResult r, String conceptId, CognitiveProcess cognitiveProcess)
          Checks if a specific exercise result has already been added as indirect evidence for a given concept/competency
 void setEvidenceContainers(HashMap<String,EvidenceContainer> evidenceContainers)
           
 
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
Access to logging facility


version

public String version
for XStream

Constructor Detail

EvidenceCollector

public EvidenceCollector()
Default constructor(empty)

Method Detail

getEvidenceContainers

public HashMap<String,EvidenceContainer> getEvidenceContainers()
Returns:
the evidenceContainers

setEvidenceContainers

public void setEvidenceContainers(HashMap<String,EvidenceContainer> evidenceContainers)
Parameters:
evidenceContainers - the evidenceContainers to set

addResult

public List<Evidence> addResult(ExerciseResult exResult,
                                String conceptId,
                                Collection<CognitiveProcess> cognitiveProcesses)
Add an ExerciseResult to the evidences

Parameters:
exResult - - the result of the exercise
conceptId - - the mbaseId of the concept this result is for
cognitiveProcesses - - A set of cognitive processes for which the evidences are to be added

addResult

public void addResult(ExerciseResult exResult,
                      String conceptId,
                      CognitiveProcess cognitiveProcess)
Add an ExerciseResult to the evidences

Parameters:
exResult - - the result of the exercise
conceptId - - the mbaseId of the concept this result is for
cogProcessId - - the cognitive process of the competency to be updated

addResult

public List<Evidence> addResult(ExerciseResult exResult,
                                String conceptId)
Add an ExerciseResult to the evidences

Parameters:
exResult - - the result of the exercise
conceptId - - the mbaseId of the concept this result is for

getAllEvidences

public Collection<Evidence> getAllEvidences(String userId,
                                            String conceptId,
                                            CognitiveProcess cognitiveProcess)
Get all direct and indirect evidences for a competency and concept.

Parameters:
conceptId - - the mbaseId of the concept
cognitiveProcess - - a cognitive process
userId - - the user to get the evidences for
Returns:
A list of Evidences

getRemainingIndirectEvidences

public Collection<Evidence> getRemainingIndirectEvidences(String userId,
                                                          String conceptId,
                                                          CognitiveProcess cognitiveProcess,
                                                          int directEvidenceCnt)

getEvidenceContainerKey

protected String getEvidenceContainerKey(String userId,
                                         String conceptId,
                                         CognitiveProcess cognitiveProcess)
Creates a key to access a particular EvidenceContainer

Parameters:
userId - - Id of the user
conceptId - - Id of a concept
cognitiveProcess - - a cognitive process
Returns:
The key under which the requested EvidenceContainer is stored

getIndirectEvidences

public Collection<Evidence> getIndirectEvidences(String userId,
                                                 String conceptId,
                                                 CognitiveProcess cognitiveProcess)
Get indirect evidences for a competency and concept.

Parameters:
conceptId - - the mbaseId of the concept
cognitiveProcess - - the cognitive process
userId - - the user to get the evidences for
Returns:
A list of Evidences

getDirectEvidences

public Collection<Evidence> getDirectEvidences(String userId,
                                               String conceptId,
                                               CognitiveProcess cognitiveProcess)
Get direct evidences for a competency and concept.

Parameters:
conceptId - - the mbaseId of the concept
cognitiveProcess - - the competency
userId - - the user to get the evidences for
Returns:
A list of Evidences

getDirectEvidences

public Collection<Evidence> getDirectEvidences(String userId,
                                               String conceptId,
                                               CognitiveProcess cognitiveProcess,
                                               boolean updateCognitiveProcesses)
Get direct evidences for a competency and concept.

Parameters:
conceptId - - the mbaseId of the concept
cognitiveProcess - - the competency
userId - - the user to get the evidences for
updateCognitiveProcesses - If true, then the cognitive processes of the returned evidences are checked and eventually corrected
Returns:
A list of Evidences

hasEvidence

public boolean hasEvidence(ExerciseResult r,
                           String conceptId,
                           CognitiveProcess cognitiveProcess)
Checks whether a specific exercise result has already been added for a given concept/competency

Parameters:
r - - the exercise result to check (it contains the eventId)
conceptId - - the concept to check
cognitiveProcess - - the competency to check
Returns:
- true if result has already been added, false otherwise

hasIndirectEvidence

public boolean hasIndirectEvidence(ExerciseResult r,
                                   String conceptId,
                                   CognitiveProcess cognitiveProcess)
Checks if a specific exercise result has already been added as indirect evidence for a given concept/competency

Parameters:
r - - the exercise result to check (it contains the eventId)
conceptId - - the concept to check
cognitiveProcess - - the competency to check
Returns:
- true if result has already been added, false otherwise

addIndirectEvidence

public void addIndirectEvidence(Evidence ev,
                                String conceptId,
                                int depth)
Add an ExerciseResult to the evidences

Parameters:
ev - - a reference to a direct evidence
conceptId - - the concept ev is an evidence for
depth - - the distance of the propagation (0, direct; <0 down propagation; >0 up propagation)

discardIndirectEvidence

public void discardIndirectEvidence(String userId,
                                    String conceptId,
                                    CognitiveProcess cognitiveProcess)
Discard indirect evidence - not needed anymore for enough direct evidence is available

Parameters:
userId - - the userId
conceptId - - conceptId
cognitiveProcess - - cognitive process