-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathThinksyLearningAction.cs
More file actions
38 lines (33 loc) · 1014 Bytes
/
ThinksyLearningAction.cs
File metadata and controls
38 lines (33 loc) · 1014 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
using System;
public class LearningAction
{
private Senseix.Message.Problem.LearningAction learningActionProto;
public LearningAction(Senseix.Message.Problem.LearningAction newLearningActionProto)
{
learningActionProto = newLearningActionProto;
}
public Senseix.Message.Problem.LearningAction GetProto()
{
return learningActionProto;
}
public ProblemPart GetLearningActionPartByName(string name)
{
for (int i = 0; i < GetProto().atoms.Count; i++)
{
Senseix.Message.Atom.Atom atom = GetProto().atoms[i];
if (atom.description.Equals(name))
{
return GetLearningActionPartByIndex(i);
}
}
throw new Exception ("There is no problem part by that name in this learning action.");
}
public ProblemPart GetLearningActionPartByIndex(int index)
{
if (index < 0 || index > GetProto().atoms.Count)
{
throw new Exception("That is out of range. There are " + GetProto().atoms.Count + " problem parts.");
}
return ProblemPart.CreateProblemPart(GetProto().atoms[index]);
}
}