Skip to content

Commit

Permalink
Configuring Collective Model action support threshold individually fo…
Browse files Browse the repository at this point in the history
…r each of the actions in spreadsheet
  • Loading branch information
IvanRibakov committed Jun 7, 2018
1 parent ab9975e commit c9a3673
Show file tree
Hide file tree
Showing 5 changed files with 39 additions and 10 deletions.
Binary file modified DomainConf/Tutorial.xlsx
Binary file not shown.
2 changes: 1 addition & 1 deletion Exes/Test/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ public static void pruebaDepErrorLog ()
ActionAplication action = new ActionAplication ("f01a32", 1, "Comer tarta", "Comerse la tarta fabricada.",
new List<string> (new string[] { "Tarta" }), false, false, false, false, false,
complexDependence, null, false, true, null, "Tarta comida.", true, null, tutorMessage,
false, null, null, null);
0, false, null, null, null);
//Creates the Domain.
Console.WriteLine ("Creando dominio de práctica...");
//Creates the actions list.
Expand Down
5 changes: 3 additions & 2 deletions ExpertModule/Its.ExpertModule.DataAccess/ActionAccess.cs
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,9 @@ record [18] == null ? "" : record [18].ToString (), //Validate errors. 17
record [19] == null ? "" : record [19].ToString (), //Init phase. 18
record [20] == null ? "" : record [20].ToString (), //Object name. 19
record [21] == null ? "" : record [21].ToString (), //In Phase. 20
record [22] == null ? "" : record [22].ToString (), //Is Checkpoint?. 21
record [23] == null ? "" : record [23].ToString () //Collective Model Tutor messages. 22
record [22] == null ? "" : record [22].ToString (), //Support threshold. 21
record [23] == null ? "" : record [23].ToString (), //Is Checkpoint?. 22
record [24] == null ? "" : record [24].ToString () //Collective Model Tutor messages. 23
};

//Adds the action information into the list which will be returned.
Expand Down
20 changes: 18 additions & 2 deletions ExpertModule/Its.ExpertModule.ObjectModel/ActionAplication.cs
Original file line number Diff line number Diff line change
Expand Up @@ -320,6 +320,20 @@ public TutorMessage TutorMsg {
}
}
/// <summary>
/// Amount of support that this action needs to have by Collective Student Model
/// in order to provide Collective Model Tutor feedback.
/// </summary>
private double _supportThreshold;
/// <summary>
/// Gets the SupportThreshold flag.
/// </summary>
/// <value>Boolean to indicate whether current action is a checkpoint for student reclustering.</value>
public double SupportThreshold {
get {
return _supportThreshold;
}
}
/// <summary>
/// Whether action represents a checkpoint for student reclustering in Collective Student Model tutoring strategy.
/// </summary>
private bool _isCheckpoint;
Expand Down Expand Up @@ -407,7 +421,7 @@ public ActionAplication (string key, int phase, string name, string description,
bool unlockObj, bool isRepetitive, bool initPhase, bool validatePhaseErrors, ComplexDependence dependence,
List<Incompatibility> incompatibilities, bool correctiveAction, bool noPlanAction, List<Error> errorsToCorrect,
string okMessage, bool showOkMessage, List<ActionAplication> possibleNextActions, TutorMessage tutorMessage,
bool isCheckpoint, TutorMessage tutorMsgLowDetail, TutorMessage tutorMsgMediumDetail, TutorMessage tutorMsgHighDetail)
double supportThreshold, bool isCheckpoint, TutorMessage tutorMsgLowDetail, TutorMessage tutorMsgMediumDetail, TutorMessage tutorMsgHighDetail)
{
//If the key parameter is null or empty or his contained is a blank, a exception is thrown.
if (StringUtils.IsNullOrWhiteSpace (key)) {
Expand Down Expand Up @@ -450,6 +464,7 @@ public ActionAplication (string key, int phase, string name, string description,
this._showOkMessage = showOkMessage;
this._possibleNextActions = possibleNextActions;
this._tutorMsg = tutorMessage;
this._supportThreshold = supportThreshold;
this._isCheckpoint = isCheckpoint;
this._tutorMsgLowDetail = tutorMsgLowDetail;
this._tutorMsgMediumDetail = tutorMsgMediumDetail;
Expand Down Expand Up @@ -499,7 +514,7 @@ public ActionAplication (string key, int phase, string name, string description,
ComplexDependence dependence, List<Incompatibility> incompatibilities, bool correctiveAction, bool noPlanAction,
List<Error> errorsToCorrect, string okMessage, bool showOkMessage, List<ActionAplication> possibleNextActions,
TutorMessage tutorMessage, int minTime, Error minTimeError, int maxTime = 0, Error maxTimeError = null,
bool isCheckpoint = false, TutorMessage tutorMsgLowDetail = null, TutorMessage tutorMsgMediumDetail = null, TutorMessage tutorMsgHighDetail = null)
double supportThreshold = 0, bool isCheckpoint = false, TutorMessage tutorMsgLowDetail = null, TutorMessage tutorMsgMediumDetail = null, TutorMessage tutorMsgHighDetail = null)
{
//If the key parameter is null or empty or his contained is a blank, a exception is thrown.
if (StringUtils.IsNullOrWhiteSpace (key)) {
Expand Down Expand Up @@ -542,6 +557,7 @@ public ActionAplication (string key, int phase, string name, string description,
this._minTimeError = minTimeError;
this._maxTime = maxTime;
this._maxTimeError = maxTimeError;
this._supportThreshold = supportThreshold;
this._isCheckpoint = isCheckpoint;
this._tutorMsgLowDetail = tutorMsgLowDetail;
this._tutorMsgMediumDetail = tutorMsgMediumDetail;
Expand Down
22 changes: 17 additions & 5 deletions Factories/Its.Factories/DomainActionsFactory.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1007,15 +1007,27 @@ from q in errMsgContainer
bool isInPlan = true;
if (s == "0")
isInPlan = false;
//Obtains IsCheckpoint flag value.
//Obtains Support Threshold value in the range [0; 1]
s = o [21].ToString ();
double supportThreshold = 0;
if (!StringUtils.IsNullOrWhiteSpace(s))
{
supportThreshold = double.Parse(s);
double epsilon = 0.0001;
if (supportThreshold < (0 - epsilon) || supportThreshold > (1 + epsilon))
{
throw new ArgumentException ("Invalid support threshold value in Action " + key + ": threshold value must be a float in the range [0; 1]");
}
}
//Obtains IsCheckpoint flag value.
s = o [22].ToString ();
bool isCheckpoint = false;
if (s == "1")
isCheckpoint = true;
// Obtains Collective Student Model tutor messages.
// Expecting messages to be defined in the order of increasing level of details:
// low detail -> medium detail -> high detail
s = o [22].ToString ();
s = o [23].ToString ();
string[] csmTutorMessages = s.Split (new char[] { '\\' });
string lowDetailMsg = csmTutorMessages.Length >= 1 ? csmTutorMessages[0] : null;
string mediumDetailMsg = csmTutorMessages.Length >= 2 ? csmTutorMessages[1] : null;
Expand All @@ -1032,18 +1044,18 @@ from q in errMsgContainer
action = new ActionAplication (key, phase, name, description, objectName,
lockObj, unlockObj, isRepetitive, initPhase, validatePhaseErrors, dependence, incompatibilities,
false, isInPlan, null, okMessage, showOkMessage, null, tutorMsg, minTime, minTimeError, maxTime, maxTimeError,
isCheckpoint, lowDetailTutorMessage, mediumDetailTutorMessage, highDetailTutorMessage);
supportThreshold, isCheckpoint, lowDetailTutorMessage, mediumDetailTutorMessage, highDetailTutorMessage);

} else if (maxTime > 0) {
action = new ActionAplication (key, phase, name, description, objectName,
lockObj, unlockObj, isRepetitive, initPhase, validatePhaseErrors, dependence, incompatibilities,
false, isInPlan, null, okMessage, showOkMessage, null, tutorMsg, minTime, minTimeError, maxTime, maxTimeError,
isCheckpoint, lowDetailTutorMessage, mediumDetailTutorMessage, highDetailTutorMessage);
supportThreshold, isCheckpoint, lowDetailTutorMessage, mediumDetailTutorMessage, highDetailTutorMessage);
}else {
action = new ActionAplication (key, phase, name, description, objectName,
lockObj, unlockObj, isRepetitive, initPhase, validatePhaseErrors, dependence, incompatibilities,
false, isInPlan, null, okMessage, showOkMessage, null, tutorMsg,
isCheckpoint, lowDetailTutorMessage, mediumDetailTutorMessage, highDetailTutorMessage);
supportThreshold, isCheckpoint, lowDetailTutorMessage, mediumDetailTutorMessage, highDetailTutorMessage);
}
//Adds into the list.
actions.Add (action);
Expand Down

0 comments on commit c9a3673

Please sign in to comment.