예제 #1
0
        public TestItemScoreInfo(int itemBank, long itemName, string dimension, IRTModelFactory.Model irtType, string recodeRule, int parameterCount, double weight, int scorePoint)
        {
            this.bank = itemBank;
            this.itemName = itemName;
            this.dimension = dimension;
            this.measurementModel = irtType;
            if (irtType != IRTModelFactory.Model.Unknown)
            {
    			this.irtModel = IRTModelFactory.CreateModel(irtType);
	    		this.irtModel.SetParameterCount(parameterCount, scorePoint);
            }
            this.recodeRuleName = recodeRule;
            this.weight = weight;
			this.scorePoints = scorePoint;
            if (recodeRule.StartsWith("GRR("))
            {
                string[] recodes = recodeRuleName.Substring(4, recodeRuleName.Length - 5).Split('-');
                foreach (string recode in recodes)
                {
                    if (recode.Length != 1)
                        throw new ScoringEngineException("Recodes must be one digit integers: Item " + bank + "-" + itemName + ", recodeRule " + recodeRuleName);
                    if (!Char.IsDigit(recode[0]))
                        throw new ScoringEngineException("Recodes must be integers: Item " + bank + "-" + itemName + ", recodeRule " + recodeRuleName);
                    if (Convert.ToInt32(recode) > scorePoint)
                        throw new ScoringEngineException("Recodes must be less than or equal to dimension score points: Item " + bank + "-" + itemName + ", recodeRule " + recodeRuleName);
                }
            }
        }
예제 #2
0
 public void SetDimension(string dimension, IRTModelFactory.Model model, string recodeRule, double weight, int points, int parameteCount)
 {
     if (recodeRule.StartsWith("GRR(") && recodeRule.Substring(recodeRule.Length - 2, 1) != points.ToString())
     {
         throw new ScoringEngineException("recodeRule " + recodeRule + " for item " + ItemName + " does not seem to provide a recode for each of its possible scores (scorePoint = " + points + ")");
     }
     scoreInfo.Add(new TestItemScoreInfo(this.itemBank, this.itemID, dimension, model, recodeRule, parameteCount, weight, points));
 }
예제 #3
0
        public void SetFeature(string dimension, IRTModelFactory.Model model, string featureName, string featureValue)
        {
            TestItemScoreInfo score = FindScoreInfo(dimension, model);

            if (score == null)
            {
                throw new Exception("Item " + this.ItemName + " does not have dimension " + dimension + " and IRT model " + model.ToString());
            }
            score.SetFeature(featureName, featureValue);
        }
예제 #4
0
 private TestItemScoreInfo FindScoreInfo(string dimension, IRTModelFactory.Model irtType)
 {
     foreach (TestItemScoreInfo score in this.scoreInfo)
     {
         if (score.Dimension == dimension && score.MeasurementModel == irtType)
         {
             return(score);
         }
     }
     return(null);
 }
예제 #5
0
 public IRTModel(IRTModelFactory.Model model)
 {
     _measurementModel = model;
 }
예제 #6
0
 public IRTModel()
 {
     _measurementModel = IRTModelFactory.Model.Unknown;
 }