public IActionResult StartTest(Parameters parameters) { var trainingType = userTraining[parameters.UserTraining]; var conditionType = userContition[parameters.UserCondition]; ITrainingEndCondition trainingEndCondition = null; if (conditionType == typeof(TimerTrainingEndCondition)) { trainingEndCondition = (ITrainingEndCondition)Activator.CreateInstance(conditionType, parameters.Time); } else { trainingEndCondition = (ITrainingEndCondition)Activator.CreateInstance(conditionType); } var training = (Training)Activator.CreateInstance( trainingType, parameters.UserLevel, trainingEndCondition); training.CreateTasks(db, parameters.TasksNumber); HttpContext.Session.Set("training", training); return(ShowNextTask()); }
public TextsTraining(Parameters.Levels level, ITrainingEndCondition condition) : base(level, condition) { }
public Training(Parameters.Levels level, ITrainingEndCondition condition) { Condition = condition; Level = level; СurrentIndex = 0; }