private void SetLinkedCompetencySources(SkillSetProxy skillsetProxy, IList<string> competencyGuids, IList<Core.Competency.Competency> competencyList) { skillsetProxy.Source = GetLinkedCompetencySources(competencyGuids, competencyList); skillsetProxy.SourceNameText = string.Join(" ", skillsetProxy.Source); }
/// <summary> /// Method to get the skill sets and questions associated with it for a given assignment /// </summary> /// <param name="assignmentUrl"></param> /// <returns></returns> public IList<SkillSetProxy> GetSkillSetsForAnAssignment(string assignmentUrl) { Assignment assignmentObject = _assignmentService.GetAssignment(assignmentUrl); Dictionary<string, SkillSet> skillSetsForTheAssignment = new Dictionary<string, SkillSet>(); if (assignmentObject != null && assignmentObject.SkillSets != null) { skillSetsForTheAssignment = assignmentObject.SkillSets; } IList<string> competencyListForSkillSets = new List<string>(); foreach (var skillSetItem in skillSetsForTheAssignment) { foreach (var competencyItem in skillSetItem.Value.Competencies) { competencyListForSkillSets.Add(GetLinkedCompetencyForAGuid(competencyItem)); } skillSetItem.Value.UniqueIdentifier = skillSetItem.Key; Dictionary<string, Question> questionsForSkillSet = skillSetItem.Value.Questions; if (questionsForSkillSet != null) { foreach (var questionItem in questionsForSkillSet) { questionItem.Value.UniqueIdentifier = questionItem.Key; } } } IList<SkillSetProxy> skillSetProxyObject = new List<SkillSetProxy>(); IList<SkillSet> skillSetList = ((skillSetsForTheAssignment.Select(assignmentItem => assignmentItem.Value).ToList()).OrderBy(x => x.SequenceNumber).ToList()); foreach (SkillSet skillSet in skillSetList) { SkillSetProxy skillSetProxy = new SkillSetProxy { UniqueIdentifier = skillSet.UniqueIdentifier, SkillSetTitle = skillSet.SkillSetTitle, Questions = ((skillSet.Questions != null) ? (skillSet.Questions.Select( questionItem => questionItem.Value).ToList()). OrderBy(x => x.SequenceNumber).ToList() : new List<Question>()), Guid = skillSet.UniqueIdentifier, Url = skillSet.Url }; skillSetProxyObject.Add(skillSetProxy); } //ViewBag.CompetencyListForSelectedSkillSet = competencyListForSkillSets; return skillSetProxyObject; }
public void SetLinkedCompetencyTextForAQuestions(string guidOfLinkedCompetency, SkillSetProxy skillSetProxy) { throw new NotImplementedException(); }
/// <summary> /// Get LinkedCompetency Text for a competency guid /// </summary> /// <param name="guidOfLinkedCompetency"></param> /// <param name="documentProxy"> </param> /// <returns></returns> public void SetLinkedCompetencyTextForAQuestions(IList<string> guidOfLinkedCompetency, SkillSetProxy documentProxy) { documentProxy.LinkedCompetencies.ToList().ForEach(c => SetLinkedCompetencyForAGuid(c)); }