internal static Assessment Create(MySqlDataReader dr)
        {
            Assessment assess = new Assessment();

            for (int i = 0; i < dr.VisibleFieldCount; i++)
            {
                if (dr.GetValue(i) == DBNull.Value)
                {
                    continue;
                }

                var field = dr.GetName(i);

                switch (field)
                {
                case "AssessmentID":
                    assess.asmt_id = dr.GetInt32(i);
                    break;

                case "ActivityDescription":
                    assess.ActivityDescription = dr.GetString(i);
                    break;

                case "ModifiedDate":
                    assess.ModifiedDate = dr.GetDateTime(i);
                    break;

                case "ActivityType":
                    assess.ActivityType = dr.GetString(i);
                    break;

                case "new_activity_name":
                    assess.ActivityName = dr.GetString(i);
                    break;

                case "AssessmentName":
                    assess.AssessmentName = dr.GetString(i);
                    break;

                case "passing_score":
                    assess.passing_score = dr.GetDecimal(i);
                    break;

                case "RubricName":
                    assess.Rubric.RubricName = dr.GetString(i);
                    break;
                }
            }

            assess.Rubric.Criteria.Add(RubricCriteria.Create(dr));
            return(assess);
        }
Beispiel #2
0
        public static RubricCriteria Create(MySqlDataReader dr)
        {
            RubricCriteria criteria = new RubricCriteria();

            for (int i = 0; i < dr.VisibleFieldCount; i++)
            {
                if (dr.GetValue(i) == DBNull.Value)
                {
                    continue;
                }

                var field = dr.GetName(i);

                switch (field)
                {
                case "RubricCriteriaLevelName":
                    criteria.LevelName = dr.GetString(i);
                    break;

                case "ScoreValue":
                    criteria.Score = dr.GetInt32(i);
                    break;

                case "asmt_mastery_level_id":
                    criteria.MasteryLevelID = dr.GetInt32(i);
                    break;

                case "points":
                    criteria.Points = dr.GetDecimal(i);
                    break;

                case "weight":
                    criteria.Weight = dr.GetDecimal(i);
                    break;

                case "MasteryLevel":
                    criteria.MasteryLevel = dr.GetString(i);
                    break;

                case "CriteriaName":
                    criteria.CriteriaName = dr.GetString(i);
                    break;

                case "display_seq":
                    criteria.Sequence = dr.GetInt32(i);
                    break;
                }
            }
            return(criteria);
        }