Skip to content

Commit

Permalink
Conforming with changes requsted after a pull request review. See Rus…
Browse files Browse the repository at this point in the history
  • Loading branch information
peturingi authored and reedmclean committed Aug 8, 2018
1 parent 8a3a563 commit c79c366
Show file tree
Hide file tree
Showing 5 changed files with 38 additions and 41 deletions.
3 changes: 0 additions & 3 deletions TinCan.sln
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 2013
VisualStudioVersion = 12.0.31101.0
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TinCan", "TinCan\TinCan.csproj", "{27D0FCA1-E869-440C-9D16-F62D7A068C53}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TinCanTests", "TinCanTests\TinCanTests.csproj", "{854413C2-2F81-4A82-9949-DE2868A10078}"
Expand Down
2 changes: 1 addition & 1 deletion TinCan/ActivityDefinition.cs
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ public ActivityDefinition(JObject jobj)

public override JObject ToJObject(TCAPIVersion version) {
JObject result = new JObject();

if (type != null)
{
result.Add("type", type.ToString());
Expand Down
2 changes: 1 addition & 1 deletion TinCan/InteractionComponent.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
Copyright 2014 Rustici Software
Copyright 2015 Rustici Software
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
70 changes: 35 additions & 35 deletions TinCan/InteractionType.cs
Original file line number Diff line number Diff line change
@@ -1,33 +1,30 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace TinCan
{
public sealed class InteractionType
{
private const string choice = "choice";
private const string sequencing = "sequencing";
private const string likert = "likert";
private const string matching = "matching";
private const string performance = "performance";
private const string truefalse = "true-false";
private const string fillin = "fill-in";
private const string numeric = "numeric";
private const string other = "other";


public static readonly InteractionType Choice = new InteractionType("choice");
public static readonly InteractionType Sequencing = new InteractionType("sequencing");
public static readonly InteractionType Likert = new InteractionType("likert");
public static readonly InteractionType Matching = new InteractionType("matching");
public static readonly InteractionType Performance = new InteractionType("performance");
public static readonly InteractionType TrueFalse = new InteractionType("true-false");
public static readonly InteractionType FillIn = new InteractionType("fill-in");
public static readonly InteractionType Numeric = new InteractionType("numeric");
public static readonly InteractionType Other = new InteractionType("other");

private const string CHOICE = "choice";
private const string SEQUENCING = "sequencing";
private const string LIKERT = "likert";
private const string MATCHING = "matching";
private const string PERFORMANCE = "performance";
private const string TRUEFALSE = "true-false";
private const string FILLIN = "fill-in";
private const string LONGFILLIN = "long-fill-in";
private const string NUMERIC = "numeric";
private const string OTHER = "other";

public static readonly InteractionType Choice = new InteractionType(CHOICE);
public static readonly InteractionType Sequencing = new InteractionType(SEQUENCING);
public static readonly InteractionType Likert = new InteractionType(LIKERT);
public static readonly InteractionType Matching = new InteractionType(MATCHING);
public static readonly InteractionType Performance = new InteractionType(PERFORMANCE);
public static readonly InteractionType TrueFalse = new InteractionType(TRUEFALSE);
public static readonly InteractionType FillIn = new InteractionType(FILLIN);
public static readonly InteractionType LongFillIn = new InteractionType(LONGFILLIN);
public static readonly InteractionType Numeric = new InteractionType(NUMERIC);
public static readonly InteractionType Other = new InteractionType(OTHER);

private InteractionType(string value)
{
Expand All @@ -38,36 +35,39 @@ public static InteractionType FromValue(string value)
{
switch (value)
{
case choice:
case CHOICE:
return Choice;

case sequencing:
case SEQUENCING:
return Sequencing;

case likert:
case LIKERT:
return Likert;

case matching:
case MATCHING:
return Matching;

case performance:
case PERFORMANCE:
return Performance;

case truefalse:
case TRUEFALSE:
return TrueFalse;

case fillin:
case FILLIN:
return FillIn;

case LONGFILLIN:
return LongFillIn;

case numeric:
case NUMERIC:
return Numeric;

case other:
case OTHER:
return Other;

default:
return null;

throw new ArgumentOutOfRangeException(nameof(value),
$"'{value}' is not a valid interactionType.");
}
}

Expand Down
2 changes: 1 addition & 1 deletion TinCanTests/Support.cs
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ static Support () {
context.statement = statementRef;
context.contextActivities = new ContextActivities();
context.contextActivities.parent = new List<Activity>();
context.contextActivities.parent.Add(parent);
context.contextActivities.parent.Add(parent);

score = new Score();
score.raw = 97;
Expand Down

0 comments on commit c79c366

Please sign in to comment.