11using System ;
2- using System . Collections . Generic ;
3- using System . Linq ;
4- using System . Text ;
52
63namespace TinCan
74{
85 public sealed class InteractionType
96 {
10- private const string choice = "choice" ;
11- private const string sequencing = "sequencing" ;
12- private const string likert = "likert" ;
13- private const string matching = "matching" ;
14- private const string performance = "performance" ;
15- private const string truefalse = "true-false" ;
16- private const string fillin = "fill-in" ;
17- private const string numeric = "numeric " ;
18- private const string other = "other " ;
19-
20-
21- public static readonly InteractionType Choice = new InteractionType ( "choice" ) ;
22- public static readonly InteractionType Sequencing = new InteractionType ( "sequencing" ) ;
23- public static readonly InteractionType Likert = new InteractionType ( "likert" ) ;
24- public static readonly InteractionType Matching = new InteractionType ( "matching" ) ;
25- public static readonly InteractionType Performance = new InteractionType ( "performance" ) ;
26- public static readonly InteractionType TrueFalse = new InteractionType ( "true-false" ) ;
27- public static readonly InteractionType FillIn = new InteractionType ( "fill-in" ) ;
28- public static readonly InteractionType Numeric = new InteractionType ( "numeric" ) ;
29- public static readonly InteractionType Other = new InteractionType ( "other" ) ;
30-
7+ private const string CHOICE = "choice" ;
8+ private const string SEQUENCING = "sequencing" ;
9+ private const string LIKERT = "likert" ;
10+ private const string MATCHING = "matching" ;
11+ private const string PERFORMANCE = "performance" ;
12+ private const string TRUEFALSE = "true-false" ;
13+ private const string FILLIN = "fill-in" ;
14+ private const string LONGFILLIN = "long-fill-in " ;
15+ private const string NUMERIC = "numeric " ;
16+ private const string OTHER = "other" ;
17+
18+ public static readonly InteractionType Choice = new InteractionType ( CHOICE ) ;
19+ public static readonly InteractionType Sequencing = new InteractionType ( SEQUENCING ) ;
20+ public static readonly InteractionType Likert = new InteractionType ( LIKERT ) ;
21+ public static readonly InteractionType Matching = new InteractionType ( MATCHING ) ;
22+ public static readonly InteractionType Performance = new InteractionType ( PERFORMANCE ) ;
23+ public static readonly InteractionType TrueFalse = new InteractionType ( TRUEFALSE ) ;
24+ public static readonly InteractionType FillIn = new InteractionType ( FILLIN ) ;
25+ public static readonly InteractionType LongFillIn = new InteractionType ( LONGFILLIN ) ;
26+ public static readonly InteractionType Numeric = new InteractionType ( NUMERIC ) ;
27+ public static readonly InteractionType Other = new InteractionType ( OTHER ) ;
3128
3229 private InteractionType ( string value )
3330 {
@@ -38,36 +35,39 @@ public static InteractionType FromValue(string value)
3835 {
3936 switch ( value )
4037 {
41- case choice :
38+ case CHOICE :
4239 return Choice ;
4340
44- case sequencing :
41+ case SEQUENCING :
4542 return Sequencing ;
4643
47- case likert :
44+ case LIKERT :
4845 return Likert ;
4946
50- case matching :
47+ case MATCHING :
5148 return Matching ;
5249
53- case performance :
50+ case PERFORMANCE :
5451 return Performance ;
5552
56- case truefalse :
53+ case TRUEFALSE :
5754 return TrueFalse ;
5855
59- case fillin :
56+ case FILLIN :
6057 return FillIn ;
58+
59+ case LONGFILLIN :
60+ return LongFillIn ;
6161
62- case numeric :
62+ case NUMERIC :
6363 return Numeric ;
6464
65- case other :
65+ case OTHER :
6666 return Other ;
6767
6868 default :
69- return null ;
70-
69+ throw new ArgumentOutOfRangeException ( nameof ( value ) ,
70+ $ "' { value } ' is not a valid interactionType." ) ;
7171 }
7272 }
7373
0 commit comments