Exemplo n.º 1
0
 public static AssessmentItem[] MakeCopy(AssessmentItem[] assessmentItems)
 {
     AssessmentItem[] ret = new AssessmentItem[assessmentItems.Length];
     for (int i = 0; i < assessmentItems.Length; i++)
     {
         ret[i] = new AssessmentItem(assessmentItems[i].Key, assessmentItems[i].Points);
     }
     return(ret);
 }
Exemplo n.º 2
0
        public string Bloberize()
        {
            string blob           = "";
            string assessmentType = "";

            switch (AssessmentType)
            {
            case AssessmentType.Item10:
                assessmentType = "010";
                break;

            case AssessmentType.Item20:
                assessmentType = "020";
                break;

            case AssessmentType.Item30:
                assessmentType = "030";
                break;

            case AssessmentType.Item40:
                assessmentType = "040";
                break;

            case AssessmentType.Item50:
                assessmentType = "050";
                break;

            case AssessmentType.Item60:
                assessmentType = "060";
                break;

            case AssessmentType.Item70:
                assessmentType = "070";
                break;

            case AssessmentType.Item80:
                assessmentType = "080";
                break;

            case AssessmentType.Item90:
                assessmentType = "090";
                break;

            case AssessmentType.Item100:
                assessmentType = "100";
                break;
            }
            blob = Extension.Helpers.SetValue(blob, "0000", assessmentType);
            blob = Extension.Helpers.SetValue(blob, "0001", AssessmentItem.EncodeArray(SetAKeys));
            blob = Extension.Helpers.SetValue(blob, "0002", AssessmentItem.EncodeArray(SetBKeys));
            blob = Extension.Helpers.SetValue(blob, "0003", AssessmentItem.EncodeArray(SetCKeys));
            blob = Extension.Helpers.SetValue(blob, "0004", SetBEnabled ? "1" : "0");
            blob = Extension.Helpers.SetValue(blob, "0005", SetCEnabled ? "1" : "0");
            blob = Extension.Helpers.SetValue(blob, "0006", PassingRate.ToString());
            return(blob);
        }
Exemplo n.º 3
0
        public static AssessmentItem[] Clone(AssessmentItem[] assessmentItems)
        {
            var newArray = new AssessmentItem[assessmentItems.Length];

            for (var i = 0; i < assessmentItems.Length; i++)
            {
                newArray[i] = new AssessmentItem(assessmentItems[i].Key, assessmentItems[i].Points);
            }
            return(newArray);
        }
Exemplo n.º 4
0
        public static AssessmentItem[] CreateItems(AssessmentType assessmentType)
        {
            int count = 0;

            switch (assessmentType)
            {
            case AssessmentType.Item10:
                count = 10;
                break;

            case AssessmentType.Item20:
                count = 20;
                break;

            case AssessmentType.Item30:
                count = 30;
                break;

            case AssessmentType.Item40:
                count = 40;
                break;

            case AssessmentType.Item50:
                count = 50;
                break;

            case AssessmentType.Item60:
                count = 60;
                break;

            case AssessmentType.Item70:
                count = 70;
                break;

            case AssessmentType.Item80:
                count = 80;
                break;

            case AssessmentType.Item90:
                count = 90;
                break;

            case AssessmentType.Item100:
                count = 100;
                break;
            }
            AssessmentItem[] items = new AssessmentItem[count];
            for (int i = 0; i < count; i++)
            {
                items[i] = new AssessmentItem(Key.A);
            }
            return(items);
        }
Exemplo n.º 5
0
        public Assessment(string blob)
        {
            switch (Extension.Helpers.GetValue(blob, "0000"))
            {
            case "010":
                AssessmentType = AssessmentType.Item10;
                break;

            case "020":
                AssessmentType = AssessmentType.Item20;
                break;

            case "030":
                AssessmentType = AssessmentType.Item30;
                break;

            case "040":
                AssessmentType = AssessmentType.Item40;
                break;

            case "050":
                AssessmentType = AssessmentType.Item50;
                break;

            case "060":
                AssessmentType = AssessmentType.Item60;
                break;

            case "070":
                AssessmentType = AssessmentType.Item70;
                break;

            case "080":
                AssessmentType = AssessmentType.Item80;
                break;

            case "090":
                AssessmentType = AssessmentType.Item90;
                break;

            case "100":
                AssessmentType = AssessmentType.Item100;
                break;
            }
            SetAKeys    = AssessmentItem.DecodeArray(Extension.Helpers.GetValue(blob, "0001"));
            SetBKeys    = AssessmentItem.DecodeArray(Extension.Helpers.GetValue(blob, "0002"));
            SetCKeys    = AssessmentItem.DecodeArray(Extension.Helpers.GetValue(blob, "0003"));
            SetCEnabled = Extension.Helpers.GetValue(blob, "0004").Equals("1");
            SetBEnabled = Extension.Helpers.GetValue(blob, "0005").Equals("1");
            PassingRate = Convert.ToDouble(Extension.Helpers.GetValue(blob, "0006"));
        }