AwesomeKiosk.Controllers.ApplicantController.Questions C# (CSharp) Method

Questions() private method

private Questions ( System.Web.Mvc.FormCollection collection ) : System.Web.Mvc.ActionResult
collection System.Web.Mvc.FormCollection
return System.Web.Mvc.ActionResult
        public ActionResult Questions(FormCollection collection)
        {
            //Save the form collection in the session
            List<String> userInformation = new List<String>();
            String[] validKeys = collection.AllKeys;
            for (int i = 0; i < validKeys.Length; i++)
            {
                userInformation.Add(collection.GetValue(validKeys[i]).AttemptedValue);
            }
            HttpContext.Session["userInformation"] = userInformation;

            // Get the question set and send it to the view
            var set = context.Job_DbSet;
            var questions = new List<Question>();
            List<int> selectedJobIds = (List<int>)HttpContext.Session["selectedJobIds"];

            for (int i = 0; i < selectedJobIds.Count; i++)
            {
                if (set.Find(selectedJobIds[i]) != null)
                {
                    Job j = set.Find(selectedJobIds[i]);

                    foreach (Question q in j.Questions)
                    {
                        if (!questions.Contains(q))
                        {
                            questions.Add(q);
                        }
                    }
                }
            }
            return View(questions);
        }