public void Save(long idItem, long idVersion, long idSettings, EvaluationType evaluation, List <dtoScormItemEvaluationSettings> items) { if (!SessionTimeout()) { ModuleRepository.ActionType uAction = ModuleRepository.ActionType.ScormSettingsUnableToSave; Int32 idCommunity = View.RepositoryIdCommunity; liteRepositoryItemVersion version = Service.ItemGetVersion(idItem, idVersion); if (version == null) { uAction = ModuleRepository.ActionType.ScormSettingsLoaded; View.DisplayUnknownItem(); View.AllowSave = false; } else { ScormPackageSettings settings = Service.ScormPackageSettingsSave(idItem, idVersion, idSettings, evaluation, items); if (settings == null) { uAction = ModuleRepository.ActionType.ScormSettingsUnableToSave; View.DisplayMessage(version.DisplayName, version.Extension, version.Type, Domain.UserMessageType.scormSettingsUnableToSave, version.Availability); } else { View.IdSettings = settings.Id; View.LoadSettings(version.UniqueIdVersion.ToString(), version.DisplayName, dtoScormPackageSettings.CreateFrom(settings, version), false, false); uAction = ModuleRepository.ActionType.ScormSettingsSaved; View.DisplayMessage(version.DisplayName, version.Extension, version.Type, Domain.UserMessageType.scormSettingsSaved, version.Availability); } } View.SendUserAction(idCommunity, Service.GetIdModule(), uAction); } }
/// <summary> /// Process and classify the raw object that comes from the native /// evaluator. /// </summary> private void ProcessObject(bool invokeCallbacks) { object value = evaluator(); if (rawObject == null || !value.Equals(rawObject)) { double oldSafeValue = doubleValue; rawObject = value; if (value is double) { doubleValue = (double)value; if (double.IsNaN(doubleValue) || double.IsInfinity(doubleValue)) { doubleValue = 0.0; } stringValue = string.Format("{0:R}", doubleValue); valueType = EvaluationType.Double; } else if (value is string) { stringValue = value as string; doubleValue = 0.0; valueType = EvaluationType.String; // Since strings never change doubleValue, we force them // to trigger callbacks here. if (invokeCallbacks) { TriggerNumericCallbacks(0.0); } } else if (value is bool) { bool bValue = (bool)value; doubleValue = (bValue) ? 1.0 : 0.0; stringValue = bValue.ToString(); valueType = EvaluationType.Boolean; } else if (value == null) { doubleValue = 0.0; stringValue = name; valueType = EvaluationType.Nil; } else { // TODO ...? throw new NotImplementedException("ProcessObject found an unexpected return type " + value.GetType() + " for " + name); } // There is actually inadequate precision in a 32 bit float // to detect fixed update time deltas by the time 96 hours // have passed on the UT clock, so we leave the values as // double precision and compare the delta to the Mathf.Epsilon. if (Math.Abs(oldSafeValue - doubleValue) > Mathf.Epsilon) { TriggerNumericCallbacks(doubleValue); } } }
public SupplierEvaluation(EvaluationType eType, int comId, int relaId, short cScore, string email, bool recm) : this(eType, comId, relaId) { caseScore = cScore; recommend = recm; buyerEmail = email; }
private void LoadEvaluations(long idCommittee, long idCall, EvaluationType type, Int32 idCommunity, List <expCommitteeMember> evaluators, dtoEvaluationsFilters filters, int pageIndex, int pageSize) { Boolean allowManage = true; View.CurrentFilters = filters; ModuleCallForPaper module = Service.CallForPaperServicePermission(UserContext.CurrentUserID, idCommunity); allowManage = (module.CreateCallForPaper || module.Administration || module.ManageCallForPapers || module.EditCallForPaper); if (UserContext.isAnonymous) { View.DisplaySessionTimeout(); } else if (allowManage) { View.AllowBackToSummary = true; View.SetBackToSummary(RootObject.EvaluationsSummary(idCall, idCommunity, View.PreloadView, 0, filters.IdSubmitterType, filters.Status, filters.OrderBy, filters.Ascending, pageIndex, pageSize, View.GetItemEncoded(filters.SearchForName))); LoadItems(idCommittee, idCall, type, idCommunity, evaluators, filters, pageIndex, pageSize); } else { View.DisplayNoPermission(idCommunity, View.IdCallModule); } }
public async Task <ActionResult> Edit([Bind(Include = "Id,Name,Description,A1,A2,B1,B2,C1,C2")] EvaluationType evaluationType) { if (ModelState.IsValid) { GreenLightFeaturesEntities db = new GreenLightFeaturesEntities(); var evalType = db.EvaluationTypeSet.FirstOrDefault(x => x.Id != evaluationType.Id && x.Name.ToLower().Trim() == evaluationType.Name.ToLower().Trim()); if (evalType != null) { ModelState.AddModelError("Name", "Name already exists"); } else { evaluationType.A1 = evaluationType.A1 ?? ""; evaluationType.A2 = evaluationType.A2 ?? ""; evaluationType.B1 = evaluationType.B1 ?? ""; evaluationType.B2 = evaluationType.B2 ?? ""; evaluationType.C1 = evaluationType.C1 ?? ""; evaluationType.C2 = evaluationType.C2 ?? ""; db.Entry(evaluationType).State = EntityState.Modified; await db.SaveChangesAsync(); return(RedirectToAction("Index")); } } return(View(evaluationType)); }
public EvaluationType GetEvaluationTypeByCode(string code) { EvaluationType res = null; var query = "SELECT [ET].[Id], " + " [ET].[Code]," + " [ET].[Name]," + " [ET].[Priority] " + "FROM [dbo].[EvaluationType] AS [ET] " + "WHERE [ET].[Code] = @code"; using (var conn = new SqlConnection(Config.GetConnectionString())) { using (var cmd = new SqlCommand(query, conn)) { cmd.Parameters.Add("@code", SqlDbType.NVarChar); cmd.Parameters["@code"].Value = code; conn.Open(); var dt = new DataTable(); var da = new SqlDataAdapter(cmd); da.Fill(dt); if (dt.Rows.Count == 1) { res = getEvaluationTypeFromDataRow(dt.Rows[0]); } } } return(res); }
public SubjectInformation(PlainText name, Credits credits, EvaluationType type, Proportion activity, GenericEntities.Professor professor) : this(name, credits, type, activity) { Contract.Requires(professor != null, "professor"); Professor = professor; }
private void LoadItems(long idCall, EvaluationType type, Int32 idCommunity, dtoEvaluationsFilters filters, int pageIndex, int pageSize) { if (type == EvaluationType.Dss) { InitializeDssInfo(idCall); } else { View.HideDssWarning(); } bool isAdvance = ServiceCall.CallIsAdvanced(idCall); List <dtoEvaluationSummaryItem> items = isAdvance ? ServiceCall.GetEvaluationsList(idCall, View.IdCallAdvCommission, type, filters, View.AnonymousDisplayname, View.UnknownDisplayname) : Service.GetEvaluationsList(idCall, type, filters, View.AnonymousDisplayname, View.UnknownDisplayname, true); PagerBase pager = new PagerBase(); pager.PageSize = pageSize; if (pageSize == 0) { pageSize = 50; } pager.Count = (int)items.Count - 1; pager.PageIndex = pageIndex;// Me.View.CurrentPageIndex View.Pager = pager; View.CurrentOrderBy = filters.OrderBy; View.CurrentFilterBy = filters.Status; View.CurrentAscending = filters.Ascending; View.PageSize = pageSize; View.AllowExportCurrent = (items != null && items.Any() && items.Skip(pageIndex * pageSize).Take(pageSize).Any()); if (pager.Count < 0) { View.DisplayNoEvaluationsFound(); } else { List <long> committees = Service.GetIdCommittees(idCall); if (committees.Count == 1) { View.DisplayLinkToSingleCommittee(committees.FirstOrDefault()); } View.LoadEvaluations(items.Skip(pageIndex * pageSize).Take(pageSize).ToList(), committees.Count); } View.SendUserAction(View.IdCallCommunity, View.IdCallModule, ModuleCallForPaper.ActionType.ViewEvaluationsSummary); if (isAdvance) { bool cancloseAdvance = ServiceCall.CommissionCanClose(View.IdCallAdvCommission); View.ShowCloseCommission(cancloseAdvance); } }
// specified constructor public Evaluation(double evaluationWeight, double maxPoints, EvaluationType typeOfEvaluation) { EvaluationWeight = evaluationWeight; MaxPoints = maxPoints; ATypeOfEvaluation = typeOfEvaluation; Points = 0; }
public SupplierEvaluation(EvaluationType eType,int comId, int relaId) : this() { type = eType; companyId = comId; relatedId = relaId; }
public SyncRule(string rule, EvaluationType evaluation, SyncRuleType ruleType, SyncRuleProcessor processor) { Rule = rule; Evaluation = evaluation; RuleType = ruleType; Processor = processor; }
public static string GetAttributeRank(EvaluationType evaluationType, Player p) { if (evaluationType == EvaluationType.TECHINICAL) { return(GetRank((int)((p.shortPass + p.longPass) / 2))); } else if (evaluationType == EvaluationType.OFFENCE) { return(GetRank((int)((p.shooting + p.anticipation) / 2))); } else if (evaluationType == EvaluationType.DEFENCE) { return(GetRank((int)((p.tackling + p.anticipation) / 2))); } else if (evaluationType == EvaluationType.PACE) { return(GetRank((int)((p.pace + p.agility) / 2))); } else if (evaluationType == EvaluationType.MENTALITY) { return(GetRank((int)((p.anticipation)))); } else if (evaluationType == EvaluationType.STRENGTH) { return(GetRank((int)((p.strength)))); } return("INVALID"); }
/// <summary> /// Construct a dynamic native evaluator. /// </summary> /// <param name="name">Name (canonical) of the variable.</param> /// <param name="evaluator">The function used to evaluate the variable.</param> /// <param name="cacheable">Whether the variable is cacheable (if false, the variable must be evaluated every time it's called).</param> /// <param name="mutable">Whether the variable will ever change value.</param> /// <param name="variableType">The type of variable.</param> public GenericVariable(string name, Func <object> evaluator, bool cacheable, bool mutable, VariableType variableType) : base(name, (mutable) ? cacheable : true, (mutable) ? variableType : VariableType.Constant) { this.evaluator = evaluator; this.valueType = EvaluationType.Nil; ProcessObject(false); if (!mutable) { switch (valueType) { case EvaluationType.Boolean: luaValue = DynValue.NewBoolean(doubleValue != 0.0); break; case EvaluationType.Double: luaValue = DynValue.NewNumber(doubleValue); break; case EvaluationType.String: luaValue = DynValue.NewString(stringValue); break; case EvaluationType.Nil: luaValue = DynValue.NewNil(); break; } } }
public DefinedSubject(Guid id, Common.Professor.Professor professor, EvaluationType type, Proportion prop) : base(subjectName, credits) { this.id = id; Professor = professor; this.type = type; this.prop = prop; }
public async Task <IActionResult> Edit(int id, [Bind("Id,Name,StatusOpen,OpeningDate,ClosingDate")] EvaluationType evaluationType) { if (id != evaluationType.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(evaluationType); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!EvaluationTypeExists(evaluationType.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(evaluationType)); }
private void BtnSubmit_Click(object sender, EventArgs e) { if (txtType.TextLength == 0) { MessageBox.Show("Please input information"); return; } string text = txtType.Text.Trim(); EvaluationType evaluationType = new EvaluationType() { EvTName = text, EvTId = "" }; string json = JsonConvert.SerializeObject(evaluationType); string url = ApiRouting.GetUrl("", "", "evaluationType", ApiFunction.Add).ToString(); bool confirm = url.Post <EvaluationType>(json); if (confirm) { MessageBox.Show("Operation Successful"); } else { MessageBox.Show("Operation Falied"); } txtType.Clear(); var evtObj = Singleton.Instance.Container.Resolve <MainView>("evaluation type"); evtObj.Init(); }
public void DefineEvaluation(int evalOrderNumber, EvaluationType type, int max, double weight) { foreach (Enrolment enrl in enrolments) { enrl.Evaluations[evalOrderNumber - 1] = new Evaluation(type, max, weight); } }
public SubjectInformation(PlainText name, Credits credits, EvaluationType type, Proportion activity) { Name = name; Credits = credits; Evaluation = type; ActivityProportion = activity; }
private void InitializeView(long idCall, EvaluationType type, Int32 idCommunity, dtoEvaluationsFilters filters) { List <dtoCommittee> committees = Service.GetCommitteesForSummary(idCall, false); if (committees.Count == 1) { View.DisplaySingleCommittee(committees.Select(c => c.Id).FirstOrDefault(), idCall, idCommunity, filters); } else { List <EvaluationFilterStatus> items = Service.GetAvailableEvaluationFilterStatus(idCall); List <dtoSubmitterType> types = Service.GetSubmitterTypes(idCall, ManageEvaluationsAction.None); if (!items.Contains(filters.Status)) { filters.Status = items[0]; } if (types == null || (types != null && (!types.Any() && !types.Where(i => i.Id == filters.IdSubmitterType).Any()))) { filters.IdSubmitterType = -1; } View.CurrentFilters = filters; View.LoadAvailableStatus(items, filters.Status); View.LoadAvailableSubmitterTypes(types, filters.IdSubmitterType); View.CurrentCommittees = committees; View.CommitteesCount = committees.Count(); View.PageSize = View.PreloadPageSize; View.CurrentPageIndex = View.PreloadPageIndex; LoadEvaluations(idCall, type, idCommunity, committees, filters, View.PreloadPageIndex, View.PreloadPageSize); } }
public async Task <ActionResult <EvaluationType> > PostEvaluationType(EvaluationType evaluationType) { _context.EvaluationTypes.Add(evaluationType); await _context.SaveChangesAsync(); return(CreatedAtAction("GetEvaluationType", new { id = evaluationType.ID }, evaluationType)); }
public async Task <IActionResult> PutEvaluationType(int id, EvaluationType evaluationType) { if (id != evaluationType.ID) { return(BadRequest()); } _context.Entry(evaluationType).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!EvaluationTypeExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public void DefineEvaluation(int evaluationOrderNumber, EvaluationType evaluation, int maxPoints, double evaluationWeight) { for (int i = 0; i < Students.Count; i++) { Students[i].Evaluations.Add(new Evaluation(evaluation, maxPoints, evaluationWeight)); } }
// default constructor public Evaluation() { EvaluationWeight = 0.0; MaxPoints = 0; ATypeOfEvaluation = EvaluationType.LAB; Points = 0; }
public Evaluation Get(string token, int gameId, EvaluationType evaluationType) { var evaluation = _evaluationDbController.Get(token, gameId, evaluationType); _logger.LogInformation($"Evalaution: {evaluation?.Id} for Token: {token}, GameId: {gameId}"); return(evaluation); }
protected IActionResult GetGameProgress(int gameId, int actorId, EvaluationType evaluationType) { // todo: should this be taken from the progress cache? var evaluationsProgress = EvaluationCoreController.GetGameProgress(gameId, actorId, evaluationType); var evaluationsProgressResponses = evaluationsProgress.ToContractList(); return(new ObjectResult(evaluationsProgressResponses)); }
public void DefineSubject(PlainText subjectName, Credits credits, Dictionary <Common.Student.Student, ViewableSituation> enrolledStudents, EvaluationType type, Common.Professor.Professor professor) { Contract.Requires(professor != null, "Professor is null!"); Contract.Requires(enrolledStudents != null, "Enrolled students list is null!"); _definedSubjects.Add(new DefinedSubject(subjectName, credits, type, professor, enrolledStudents)); }
public List <Evaluation> GetByGame(int gameId, EvaluationType evaluationType) { var evaluations = _evaluationDbController.GetByGame(gameId, evaluationType); _logger.LogInformation($"{evaluations?.Count} Evalautions for GameId: {gameId}"); return(evaluations); }
public DefinedSubject(PlainText subjectName, Credits credits, EvaluationType examType, Common.Professor.Professor professor, Dictionary <Common.Student.Student, ViewableSituation> enrolledStudents) : base(subjectName, credits) { ExamType = examType; Professor = professor; _enrolledStudents = enrolledStudents; }
public void ChangeLastQuestion(Term term, EvaluationType type) { using (var conn = new SqlConnection(Connectionstr)) { var sqlQueryQuestion = $"update Evaluation.Question set IsLastQuestion=0 where TermId={term.Id} and EvaluationTypeId={type.Id}"; var modelQuestions = conn.Query <int>(sqlQueryQuestion).Distinct().FirstOrDefault(); } }
public void DefineSubject(PlainText subjectName, Credits credits, EvaluationType type, Proportion activity) { Contract.Requires(subjectName != null, "subjectName"); Contract.Requires(credits != null, "credits"); Contract.Requires(type != null, "type"); Contract.Requires(activity != null, "activity"); _definedSubjects.Add(new ForStudentCalculation(new SubjectInformation(name, credits, type, activity))); }
/// <summary> /// Creates a human or ai player type with the provided attributes /// </summary> /// <param name="pIsAI">True if player will be handles by AI</param> /// <param name="pAlgorithmType">Type of algorithm used by the AI (if AI)</param> /// <param name="pPlieDepth">Plie depth used by the algorithm (if MiniMax or AlphaBeta)</param> /// <param name="pTransTable">Algorithm uses transposition table (if MiniMax or AlphaBeta)</param> /// <param name="pMoveOrdering">Algorithm sorts the moves (if AlphaBeta)</param> public PlayerSettings(bool pIsAI, AlgorithmType pAlgorithmType, int pPlieDepth, bool pTransTable, bool pMoveOrdering, EvaluationType pEt) { IsAI = pIsAI; AlgorithmType = pAlgorithmType; PlieDepth = pPlieDepth; DoTransTable = pTransTable; DoMoveOrdering = pMoveOrdering; EvaluationFunction = pEt; }
public SupplierEvaluation(EvaluationType eType, int comId, int relaId, short sScore, short rScore, short qScore, short vScore, string email, bool recm) : this(eType, comId, relaId, 0, email, recm) { specialty = sScore; responsibility = rScore; quality = qScore; valuably = vScore; }
public Unistroke(string _name, string variant, string test, Point[] points, EvaluationType evaluationType) { unistroke.name = _name; unistroke.variant = variant; unistroke.test = test; unistroke.points = points; unistroke.evaluationType = evaluationType; Evaluate(); }
public Unistroke(Point[] points, EvaluationType evaluationType) { unistroke.name = ""; unistroke.variant = ""; unistroke.test = ""; unistroke.points = points; unistroke.evaluationType = evaluationType; Evaluate(); }
private SupplierEvaluation() { type = EvaluationType.None; companyId = 0; relatedId = 0; specialty = 0; responsibility = 0; quality = 0; valuably = 0; recommend = false; caseScore = 0; buyerEmail = ""; }
public static ArrayList List(EvaluationType eType, int comId,Pager pager) { return List(eType, comId, 0, pager); }
internal void Evaluate (EvaluationType type) { add_iterator = list.First; for (var evaluate_iterator = list.First; evaluate_iterator != null; evaluate_iterator = evaluate_iterator.Next) { var bpg = evaluate_iterator.Value as BuildPropertyGroup; if (bpg != null) { if ((type & EvaluationType.Property) != 0) { EvaluateBuildPropertyGroup (bpg); // if it wasn't moved by adding anything because of evaluating a Import shift it if (add_iterator == evaluate_iterator) add_iterator = add_iterator.Next; } continue; } var big = evaluate_iterator.Value as BuildItemGroup; if (big != null) { if ((type & EvaluationType.Item) != 0) EvaluateBuildItemGroup (big); continue; } var bc = evaluate_iterator.Value as BuildChoose; if (bc != null) { if ((type & EvaluationType.Choose) != 0) EvaluateBuildChoose (bc); continue; } // Should not be reached } add_iterator = null; }
public QueryContext CreateQueryContext(ReturnType rt, EvaluationType et) { return QueryContext.Create(this.mgr_.createQueryContext(QueryContext.ReturnTypeToInt(rt), QueryContext.EvaluationTypeToInt(et))); }
internal void Evaluate (EvaluationType type) { BuildItemGroup big; BuildPropertyGroup bpg; LinkedListNode <object> evaluate_iterator; if (type == EvaluationType.Property) { evaluate_iterator = list.First; add_iterator = list.First; while (evaluate_iterator != null) { if (evaluate_iterator.Value is BuildPropertyGroup) { bpg = (BuildPropertyGroup) evaluate_iterator.Value; if (ConditionParser.ParseAndEvaluate (bpg.Condition, project)) bpg.Evaluate (); } // if it wasn't moved by adding anything because of evaluating a Import shift it if (add_iterator == evaluate_iterator) add_iterator = add_iterator.Next; evaluate_iterator = evaluate_iterator.Next; } } else if (type == EvaluationType.Item) { evaluate_iterator = list.First; add_iterator = list.First; while (evaluate_iterator != null) { if (evaluate_iterator.Value is BuildItemGroup) { big = (BuildItemGroup) evaluate_iterator.Value; if (ConditionParser.ParseAndEvaluate (big.Condition, project)) big.Evaluate (); } evaluate_iterator = evaluate_iterator.Next; } } else if (type == EvaluationType.Choose) { evaluate_iterator = list.First; add_iterator = list.First; while (evaluate_iterator != null) { if (evaluate_iterator.Value is BuildChoose) { BuildChoose bc = (BuildChoose)evaluate_iterator.Value; bool whenUsed = false; foreach (BuildWhen bw in bc.Whens) { if (ConditionParser.ParseAndEvaluate (bw.Condition, project)) { bw.Evaluate (); whenUsed = true; break; } } if (!whenUsed && bc.Otherwise != null && ConditionParser.ParseAndEvaluate (bc.Otherwise.Condition, project)) { bc.Otherwise.Evaluate (); } } evaluate_iterator = evaluate_iterator.Next; } } add_iterator = null; }
public static ArrayList List(EvaluationType eType,Pager pager) { return List(eType, 0, 0, pager); }
public static ArrayList List(EvaluationType eType, int comId, int relatedId, Pager pager) { /* SupplierEvaluationList @type smallint=0, @comId int=0, @rid int=0, @pageIndex int=1, @pageSize int=20, @sort int=0 */ //[Id], Type, CompanyId, RelatedId, BuyerEmail, //Specialty, Responsibility, Quality, Valuably, CaseScore, //[Datetime], Recommend ArrayList list = new ArrayList(); SqlParameter[] prams ={ Database.MakeInParam("@type",SqlDbType.SmallInt,(short)eType), Database.MakeInParam("@comId",SqlDbType.Int,comId), Database.MakeInParam("@rid",SqlDbType.Int,relatedId), Database.MakeInParam("@pageIndex",SqlDbType.Int,pager.PageIndex), Database.MakeInParam("@pageSize",SqlDbType.Int,pager.PageSize), Database.MakeInParam("@sort",SqlDbType.Int,pager.SortNum) }; SqlDataReader reader = null; try { reader = Database.ExecuteReader(CommandType.StoredProcedure, "SupplierEvaluationList", prams); if (reader.Read()) { pager.RecordCount = reader.GetInt32(0); if (reader.NextResult()) { while (reader.Read()) { SupplierEvaluation eval = new SupplierEvaluation(); eval.id = reader.GetInt32(0); eval.type = (EvaluationType)(reader.GetInt16(1)); eval.companyId = reader.GetInt32(2); eval.relatedId = reader.GetInt32(3); eval.buyerEmail = reader.GetString(4); eval.specialty = reader.GetInt16(5); eval.responsibility = reader.GetInt16(6); eval.quality = reader.GetInt16(7); eval.valuably = reader.GetInt16(8); eval.caseScore = reader.GetInt16(9); eval.datetime = reader.GetDateTime(10); eval.recommend = reader.GetBoolean(11); list.Add(eval); } } } reader.Close(); } catch { //throw; } finally { if (reader != null) { reader.Close(); } } return list; }