Ejemplo n.º 1
0
 /// <summary>
 /// Creates a new instance of the class from an integer corresponding to a value enumeration
 /// </summary>
 /// <param name="value">The value to instantiate this class with</param>
 public InteractionType(int value)
 {
     if (Enum.IsDefined(typeof(InteractionTypeValue), value))
     {
         this.Value = (InteractionTypeValue)value;
     }
     else
     {
         throw new ArgumentException("The value " + value + " is not a valid Interaction Type", "value");
     }
 }
 public static bool IsValidComponent(InteractionTypeValue interactionType, InteractionComponentName componentName)
 {
     if (interactionType == InteractionTypeValue.Choice || interactionType == InteractionTypeValue.Sequencing)
     {
         return(componentName == InteractionComponentName.Choices);
     }
     else if (interactionType == InteractionTypeValue.Likert)
     {
         return(componentName == InteractionComponentName.Scale);
     }
     else if (interactionType == InteractionTypeValue.Matching)
     {
         return(componentName == InteractionComponentName.Source || componentName == InteractionComponentName.Target);
     }
     else if (interactionType == InteractionTypeValue.Performance)
     {
         return(componentName == InteractionComponentName.Steps);
     }
     return(false);
 }
Ejemplo n.º 3
0
 /// <summary>
 /// Creates a new instance of the class from a value enumeration
 /// </summary>
 /// <param name="value">The value to instantiate this class with</param>
 public InteractionType(InteractionTypeValue value)
 {
     this.Value = value;
 }
Ejemplo n.º 4
0
        /// <summary>
        /// Creates a new instance of the class from the SCORM or AICC vocabulary
        /// </summary>
        /// <param name="vocab">The value to instantiate this class with</param>
        public InteractionType(string vocab)
        {
            switch (vocab.ToLowerInvariant().Trim())
            {
            case "":
                this.Value = InteractionTypeValue.Undefined;
                break;

            case "true-false":
                this.Value = InteractionTypeValue.TrueFalse;
                break;

            case "choice":
                this.Value = InteractionTypeValue.Choice;
                break;

            case "fill-in":
                this.Value = InteractionTypeValue.FillIn;
                break;

            case "long-fill-in":
                this.Value = InteractionTypeValue.LongFillIn;
                break;

            case "likert":
                this.Value = InteractionTypeValue.Likert;
                break;

            case "matching":
                this.Value = InteractionTypeValue.Matching;
                break;

            case "performance":
                this.Value = InteractionTypeValue.Performance;
                break;

            case "sequencing":
                this.Value = InteractionTypeValue.Sequencing;
                break;

            case "numeric":
                this.Value = InteractionTypeValue.Numeric;
                break;

            case "other":
                this.Value = InteractionTypeValue.Other;
                break;

            default:

                // Try out AICC cases
                switch (vocab.Substring(0, 1).ToLowerInvariant())
                {
                case "t":
                    this.Value = InteractionTypeValue.TrueFalse;
                    break;

                case "c":
                    this.Value = InteractionTypeValue.Choice;
                    break;

                case "f":
                    this.Value = InteractionTypeValue.FillIn;
                    break;

                case "m":
                    this.Value = InteractionTypeValue.Matching;
                    break;

                case "p":
                    this.Value = InteractionTypeValue.Performance;
                    break;

                case "s":
                    this.Value = InteractionTypeValue.Sequencing;
                    break;

                case "l":
                    this.Value = InteractionTypeValue.Likert;
                    break;

                case "n":
                    this.Value = InteractionTypeValue.Numeric;
                    break;

                default:
                    throw new ArgumentException("The value " + vocab + " is not valid.", "vocab");
                }
                break;
            }
        }
        /// <summary>
        /// Creates a new instance of the class from the SCORM or AICC vocabulary
        /// </summary>
        /// <param name="vocab">The value to instantiate this class with</param>
        public InteractionType(string vocab)
        {
            switch (vocab.ToLowerInvariant().Trim())
            {
                case "":
                    this.Value = InteractionTypeValue.Undefined;
                    break;
                case "true-false":
                    this.Value = InteractionTypeValue.TrueFalse;
                    break;
                case "choice":
                    this.Value = InteractionTypeValue.Choice;
                    break;
                case "fill-in":
                    this.Value = InteractionTypeValue.FillIn;
                    break;
                case "long-fill-in":
                    this.Value = InteractionTypeValue.LongFillIn;
                    break;
                case "likert":
                    this.Value = InteractionTypeValue.Likert;
                    break;
                case "matching":
                    this.Value = InteractionTypeValue.Matching;
                    break;
                case "performance":
                    this.Value = InteractionTypeValue.Performance;
                    break;
                case "sequencing":
                    this.Value = InteractionTypeValue.Sequencing;
                    break;
                case "numeric":
                    this.Value = InteractionTypeValue.Numeric;
                    break;
                case "other":
                    this.Value = InteractionTypeValue.Other;
                    break;
                default:

                    // Try out AICC cases
                    switch (vocab.Substring(0, 1).ToLowerInvariant())
                    {
                        case "t":
                            this.Value = InteractionTypeValue.TrueFalse;
                            break;
                        case "c":
                            this.Value = InteractionTypeValue.Choice;
                            break;
                        case "f":
                            this.Value = InteractionTypeValue.FillIn;
                            break;
                        case "m":
                            this.Value = InteractionTypeValue.Matching;
                            break;
                        case "p":
                            this.Value = InteractionTypeValue.Performance;
                            break;
                        case "s":
                            this.Value = InteractionTypeValue.Sequencing;
                            break;
                        case "l":
                            this.Value = InteractionTypeValue.Likert;
                            break;
                        case "n":
                            this.Value = InteractionTypeValue.Numeric;
                            break;

                        default:
                            throw new ArgumentException("The value " + vocab + " is not valid.", "vocab");
                    }
                    break;
            }
        }
 /// <summary>
 /// Creates a new instance of the class from an integer corresponding to a value enumeration
 /// </summary>
 /// <param name="value">The value to instantiate this class with</param>
 public InteractionType(int value)
 {
     if (Enum.IsDefined(typeof(InteractionTypeValue), value))
     {
         this.Value = (InteractionTypeValue)value;
     }
     else
     {
         throw new ArgumentException("The value " + value + " is not a valid Interaction Type", "value");
     }
 }
 /// <summary>
 /// Creates a new instance of the class from a value enumeration
 /// </summary>
 /// <param name="value">The value to instantiate this class with</param>
 public InteractionType(InteractionTypeValue value)
 {
     this.Value = value;
 }