private static bool ConfirmData(string Name, Race race, Stats stats) { string Ans; while (true) { Console.WriteLine("Name: {0}", Name); Console.WriteLine("Race: {0}", StringModify.FirstToUpper(race.race)); Console.WriteLine("Strength: {0}", stats.Strength); Console.WriteLine("Ability: {0}", stats.Ability); Console.WriteLine("Resistance: {0}", stats.Resistance); Console.WriteLine("Armor: {0}", stats.Armor); Console.WriteLine("Firepower: {0}\n", stats.Firepower); Console.WriteLine("Done?"); Console.WriteLine("1. Yes"); Console.WriteLine("2. No"); Ans = Console.ReadLine(); Ans = YesNoInput.Parse(Ans); if (Ans.Equals("yes")) { return(true); } else if (Ans.Equals("no")) { return(false); } else { Console.Clear(); Console.WriteLine("Invalid command\n"); } } }
void OnTriggerExit(Collider AnswerPlayer) { foreach (var Ans in AnswerData) { if (BallHoldNumber.BallScore == 1 && this.gameObject.name == "Player1" && AnswerPlayer.tag == "ball" || BallHoldNumber.BallScore == 2 && this.gameObject.name == "Player2" && AnswerPlayer.tag == "ball" || BallHoldNumber.BallScore == 3 && this.gameObject.name == "Player3" && AnswerPlayer.tag == "ball") { Ans.BallExit(); break; } if ((this.gameObject.tag == "BlueArea" && AnswerPlayer.tag == "BlueAnswer") || (this.gameObject.tag == "RedArea" && AnswerPlayer.tag == "RedAnswer")) { if (AnswerPlayer.name == Ans.getName() && AnswerPlayer.tag != "RedArea" && AnswerPlayer.tag != "BlueArea") { AnsState--; if (AnsState == 0) { Ans.PlayerExit(); } Debug.Log(AnsState); break; } } } }
private void Start_Click(object sender, EventArgs e) { if (IsFirstRound) { Ans.Visible = true; //点击开始答题按钮后显示答题文本框 Start.Visible = false; label2.Visible = false; Submit.Visible = true; History.Visible = true; ques.Visible = true; Timer.Visible = true; ggrade.Visible = true; Quit.Visible = true; ggrade.Text = "Grade: " + grade.ToString(); timer1.Start(); } Ans.Focus(); for (int i = 0; i < 1; i++) { save = Generate.BuildExp(3); Generate.PrintExp(); cnt++; ques.Text = Generate.strsave; int len = ques.Width; int flen = this.Width; int x = (flen - len) / 2; int y = 100; ques.Location = new Point(x, y); } }
//Вывод ответа public string PrintAnswer() { string s = null; Answer Ans = null; for (int i = 0; i < 4; i++) { if (i == 0) { Ans = new AnswerByKondorse(ListAlt, ListVote, CandidateCount); } if (i == 1) { Ans = new AnswerByCopeland(ListAlt, ListVote, CandidateCount); } if (i == 2) { Ans = new AnswerBySimpson(ListAlt, ListVote, CandidateCount); } if (i == 3) { Ans = new AnswerByBord(ListAlt, ListVote, CandidateCount); } s += Ans.GetAnswer(); } return(s); }
//答案區 private void Guess_btu_Click(object sender, EventArgs e) { if (textBox4.Text == "") { return; } if (listBox1.SelectedIndex < 0) { if (Ans.Equals(textBox4.Text)) { user_scro += this.progressBar1.Value / 10; Send("M" + Netname + ": Hit"); Send("S" + Netname + ":" + user_scro + "分"); textBox4.Enabled = false; Guess_btu.Enabled = false; SoundPlayer sound = new SoundPlayer { SoundLocation = Application.StartupPath + @"//Ans.wav" }; sound.Play(); } else { Send("M" + Netname + ":" + textBox4.Text); } } textBox4.Text = ""; }
//聊天室chat private void Chat_btu_Click(object sender, EventArgs e) { if (textBox3.Text == "") { return; } if (listBox1.SelectedIndex < 0) { if (Ans.Equals(textBox3.Text)) { Send("D" + " 系統 : 禁止傳解答!!"); } else { Send("D" + Netname + ":" + textBox3.Text); } } else { string[] str = listBox1.Text.Split(':'); Send("3" + "來自" + Netname + ": " + textBox3.Text + "|" + str[0]); textBox1.Text += "私密" + str[0] + ": " + textBox3.Text + "\r\n"; } textBox3.Text = ""; //清除發言框 }
public void TestMethod3() {//测试输入答案的格式不正确的识别情况 Build build = new Build(); build.Expr[0] = 1; build.Expr[1] = 101; build.Expr[2] = 7; build.Expr[3] = 102; build.Expr[4] = 6; build.Expr[5] = 103; build.Expr[6] = 3; build.Expr[7] = 104; build.Expr[8] = 2; build.flag = 9; build.p = 9; //表达式是1+7-6*3/2 build.TurnToHou(); BinaryTree tree; tree = build.createtree(); //将后缀表达式转换为二叉树 tree.preordercalc(tree.getroot()); //计算最终的结果并存在根节点 Ans ans = new Ans(); tree.getroot().value.Reduction(); MyNumber correctAnswer = tree.getroot().value;//这里保存了计算出来的答案 int ansflag = ans.GetResult(correctAnswer, "-1’"); Assert.AreEqual(2, ansflag); }
public void TestMethod2() {//测试括号和乘方的计算正确性 Build build = new Build(); build.Expr[0] = 1; build.Expr[1] = 101; build.Expr[2] = 106; build.Expr[3] = 7; build.Expr[4] = 102; build.Expr[5] = 6; build.Expr[6] = 107; build.Expr[7] = 105; build.Expr[8] = 3; build.Expr[9] = 104; build.Expr[10] = 2; build.flag = 11; build.p = 11; //表达式是1+(7-6)^3/2 build.TurnToHou(); BinaryTree tree; tree = build.createtree(); //将后缀表达式转换为二叉树 tree.preordercalc(tree.getroot()); //计算最终的结果并存在根节点 Ans ans = new Ans(); tree.getroot().value.Reduction(); MyNumber correctAnswer = tree.getroot().value;//这里保存了计算出来的答案 int ansflag = ans.GetResult(correctAnswer, "3/2"); Assert.AreEqual(1, ansflag); }
public ActionResult DeleteConfirmed(int id) { Ans ans = db.Anss.Find(id); db.Anss.Remove(ans); db.SaveChanges(); return(RedirectToAction("Index")); }
static void Main(string[] arg) { Ans a1 = new Ans(Delegate.add), a2 = new Ans(Delegate.mul), a3; a1(2); a2(3); a3 = a1 + a2; a3(4); }
public ActionResult Edit([Bind(Include = "ID,ans")] Ans ans) { if (ModelState.IsValid) { db.Entry(ans).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(ans)); }
public ActionResult Create([Bind(Include = "ID,ans")] Ans ans) { if (ModelState.IsValid) { db.Anss.Add(ans); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(ans)); }
public void Answer(Ans answer) { string messageID; if (string.IsNullOrEmpty(answer.ParentID)) { messageID = this.LastMessageID(); } else { messageID = answer.ParentID; } this.Messages.Add(new Message { Sender = Sender.Player, Name = answer.Name, }); if (answer.Exclusive) { this.ActiveAnswers.Clear(); } else { this.ActiveAnswers.Remove(answer); } this.WaitForAnswer.Value = false; if (messageID != null) { Command <string> callback; this.answerCallbacks.TryGetValue(messageID, out callback); if (callback != null) { callback.Execute(answer.Name); } Command cmd; this.visitCallbacks.TryGetValue(answer.Name, out cmd); if (cmd != null) { cmd.Execute(); } DialogueForest.Node selectedChoice = this.forest[answer.ID]; if (selectedChoice != null) { DialogueForest.Node next = selectedChoice.next != null ? forest[selectedChoice.next] : null; if (next != null) { this.execute(next); } } } }
// GET: Ans/Delete/5 public ActionResult Delete(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } Ans ans = db.Anss.Find(id); if (ans == null) { return(HttpNotFound()); } return(View(ans)); }
private void FindAns(int k, int s) { if (A[k, s] == 0) { return; } if (A[k - 1, s] == A[k, s]) { FindAns(k - 1, s); } else { FindAns(k - 1, s - Items[k - 1].Weight); Ans.Add(Items[k - 1]); MaxValue += Items[k - 1].Value; } }
public void MakeQuiz() { if (Mode > 0.5) { firstNum = r1.Next(100, 500); secndNum = r2.Next(100, 500); } else { firstNum = r1.Next(10, 50) * 10; secndNum = r2.Next(10, 50) * 10; } correctAnswer = firstNum + secndNum; Quiz.Content = firstNum.ToString() + "+" + secndNum.ToString() + "=?"; totalQuiz++; Ans.Clear(); }
private void Submit_Click(object sender, EventArgs e) { if (Ans.Text == "") { Ans.Focus(); return; } Judge ans = new Judge(); Num correct_ans = solve.get_ans(save, Generate.p); int ansflag = ans.judge(correct_ans, this.Ans.Text); correct_ans_str = correct_ans.c_Tostring(); timu = Generate.C_Tostring(); f3.History_Add(timu, correct_ans_str); if (ansflag == 1) { timer1.Stop(); MessageBox.Show("Bingo!"); timer1.Start(); grade += 1; correct_cnt++; ggrade.Text = "Grade: " + grade.ToString(); Start_Click(null, null); this.Ans.Text = ""; totaltime = 20; } else if (ansflag == 0) { timer1.Stop(); MessageBox.Show("Wrong!\n" + "Correct Answer:" + correct_ans_str); timer1.Start(); Start_Click(null, null); this.Ans.Text = ""; totaltime = 20; } else { timer1.Stop(); MessageBox.Show("Error:Please input the correct form!"); timer1.Start(); this.Ans.Text = ""; this.Ans.Focus(); } f3.Correct_Rate(correct_cnt, cnt - 1); }
static void Main() { string Ans; Completed: Console.WriteLine("\nHeyo! Welcome to the mUtil multi-tool. Press a matching key to use a utility function."); Console.WriteLine("A. Number System Converter\nB. MD5 String hashing\nC. Base64 Encoding/Decoding\nD. Check for internet connection\nE. Random Password Generator\nF. Logic Operators\nQ. Quit."); errorcheck: Ans = Console.ReadLine(); if (string.IsNullOrWhiteSpace(Ans)) { goto errorcheck; } switch (Ans.ToUpper()) { case "A": NumberSysConv(); break; case "B": MD5Hash(); break; case "C": base64(); break; case "D": Console.WriteLine(InternetCon()); break; case "E": PassManager(); break; case "F": BooleanLogic(); break; case "Q": Environment.Exit(1); break; default: goto errorcheck; } goto Completed; }
//答案區 private void MetroButton2_Click(object sender, EventArgs e) { if (TextBox8.Text == "") { return; } if (listBox1.SelectedIndex < 0) { if (Ans.Equals(TextBox8.Text)) { Send("M" + User + ": Hit"); user_scro += this.metroProgressBar1.Value / 3; Send("S" + User + ":" + user_scro); } else { Send("M" + User + ":" + TextBox8.Text); } } TextBox8.Text = ""; }
//聊天室 private void MetroButton1_Click(object sender, EventArgs e) { if (TextBox6.Text == "") { return; } if (listBox1.SelectedIndex < 0) { if (Ans.Equals(TextBox6.Text)) { Send("D" + " 系統 : 禁止傳解答!!"); } else { Send("D" + User + ":" + TextBox6.Text); } } else { Send("3" + "來自" + User + ": " + TextBox6.Text + "|" + listBox1.SelectedItem); TextBox5.Text += "私密" + listBox1.SelectedItem + ": " + TextBox6.Text + "\r\n"; } TextBox6.Text = ""; //清除發言框 }
public static Stats ChooseStats() { int MaxPoints = 7; int RemainingPoints = MaxPoints; int Step = 0; string State = "", CurTop; string Num, Ans; int Strength = 0, Ability = 0, Resistance = 0, Armor = 0, Firepower = 0; Console.Clear(); CurTop = "It is now time for you to determine the numbers of your characteristics.\nYou have a total of 7 points to spend on 5 different characteristics.\n\n"; CurTop += Descriptor.Strength; while (true) { Console.Clear(); CharacterCreator.PrintState(State, CurTop, RemainingPoints); if (Step == 0) { Console.Write("Strength: "); Num = Console.ReadLine(); if (Num.Equals("") || !CharacterCreator.IsNum(Num) || Int32.Parse(Num) > RemainingPoints) { Console.Clear(); CurTop = "Invalid value"; } else { int Value = Int32.Parse(Num); Step++; State += "Strength: " + Num + "\n"; Strength = Value; RemainingPoints -= Value; CurTop = Descriptor.Ability; } } else if (Step == 1) { Console.Write("Ability: "); Num = Console.ReadLine(); if (Num.Equals("") || !CharacterCreator.IsNum(Num) || Int32.Parse(Num) > RemainingPoints) { Console.Clear(); CurTop = "Invalid value"; } else { int Value = Int32.Parse(Num); Step++; State += "Ability: " + Num + "\n"; Ability = Value; RemainingPoints -= Value; CurTop = Descriptor.Resistance; } } else if (Step == 2) { Console.Write("Resistance: "); Num = Console.ReadLine(); if (Num.Equals("") || !CharacterCreator.IsNum(Num) || Int32.Parse(Num) > RemainingPoints) { Console.Clear(); CurTop = "Invalid value"; } else { int Value = Int32.Parse(Num); Step++; State += "Resistance: " + Num + "\n"; Resistance = Value; RemainingPoints -= Value; CurTop = Descriptor.Armor; } } else if (Step == 3) { Console.Write("Armor: "); Num = Console.ReadLine(); if (Num.Equals("") || !CharacterCreator.IsNum(Num) || Int32.Parse(Num) > RemainingPoints) { Console.Clear(); CurTop = "Invalid value"; } else { int Value = Int32.Parse(Num); Step++; State += "Armor: " + Num + "\n"; Armor = Value; RemainingPoints -= Value; CurTop = Descriptor.Firepower; } } else if (Step == 4) { Console.Write("Firepower: "); Num = Console.ReadLine(); if (Num.Equals("") || !CharacterCreator.IsNum(Num) || Int32.Parse(Num) > RemainingPoints) { Console.Clear(); CurTop = "Invalid value"; } else { int Value = Int32.Parse(Num); Step++; State += "Firepower: " + Num + "\n"; Firepower = Value; RemainingPoints -= Value; } } else if (Step == 5) { if (RemainingPoints > 0) { Console.WriteLine("\nYou still have {0} unspent point{1}", RemainingPoints, (RemainingPoints > 1 ? "s" : "")); while (true) { Console.WriteLine("Do you wish to reset your points?"); Console.WriteLine("1. Yes"); Console.WriteLine("2. No"); Ans = Console.ReadLine(); Ans = YesNoInput.Parse(Ans); if (Ans.Equals("yes")) { RemainingPoints = MaxPoints; Step = 0; State = ""; break; } else if (Ans.Equals("no")) { return(new Stats(Strength, Firepower, Resistance, Armor, Ability)); } else { Console.WriteLine("Invalid command\n"); } } } else { return(new Stats(Strength, Firepower, Resistance, Armor, Ability)); } } } }
public int SetSaveSlot() { string Num; int Value = 0; string Data = ""; Console.Clear(); while (true) { Console.WriteLine("Which slot do you want to save in? (Type ENTER on empty slot to return)"); for (int i = 1; i <= this.SlotsNum; i++) { string SlotFile = String.Join("", "./GameData/Save/slot", i, ".sav"); Console.Write("> {0}", i); if (!File.Exists(SlotFile)) { Console.Write(" - Empty\n"); } else { if (LoadSlotData(i, ref Data)) { Console.Write(" - {0}\n", Data); } else { Console.Write(" - Empty\n"); } } } Num = Console.ReadLine(); if (Num.Equals("")) { return(-1); } try { Value = Int32.Parse(Num); } catch (FormatException) { Console.Clear(); Console.WriteLine("Invalid slot number\n"); continue; } if (Value < 1 || Value > 20) { Console.Clear(); Console.WriteLine("Invalid slot number\n"); continue; } if (this.SlotState[Value].Equals("empty")) { this.SlotState[Value] = "full"; this.CurrentSlot = Value; return(Value); } else { Console.Clear(); string Ans; while (true) { Console.WriteLine("This slot is already full"); Console.WriteLine("Do you wish to overwrite it?"); Console.WriteLine("1. Yes"); Console.WriteLine("2. No"); Ans = Console.ReadLine(); Ans = YesNoInput.Parse(Ans); if (Ans.Equals("yes")) { this.SlotState[Value] = "full"; this.CurrentSlot = Value; return(Value); } else if (Ans.Equals("no")) { Console.Clear(); break; } else { Console.Clear(); Console.WriteLine("Invalid command\n"); } } } } }
public ActionResult profile(UserData user, UserEdit usersEdit, string JsonQuestionsAns) { if (Session["Token"] != null) { string Token = Session["Token"].ToString(); var UserLogin = from a in db.Users where a.Token == Token select a; if (UserLogin == null) { return(RedirectToAction("Login", "UserPanel")); } } else if (Session["Token"] == null) { return(RedirectToAction("Login", "UserPanel")); } if (ModelState.IsValid) { string UserEditToken = Guid.NewGuid().ToString(); UserData userData = new UserData(); userData.AllergicFoods = user.AllergicFoods; userData.Birthday = user.Birthday; userData.DissLikeFoods = user.DissLikeFoods; userData.DrugHistory = user.DrugHistory; userData.FoodsLike = user.FoodsLike; userData.Height = user.Height; if (!user.IsMan) { userData.IsMan = false; } else { userData.IsMan = true; } if (!user.IsVegetarian) { userData.IsVegetarian = false; } else { userData.IsVegetarian = true; } userData.Job = user.Job; userData.SurgeryHistory = user.SurgeryHistory; userData.Waist = user.Waist; userData.Weight = user.Weight; userData.Wrist = user.Wrist; userData.IllnessRelatives = user.IllnessRelatives; userData.HasDigestiveProblem = user.HasDigestiveProblem; userData.PhysicalActivity = user.PhysicalActivity; string userdataJson = JsonConvert.SerializeObject(userData); string Token = Session["Token"].ToString(); var User = (from a in db.Users where a.Token == Token select a).SingleOrDefault(); int UserID = User.ID; var UesrSEdit = new UserEdit(); usersEdit.UsersID = UserID; UesrSEdit.UsersID = usersEdit.UsersID; usersEdit.UsersEditData = userdataJson; UesrSEdit.UsersEditData = usersEdit.UsersEditData; usersEdit.Token = UserEditToken; db.UserEdits.Add(usersEdit); if (JsonQuestionsAns.Length != 0) { List <Ans> MyAns = new List <Ans>(); var Answers = JsonConvert.DeserializeObject <Dictionary <string, string> >(JsonQuestionsAns); foreach (var item in Answers) { string Key = item.Key.Replace("Answer_", ""); Ans A = new Ans(); A.ID = Key; A.Value = item.Value; Answer Answ = new Answer(); Answ.DiseaseQuestionsID = int.Parse(Key); Answ.UserID = UserID; Answ.AnswerText = item.Value; Answ.Token = UserEditToken; db.Answers.Add(Answ); MyAns.Add(A); } } db.SaveChanges(); return(RedirectToAction("profile", "UserPanel")); } return(View()); }
private int GetMaxValue() { return(Ans.Sum(item => item.Value)); }
//public ActionResult ShowTest(int acid) public ActionResult MCQ_User(int acid) { objLoginUserDetails = (LoginUserDetails)InsiderTrading.Common.Common.GetSessionValue((string)ConstEnum.SessionValue.UserDetails); MCQModel objMCQSettingsModel = new MCQModel(); objMCQSettingsModel.objMCQQuestionModel = new MCQQuestionModel(); objMCQSettingsModel.objMCQUserValidationModel = new MCQUserValidationModel(); MCQ_QUESTION_DTO objMCQ_QUESTION_DTO = new MCQ_QUESTION_DTO(); List <MCQ_QUESTION_DTO> objMCQ_QUESTION_DTOList = new List <MCQ_QUESTION_DTO>(); bool MCQStatus = false; MCQDTO objMCQ_DTO = new MCQDTO(); objMCQ_DTO.UserInfoID = objLoginUserDetails.LoggedInUserID; objMCQ_DTO.MCQPerioEndDate = null; using (var objMCQSL = new MCQSL()) { objMCQ_QUESTION_DTOList = objMCQSL.GetMCQQuestionDetailsList(objLoginUserDetails.CompanyDBConnectionString, null, "SELECT_MCQ_QUESTIONS", out msg).ToList(); } using (var objMCQSL = new MCQSL()) { objMCQ_QUESTION_DTO = objMCQSL.GetMCQQuestionDetails(objLoginUserDetails.CompanyDBConnectionString, 0, "ValidateUserSettings", out msg, objLoginUserDetails.LoggedInUserID); objMCQSettingsModel.objMCQUserValidationModel.AttemptNos = objMCQ_QUESTION_DTO.AttemptNo; objMCQSettingsModel.objMCQUserValidationModel.FrequencyOfMCQs = objMCQ_QUESTION_DTO.FrequencyOfMCQs; objMCQSettingsModel.objMCQUserValidationModel.CorrectAnswer = Convert.ToInt16(objMCQ_QUESTION_DTO.CorrectAnswer); objMCQSettingsModel.objMCQUserValidationModel.FalseAnswer = objMCQ_QUESTION_DTO.FalseAnswer; objMCQSettingsModel.objMCQUserValidationModel.ResultDuringFrequency = objMCQ_QUESTION_DTO.ResultDuringFrequency.Trim(); objMCQSettingsModel.objMCQUserValidationModel.TotalAttempts = objMCQ_QUESTION_DTO.TotalAttempts; objMCQSettingsModel.objMCQUserValidationModel.UserMessage = objMCQ_QUESTION_DTO.UserMessage; objMCQSettingsModel.objMCQUserValidationModel.AttemptMessage = objMCQ_QUESTION_DTO.AttemptMessage; objMCQSettingsModel.objMCQUserValidationModel.IsBlocked = objMCQ_QUESTION_DTO.IsBlocked; if (objMCQ_QUESTION_DTO.TotalAttempts < objMCQ_QUESTION_DTO.AttemptNo) { if (objMCQ_QUESTION_DTO.BlockuserAfterExceedAtempts && objMCQ_QUESTION_DTO.IsBlocked) { ViewBag.UserMessage = objMCQ_QUESTION_DTO.BlockedUserMessage; } else { MCQStatus = true; objMCQ_DTO.MCQStatus = MCQStatus; objMCQ_DTO = objMCQSL.InsertUpdateMCQUserStatus(objLoginUserDetails.CompanyDBConnectionString, objMCQ_DTO); return(RedirectToAction("Index", "InsiderDashboard", new { acid = Common.ConstEnum.UserActions.DASHBOARD_INSIDERUSER })); } } else if (!objMCQ_QUESTION_DTO.BlockUserAfterDuration && !objMCQ_QUESTION_DTO.IsBlocked && !objMCQ_QUESTION_DTO.FirstTimeLogin && objMCQ_QUESTION_DTO.FrequencyOfMCQs == "False") { MCQStatus = true; objMCQ_DTO.MCQStatus = MCQStatus; objMCQ_DTO = objMCQSL.InsertUpdateMCQUserStatus(objLoginUserDetails.CompanyDBConnectionString, objMCQ_DTO); return(RedirectToAction("Index", "InsiderDashboard", new { acid = Common.ConstEnum.UserActions.DASHBOARD_INSIDERUSER })); } else if (!objMCQ_QUESTION_DTO.BlockuserAfterExceedAtempts && !objMCQ_QUESTION_DTO.IsBlocked && !objMCQ_QUESTION_DTO.FirstTimeLogin && objMCQ_QUESTION_DTO.FrequencyOfMCQs == "False") { MCQStatus = true; objMCQ_DTO.MCQStatus = MCQStatus; objMCQ_DTO = objMCQSL.InsertUpdateMCQUserStatus(objLoginUserDetails.CompanyDBConnectionString, objMCQ_DTO); return(RedirectToAction("Index", "InsiderDashboard", new { acid = Common.ConstEnum.UserActions.DASHBOARD_INSIDERUSER })); } else if (objMCQ_QUESTION_DTO.BlockUserAfterDuration && objMCQ_QUESTION_DTO.IsBlocked && objMCQ_QUESTION_DTO.FirstTimeLogin && objMCQ_QUESTION_DTO.FrequencyOfMCQs != "False") { ViewBag.UserMessage = objMCQ_QUESTION_DTO.BlockedUserMessage; } else { ViewBag.UserMessage = objMCQ_QUESTION_DTO.AttemptMessage + " " + objMCQ_QUESTION_DTO.UserMessage; } ViewBag.AttemptMessage = objMCQ_QUESTION_DTO.AttemptMessage; if (objMCQ_QUESTION_DTO.FrequencyOfMCQs == "False" && objMCQ_QUESTION_DTO.ResultDuringFrequency.Trim() != "522002") { ViewBag.UserMessage = objMCQ_QUESTION_DTO.AttemptMessage + " " + objMCQ_QUESTION_DTO.BlockedUserMessage; } if (objMCQ_QUESTION_DTO.ResultDuringFrequency.Trim() == "522002") { MCQStatus = true; objMCQ_DTO.MCQStatus = MCQStatus; objMCQ_DTO = objMCQSL.InsertUpdateMCQUserStatus(objLoginUserDetails.CompanyDBConnectionString, objMCQ_DTO); return(RedirectToAction("Index", "InsiderDashboard", new { acid = Common.ConstEnum.UserActions.DASHBOARD_INSIDERUSER })); } } ViewBag.AttemptNo = objMCQ_QUESTION_DTO.AttemptNo; objMCQSettingsModel.objMCQModelList = new List <MCQModel>(); for (int i = 0; i < objMCQ_QUESTION_DTOList.Count; i++) { MCQModel objMCQModel = new MCQModel(); objMCQModel.Question = objMCQ_QUESTION_DTOList[i].Question; objMCQModel.Answer_Type = Convert.ToString(objMCQ_QUESTION_DTOList[i].AnswerTypes); objMCQModel.objMCQQuestionModelAnswerList = new List <MCQQuestionModel>(); string[] QuestionOptions = objMCQ_QUESTION_DTOList[i].QuestionAnswer.Split('~'); foreach (string Ans in QuestionOptions) { MCQQuestionModel objMCQQuestionModel = new MCQQuestionModel(); string[] QuestionAnswer = Ans.Split('.'); if (QuestionAnswer.Length > 1) { objMCQQuestionModel.QuestionID = objMCQ_QUESTION_DTOList[i].QuestionID; objMCQQuestionModel.QuestionBankDetailsID = Convert.ToInt32(QuestionAnswer[0]); objMCQQuestionModel.QuestionsAnswer = QuestionAnswer[1]; objMCQModel.objMCQQuestionModelAnswerList.Add(objMCQQuestionModel); } } objMCQSettingsModel.objMCQModelList.Add(objMCQModel); } using (MCQSL objMCQSL = new MCQSL()) { objMCQ_DTO.MCQStatus = MCQStatus; objMCQ_DTO = objMCQSL.InsertUpdateMCQUserStatus(objLoginUserDetails.CompanyDBConnectionString, objMCQ_DTO); } return(View(objMCQSettingsModel)); }
private void AnsBtn_Click(object sender, EventArgs e) { int Ultimo = Ans.Count(); ActualTxt.Text += Ans[Ultimo - 1]; }