Learner Model

From ActiveMathWiki

Implement a Learner Model

  • Implement the following Interface
  org.activemath.webapp.user.learner.LearnerModelInterface

In org.activemath.webapp.user.learner.LearnerModelProvider set

  • a constant for your learner model name
 public static final String NOP_LM = "nop";
  • To add your learner model name to the provider service add the following Line in the constructor.
 supportedModels.add(NOP_LM);

Modify ActiveMath-Individual.properties as follows:

  app.learnermodel=nop
  learnermodel.nop.class=org.activemath.webapp.user.learner.NoOpLM


Example Noop Learner Model

  public class NoOpLM implements LearnerModelInterface {
   public NoOpLM() {}
   /**
    * @return -1
    */
   public int getKnowledgeValue(String userId, String contentId) {
       return -1;
   }
   /**
    * @return an array of -1
    */
   public int[] getKnowledgeValues(String userId, List listOfContentIds) {
       int[] r = new int[listOfContentIds.size()];
       for(int i=0,l=r.length; i<l; i++) {
           r[i] = -1;
       }
       return r;
   }
   /**
    * @return null always
    */
   public CompetencyLevel getCompetencyLevel(String userId, String contentId) {
       return null;
   }
   /**
    * @return null always
    */
   public CompetencyLevel getCompetencyLevel(String userId, String contentId, Competency competency) {
       return null;
   }
   /**
    * @return 0 always
    */
   public int getAffectValue(String userId, Affect affect, String contentId) {
       return 0;
   }
   /**
    * @return 0 always
    */
   public int getMetacognitionValue(String userId, Metacognition metacognition, String contentId) {
       return 0;
   }
   /**
    * @return 0 always
    */
   public int getMotivationValue(String userId, Motivation motivation, String contentId) {
       return 0;
   }
  }