public void _7_1_CallCenter_WithTimeBetweenCalls_ShouldHandleCallsSuccessfully()
        {
            //Arrange
            List <Employee> employees  = new List <Employee>();
            Employee        respondent = new Respondent();

            employees.Add(respondent);

            Call call1 = new Call("Billy", "123-1232");
            Call call2 = new Call("Bob", "123-1233");

            //Act
            CallCenter testCallCenter = new CallCenter(employees);

            testCallCenter.DispatchCall(call1);

            //The call is complete and the employee can take another call
            testCallCenter.AddEmployeeBackToQueue(respondent);

            testCallCenter.DispatchCall(call2);

            //Assert
            Assert.AreEqual(true, call1.IsCompleted);
            Assert.AreEqual(true, call2.IsCompleted);
        }
Exemplo n.º 2
0
        public void UserGetsQuestion_1ScenNoAns_False()
        {
            UserTiming timingRun = new UserTiming();

            LinkedQuestion q = new LinkedQuestion();

            q.VarName.RefVarName = "AA001";

            FilterInstruction fi = new FilterInstruction();

            fi.VarName = "AA000";
            fi.Oper    = Operation.Equals;
            fi.ValuesStr.Add("1");

            List <FilterInstruction> filterList = new List <FilterInstruction>();

            filterList.Add(fi);
            q.FilterList.Add(filterList);

            Respondent r = new Respondent();

            r.Description = "Test Respondent";


            Assert.IsFalse(timingRun.UserGetsQuestion(r, q));
        }
Exemplo n.º 3
0
 public RespondentViewModel(IRespondentRepository respondentRepository)
 {
     FirstQuestion  = "Укажите ваш пол:";
     SecondQuestion = "Марка вашего телефона:";
     Respondent     = new Respondent();
     PhoneMarks     = respondentRepository.GetAllPhonesMarks();
 }
        private void btnConfirm_Click(object sender, RoutedEventArgs e)
        {
            var surveys  = stpQuestions.Children;
            int flightId = int.Parse(cbFlightId.Text);

            Respondent rsd = new Respondent()
            {
                Age        = int.Parse(cbAge.Text),
                Arrival    = Db.Context.Schedules.Find(flightId).Route.Airport1.IATACode,
                CabinType  = cbCabinType.Text,
                Gender     = rdbFemale.IsChecked.Value ? "F" : "M",
                ScheduleId = int.Parse(cbFlightId.Text),
            };

            foreach (UcSurvey item in surveys)
            {
                if (item.AnswerId == -1)
                {
                    MessageBox.Show("Please choose answer for all question!!", "Message", MessageBoxButton.OK, MessageBoxImage.Error);
                    return;
                }

                rsd.Surveys.Add(new Survey()
                {
                    AnswerId   = item.AnswerId,
                    QuestionId = item.Question.QuestionId
                });
            }

            Db.Context.Respondents.Add(rsd);
            Db.Context.SaveChanges();

            MessageBox.Show("Thank for your feedback and have a nice day!!", "Suceessful", MessageBoxButton.OK, MessageBoxImage.Information);
            this.Close();
        }
Exemplo n.º 5
0
        public static void CallCenter()
        {
            Employee dir = new Director("Brad");
            Employee man = new Manager("Jim", dir);

            dir.AddSubordinater(man);

            Employee sub1 = new Respondent("Alex", man);
            Employee sub2 = new Respondent("Ken", man);

            man.AddSubordinater(sub1);
            man.AddSubordinater(sub2);

            CallCenter callCenter = new Playground.OOD.CallCenter(new List <Employee>()
            {
                sub1, sub2
            });

            Call call = new Call();

            callCenter.TakeCall(call);
            callCenter.FinishCall(call);

            Call call2 = new Call();

            callCenter.DispatchCall(call2);
            callCenter.FinishCall(call2);
        }
Exemplo n.º 6
0
        public void RespondentFailsNoAnswer()
        {
            LinkedQuestion q = new LinkedQuestion();

            q.PreP = "Ask if AA001=1 and AA002=1.";
            List <FilterInstruction> fl = new List <FilterInstruction>();

            FilterInstruction fi = new FilterInstruction()
            {
                VarName = "AA001",
                Oper    = Operation.Equals
            };

            fi.ValuesStr.Add("1");

            FilterInstruction fi2 = new FilterInstruction()
            {
                VarName = "AA002",
                Oper    = Operation.Equals
            };

            fi.ValuesStr.Add("1");

            fl.Add(fi);
            fl.Add(fi2);

            q.FilterList.Add(fl);

            Respondent r = new Respondent();

            r.AddResponse("AA001", "1");


            Assert.IsFalse(r.RespondentSatisfiesFilter(fl));
        }
Exemplo n.º 7
0
        public void RespondentSatisfiesTwoTerm()
        {
            List <FilterInstruction> fl = new List <FilterInstruction>();

            FilterInstruction fi = new FilterInstruction()
            {
                VarName = "AA001",
                Oper    = Operation.Equals
            };

            fi.ValuesStr.Add("1");

            FilterInstruction fi2 = new FilterInstruction()
            {
                VarName = "AA002",
                Oper    = Operation.Equals
            };

            fi2.ValuesStr.Add("1");

            fl.Add(fi);
            fl.Add(fi2);



            Respondent r = new Respondent();

            r.AddResponse("AA001", "1");
            r.AddResponse("AA002", "1");

            Assert.IsTrue(r.RespondentSatisfiesFilter(fl));
        }
Exemplo n.º 8
0
        public ActionResult UpdateRespondent(RespondentViewModel item)
        {
            try
            {
                Respondent c = db.Respondents.Find(item.ToModel().Id);
                if (c != null)
                {
                    c.Id             = item.Id;
                    c.IsDeleted      = item.IsDeleted;
                    c.ModifiedDate   = DateTime.Now;
                    c.ModifiedUserId = item.ModifiedUserId;
                    c.DeletionDate   = item.DeletionDate;
                    c.DeletionUserId = item.DeletionUserId;
                    c.BrowserName    = item.BrowserName;
                    c.IPAdress       = item.IPAdress;
                    c.IsDeleted      = item.IsDeleted;
                    c.IsRegistered   = item.IsRegistered;
                    c.CreatedUserId  = item.CreatedUserId;
                    c.SurveyId       = item.SurveyId;
                    c.UserId         = item.UserId;

                    db.SaveChanges();
                }
                return(new HttpStatusCodeResult(200));
            }
            catch
            {
                return(new HttpStatusCodeResult(400));
            }
        }
Exemplo n.º 9
0
 internal static RespondentInfo FromEntity(Respondent entity) => new RespondentInfo
 {
     Id      = entity.Id,
     Name    = entity.Name,
     Email   = entity.Email.ToString(),
     Created = entity.Created
 };
Exemplo n.º 10
0
        public ActionResult Register(RegisterFormViewModel model)
        {
            //View model validation for register form
            if (ModelState.IsValid)
            {
                var respondent = new Respondent
                {
                    Date       = DateTime.Now,
                    DoB        = model.DoB,
                    FirstName  = model.FirstName,
                    LastName   = model.LastName,
                    Phone      = model.Phone,
                    IP_Address = GetIpAddress()
                };

                //Store respondent in Session
                AppSession.SetRespondent(respondent);

                //Send respondent to Survey
                return(RedirectToAction("Survey", "Survey"));
            }

            //If form invalid return respondent to register form
            return(View());
        }
Exemplo n.º 11
0
        public async Task <string> GetRespondentsConfirmationRequest()
        {
            string userName = Request.Params["user"];
            string password = Request.Params["password"];

            var user = await db.Users.Where(u => (u.UserName == userName) && (u.Password == password)).Include("Groups.Respondents").FirstOrDefaultAsync();

            string[] data = Request.Params["respondents"].Split(new char[] { '|' }, StringSplitOptions.RemoveEmptyEntries);

            for (int i = 0; i < data.Length; i++)
            {
                string[] respondentData = data[i].Split(new char[] { ';' }, StringSplitOptions.RemoveEmptyEntries);
                int      serverId       = int.Parse(respondentData[1]);
                int      clientId       = int.Parse(respondentData[0]);

                Respondent respondent = db.Respondents.First(r => r.Id == serverId);

                if (respondent.IsModified)
                {
                    respondent.ClientId        = clientId;
                    respondent.IsModified      = false;
                    db.Entry(respondent).State = EntityState.Modified;
                }
            }

            //var ans = db.Groups.Include("Quizs");

            await db.SaveChangesAsync();

            return("Ok");
        }
Exemplo n.º 12
0
        public IActionResult Survey(string Id, string[] radiovalue)
        {
            Respondent respondent = _respondentManager.GetByUsername(HttpContext.Session.GetString("SessionUsernameRespondent"));

            if (respondent == null)
            {
                return(RedirectToAction("Error", "Home"));
            }
            Survey findSurvey = _surveyManager.GetById(Id);

            if (_responseManager.CheckRespondentJoinThisSurvey(findSurvey.Id, respondent.Id) == false)
            {
                return(RedirectToAction("Error", "Home"));
            }
            if (radiovalue.Length != findSurvey.Questions.Count)
            {
                return(RedirectToAction("Error", "Home"));
            }

            Response response = new Response();

            response.Title        = findSurvey.Title;
            response.Answers      = radiovalue;
            response.SurveyId     = findSurvey.Id;
            response.RespondentId = respondent.Id;

            _responseManager.Add(response);

            TempData["MsgSuccess"] = "Your answers saved succesfully. Thanks for your join.";
            return(RedirectToAction("OpenSurveys"));
        }
Exemplo n.º 13
0
        public static Respondent CreateJP2_SH_User()
        {
            Respondent r = new Respondent();

            r.Survey      = "JP2";
            r.Description = "Smoker Current HTP User";

            r.AddResponse("BI270", "1");
            r.AddResponse("BI181", "1");
            r.AddResponse("FR225", "1");
            r.AddResponse("BI345", "1");

            r.AddResponse("QA439", "1");

            r.AddResponse("FR309v", "1");

            r.AddResponse("HN106", "1");
            r.AddResponse("HN195", "1");
            r.AddResponse("HN140", "1");

            r.AddResponse("HN309v", "1");

            r.Weight = 0.333; // 5 types
            //r.Weight = 0.363;

            return(r);
        }
Exemplo n.º 14
0
        public void SetUser(Respondent r)
        {
            User = r;
            int qnum = 0;

            foreach (Answer a in r.Responses)
            {
                var q = Questions.First(x => x.VarName.RefVarName.Equals(a.VarName));

                if (q.GetQnumValue() > StartQ)
                {
                    StartQ = q.GetQnumValue();
                }
            }
            StartQ = 0;
            //foreach(LinkedQuestion q in Questions)
            //{
            //    if (q.GetQnumValue() < qnum)
            //        QuestionsBeforeDef.Add(q);
            //}


            MaxUser = GetMaxUser(r);
            MinUser = GetMinUser(r);

            UserQuestions    = GetRespondentQuestions();
            UserQuestionsMax = GetRespondentQuestions(MaxUser);
            UserQuestionsMin = GetRespondentQuestions(MinUser);

            User.TotalMaxTime = Math.Round(GetUserBasedTiming(WPM, TimingType.Max), 2);
            User.TotalMinTime = Math.Round(GetUserBasedTiming(WPM, TimingType.Min), 2);
        }
Exemplo n.º 15
0
        public static Respondent CreateNZL3NonSmokerVaper()
        {
            Respondent r = new Respondent();

            r.Survey      = "NZL3";
            r.Description = "NonSmoker Vaper";

            r.AddResponse("FR309v", "7");

            r.AddResponse("EC309v", "1");

            r.AddResponse("Rtype", "P");
            r.AddResponse("Rsource", "2");
            //r.AddResponse("NT042", "1");
            r.AddResponse("BI203", "1");
            //r.AddResponse("NT043", "1");
            r.AddResponse("DE098", "1");
            r.AddResponse("BI350", "2");
            r.AddResponse("FR142", "1");
            // r.AddResponse("NT044", "1");
            r.AddResponse("QA437", "1");
            r.AddResponse("FR305", "2");
            r.AddResponse("FR225", "5");
            r.AddResponse("FR225v", "5");
            r.AddResponse("QA439", "5");

            return(r);
        }
Exemplo n.º 16
0
        public async Task <string> SetAnswersRequest()
        {
            string[] answersData = Request.Params["answers"].Split(new char[] { '|' }, StringSplitOptions.RemoveEmptyEntries);

            foreach (string a in answersData)
            {
                const int RESPONDENT_NUMBER = 2;

                string[] data = a.Split(new char[] { ';' }, StringSplitOptions.RemoveEmptyEntries);

                Respondent r = db.Respondents.Where(rr => rr.RespondentNumber == data[RESPONDENT_NUMBER]).Include("Answers").FirstOrDefault();

                Quiz q = await db.Quizes.Where(qq => qq.QuizNumber == data[1]).Include("Answers").FirstOrDefaultAsync();

                Answer answer = new Answer()
                {
                    AnswerText = data[3],
                    Date       = DateTime.ParseExact(data[4], "ddd MMM dd HH:mm:ss 'GMT'K yyyy", CultureInfo.InvariantCulture),
                    IsSync     = true
                };

                r.Answers.Add(answer);

                q.Answers.Add(answer);

                db.Entry(r).State = EntityState.Modified;
                db.Entry(q).State = EntityState.Modified;
            }

            return(db.SaveChanges().ToString());
        }
Exemplo n.º 17
0
        // when submit button is clicked
        protected void btnSubmit_Click(object sender, EventArgs e)
        {
            // check if all fields are filled
            if (Page.IsValid)
            {
                // retrieve a list of respondent from current session
                List <Respondent> respondentList = (List <Respondent>)Session["respondentList"];

                // if there is no respondent list in the session
                if (respondentList == null)
                {
                    // create a respondent list
                    respondentList = new List <Respondent>();

                    // save the list to the current session
                    Session["respondentList"] = respondentList;
                }

                // generate a new respondent based on user inputs
                Respondent respondent = new Respondent
                {
                    RespondentFirstName = txtFirstName.Text,
                    RespondentLastName  = txtLastName.Text,
                    RespondentEmail     = txtEmail.Text,
                    RespondentPhone     = txtPhone.Text,
                    RespondentDOB       = txtDOB.Text,
                };

                // add the respondent to the list
                respondentList.Add(respondent);

                // insert respondent into database
                DbUtilities.InsertRespondent(respondent);
            }
        }
Exemplo n.º 18
0
        public RespondentAddResponse RespondentAdd([FromBody] RespondentAddRequest request)
        {
            using var db = new DbModel();
            Respondent respondent1 = new Respondent()
            {
                ContactId       = request.ContactId,
                QuestionnaireId = request.QuestionnaireId
            };

            db.Respondents.Add(respondent1);
            db.SaveChanges();

            var respondent = db.Respondents
                             .FirstOrDefault(b => b.RespondentId == respondent1.RespondentId &&
                                             b.QuestionnaireId == respondent1.QuestionnaireId);

            if (respondent != null)
            {
                return(new RespondentAddResponse()
                {
                    Response = "Respondent Added",
                    RespondentID = respondent.RespondentId
                });
            }
            else
            {
                return(new RespondentAddResponse()
                {
                    Response = "Respondent not added",
                    RespondentID = 0
                });
            }
        }
Exemplo n.º 19
0
        public async Task <IActionResult> PutRespondent([FromRoute] int id, [FromBody] Respondent respondent)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            if (id != respondent.Id)
            {
                return(BadRequest());
            }

            _context.Entry(respondent).State = EntityState.Modified;

            try
            {
                await _context.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!SurveyExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(NoContent());
        }
        public void _7_1_CallCenter_WithManagableIncomingCalls_ShouldEscalateCallsSuccessfully()
        {
            //Arrange
            List <Employee> employees  = new List <Employee>();
            Employee        respondent = new Respondent();
            Employee        manager    = new Manager();
            Employee        director   = new Director();

            employees.Add(respondent);
            employees.Add(manager);
            employees.Add(director);

            List <Call> incomingCalls = new List <Call>();
            Call        call1         = new Call("Billy", "123-1232");
            Call        call2         = new Call("Bob", "123-1233");
            Call        call3         = new Call("Jim", "123-1234");

            incomingCalls.Add(call1);
            incomingCalls.Add(call2);
            incomingCalls.Add(call3);

            //Act
            CallCenter testCallCenter = new CallCenter(employees);

            foreach (Call call in incomingCalls)
            {
                testCallCenter.DispatchCall(call);
            }

            //Assert
            foreach (Call call in incomingCalls)
            {
                Assert.AreEqual(true, call.IsCompleted);
            }
        }
Exemplo n.º 21
0
        public ActionResult SelectVote(string token, int answerId)
        {
            Respondent respondent = Db.Respondents.Where(r => r.Token.Equals(token)).FirstOrDefault();

            if (respondent == null)
            {
                return(HttpNotFound());
            }

            if (respondent.HasVoted)
            {
                return(RedirectToAction("AnonymousResults", new { token }));
            }

            Answer answer = respondent.Poll.Answers.Where(a => a.AnswerId == answerId).FirstOrDefault();

            if (answer == null)
            {
                return(HttpNotFound());
            }

            respondent.HasVoted = true;
            answer.Responses.Add(new Response
            {
                AnswerId = answer.AnswerId
            });
            Db.SaveChanges();
            return(RedirectToAction("AnonymousResults", new { token }));
        }
Exemplo n.º 22
0
        public static Respondent CreateBlankRespondent()
        {
            Respondent r = new Respondent();

            r.Survey      = "";
            r.Description = "Blank Respondent";

            return(r);
        }
Exemplo n.º 23
0
        public static Respondent CreateSpanishRespondent()
        {
            Respondent r = new Respondent();

            r.Survey      = "6E2";
            r.Description = "Spanish Respondent";
            r.AddResponse("BI101", "6", false);
            return(r);
        }
Exemplo n.º 24
0
        private void cmdOK_Click(object sender, EventArgs e)
        {
            user1 = (Respondent)cboUser1.SelectedItem;
            user2 = (Respondent)cboUser2.SelectedItem;

            user1Path    = (TimingType)cboUser1Path.SelectedItem;
            user2Path    = (TimingType)cboUser2Path.SelectedItem;
            DialogResult = DialogResult.OK;
            Close();
        }
Exemplo n.º 25
0
        protected void Page_Load(object sender, EventArgs e)
        {
            try
            {
                ErrorMessageLabel.Text      = "";
                ErrorMessageLabel.ForeColor = System.Drawing.Color.Black;
                SurveyLogicControl surveyLogicControl = new SurveyLogicControl();
                Question           question           = new Question();
                int currentQuestionSequence           = 0;

                if (string.IsNullOrEmpty(SessionControlUtil.getUserIPAddress()))
                {
                    string userIPAddress = AppUtil.getUserIPAddress();

                    if (!string.IsNullOrEmpty(userIPAddress))
                    {
                        Respondent respondent = new Respondent();
                        respondent.IpAddress = userIPAddress;
                        int userID = surveyLogicControl.insertRespondent(respondent);
                        SessionControlUtil.setUserID(userID);
                        SessionControlUtil.setUserIPAddress(userIPAddress);
                    }

                    // First time.
                    // Get the first question and set the session attributes control
                    question = surveyLogicControl.getNextQuestionBySequence(currentQuestionSequence);
                    SessionControlUtil.setCurrentQuestion(question);
                    SessionControlUtil.setCurrentQuestionSequence(question.QuestionSequence);
                    SessionControlUtil.incrementCurrentQuestionLevel();
                    HttpContext.Current.Session[AppConstants.sessionQuestionsAnswerList] = new List <SurveyQuestionAnswer>();
                }
                else
                {
                    question = SessionControlUtil.getCurrentQuestion();
                }

                this.displayQuestion(question);
            }
            catch (Exception ex)
            {
                /* IMPORTANT !!
                 * // No matter what was the error, user can not start, continue or
                 * // finalize the pageSurvey. So:
                 * // - A log (simulation) with the exception was done on the place that have occurred
                 * // - The exception comes till the final layer, shows a generic error to the user
                 * // - Insert more information on the log (simulation)
                 * */
                ErrorMessageLabel.Text      = AppConstants.errorSystemError;
                ErrorMessageLabel.ForeColor = System.Drawing.Color.Red;

                //Error log simulated
                Console.WriteLine(ex.ToString());
                Console.WriteLine(ex.GetBaseException().ToString());
            }
        }
Exemplo n.º 26
0
        private void SaveUserTypes()
        {
            Respondent r = UserTypeDefs.Create6E2UT1();

            File.WriteAllText(folderPath + "6E2 User type 1.xml", r.SaveToXML());
            r = UserTypeDefs.Create6E2UT2();
            File.WriteAllText(folderPath + "6E2 User type 2.xml", r.SaveToXML());
            r = UserTypeDefs.Create6E2UT3();
            File.WriteAllText(folderPath + "6E2 User type 3.xml", r.SaveToXML());
            r = UserTypeDefs.Create6E2UT4();
            File.WriteAllText(folderPath + "6E2 User type 4.xml", r.SaveToXML());
            r = UserTypeDefs.CreateESUT1();
            File.WriteAllText(folderPath + "ES2.5 User type 1.xml", r.SaveToXML());
            r = UserTypeDefs.CreateESUT2();
            File.WriteAllText(folderPath + "ES2.5 User type 2.xml", r.SaveToXML());
            r = UserTypeDefs.CreateESUT3();
            File.WriteAllText(folderPath + "ES2.5 User type 3.xml", r.SaveToXML());
            r = UserTypeDefs.CreateESUT4();
            File.WriteAllText(folderPath + "ES2.5 User type 4.xml", r.SaveToXML());

            r = UserTypeDefs.CreateJP3_NSH_User();
            File.WriteAllText(folderPath + "JP3 Nonsmoker HTP User.xml", r.SaveToXML());
            r = UserTypeDefs.CreateJP3_NSNH_User();
            File.WriteAllText(folderPath + "JP3 Nonsmoker NonHTP User.xml", r.SaveToXML());
            r = UserTypeDefs.CreateJP3_NSNH_User();
            File.WriteAllText(folderPath + "JP3 Nonsmoker NonHTP User.xml", r.SaveToXML());
            r = UserTypeDefs.CreateJP3_SH_User();
            File.WriteAllText(folderPath + "JP3 Smoker HTP User.xml", r.SaveToXML());
            r = UserTypeDefs.CreateJP3_SNH_User();
            File.WriteAllText(folderPath + "JP3 Smoker NonHTP User.xml", r.SaveToXML());
            r = UserTypeDefs.CreateJP3_XSH_User();
            File.WriteAllText(folderPath + "JP3 ExSmoker HTP User.xml", r.SaveToXML());

            r = UserTypeDefs.CreateJP2_NSH_User();
            File.WriteAllText(folderPath + "JP2 Nonsmoker HTP User.xml", r.SaveToXML());
            r = UserTypeDefs.CreateJP2_NSNH_User();
            File.WriteAllText(folderPath + "JP2 Nonsmoker NonHTP User.xml", r.SaveToXML());
            r = UserTypeDefs.CreateJP2_NSNH_User();
            File.WriteAllText(folderPath + "JP2 Nonsmoker NonHTP User.xml", r.SaveToXML());
            r = UserTypeDefs.CreateJP2_SH_User();
            File.WriteAllText(folderPath + "JP2 Smoker HTP User.xml", r.SaveToXML());
            r = UserTypeDefs.CreateJP2_SNH_User();
            File.WriteAllText(folderPath + "JP2 Smoker NonHTP User.xml", r.SaveToXML());
            r = UserTypeDefs.CreateJP2_XSH_User();
            File.WriteAllText(folderPath + "JP2 ExSmoker HTP User.xml", r.SaveToXML());

            r = UserTypeDefs.CreateNLD2_UT1();
            File.WriteAllText(folderPath + "NLD2 UT1.xml", r.SaveToXML());
            r = UserTypeDefs.CreateNLD2_UT2();
            File.WriteAllText(folderPath + "NLD2 UT2.xml", r.SaveToXML());
            r = UserTypeDefs.CreateNLD2_UT3();
            File.WriteAllText(folderPath + "NLD2 UT3.xml", r.SaveToXML());
            r = UserTypeDefs.CreateNLD2_UT4();
            File.WriteAllText(folderPath + "NLD2 UT4.xml", r.SaveToXML());
        }
Exemplo n.º 27
0
 public bool Login(Respondent model)
 {
     if (this.GetAll().Where(x => x.Username == model.Username && x.Password == model.Password).Count() == 1)
     {
         return(true);
     }
     else
     {
         return(false);
     }
 }
Exemplo n.º 28
0
        public static Respondent CreateMYS1UT3()
        {
            Respondent r = new Respondent();

            r.Survey      = "MYS1";
            r.Description = "Non-smoker";
            r.AddResponse("FR225", "6");
            r.AddResponse("FR309v", "9");
            r.AddResponse("FR305", "2");
            return(r);
        }
        //GET: Groups/CreateRespondent/1
        public ActionResult CreateRespondent(int id)
        {
            ViewBag.GroupId = id;
            var respondent = new Respondent()
            {
                RespondentNumber = NumberGenerator.GetRespondentNumber(db.Users.Where(u => u.UserName == User.Identity.Name).FirstOrDefault()),
                IsModified       = true
            };

            return(View(respondent));
        }
Exemplo n.º 30
0
        public static Respondent CreateKRA1_HN()
        {
            Respondent r = new Respondent();

            r.Survey      = "KRA1";
            r.Description = "HTP User only";

            r.AddResponse("FR309v", "09");
            r.AddResponse("EC309v", "06");
            r.AddResponse("HN309v", "01");
            return(r);
        }