Skip to content

Commit c79c366

Browse files
peturingireedmclean
authored andcommitted
Conforming with changes requsted after a pull request review. See RusticiSoftware#17
1 parent 8a3a563 commit c79c366

File tree

5 files changed

+38
-41
lines changed

5 files changed

+38
-41
lines changed

TinCan.sln

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11

22
Microsoft Visual Studio Solution File, Format Version 12.00
3-
# Visual Studio 2013
4-
VisualStudioVersion = 12.0.31101.0
5-
MinimumVisualStudioVersion = 10.0.40219.1
63
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TinCan", "TinCan\TinCan.csproj", "{27D0FCA1-E869-440C-9D16-F62D7A068C53}"
74
EndProject
85
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TinCanTests", "TinCanTests\TinCanTests.csproj", "{854413C2-2F81-4A82-9949-DE2868A10078}"

TinCan/ActivityDefinition.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ public ActivityDefinition(JObject jobj)
119119

120120
public override JObject ToJObject(TCAPIVersion version) {
121121
JObject result = new JObject();
122-
122+
123123
if (type != null)
124124
{
125125
result.Add("type", type.ToString());

TinCan/InteractionComponent.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
Copyright 2014 Rustici Software
2+
Copyright 2015 Rustici Software
33
44
Licensed under the Apache License, Version 2.0 (the "License");
55
you may not use this file except in compliance with the License.

TinCan/InteractionType.cs

Lines changed: 35 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,30 @@
11
using System;
2-
using System.Collections.Generic;
3-
using System.Linq;
4-
using System.Text;
52

63
namespace 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

TinCanTests/Support.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ static Support () {
8686
context.statement = statementRef;
8787
context.contextActivities = new ContextActivities();
8888
context.contextActivities.parent = new List<Activity>();
89-
context.contextActivities.parent.Add(parent);
89+
context.contextActivities.parent.Add(parent);
9090

9191
score = new Score();
9292
score.raw = 97;

0 commit comments

Comments
 (0)