private void bBeginTest_Click(object sender, EventArgs e) { current_hazard_test = new Hazard_test(); current_hazard_test.candidate_name = tCandidateName.Text; current_hazard_test.time_started = DateTime.Now; if (rSetA.Checked) { current_hazard_test.test_type = test_type.real_test; } else if (rSetB.Checked) { current_hazard_test.test_type = test_type.fake_score_high; } else if (rSetC.Checked) { current_hazard_test.test_type = test_type.fake_score_low; } foreach (Hazard_video h in hazard_videos) { Hazard_test_question q = new Hazard_test_question(); q.video = h; current_hazard_test.hazard_test_questions.Add(q); current_hazard_test.hazard_test_questions.Sort(delegate(Hazard_test_question h1, Hazard_test_question h2) { return h1.ordering_key.CompareTo(h2.ordering_key); }); } save_test_state(); pre_test_detail_panel.Visible = false; panel1.Visible = true; continue_test(); }
private void bBeginTest_Click(object sender, EventArgs e) { current_hazard_test = new Hazard_test(); current_hazard_test.candidate_name = tCandidateName.Text; current_hazard_test.time_started = DateTime.Now; if (rSetA.Checked) { current_hazard_test.test_type = test_type.real_test; } else if (rSetB.Checked) { current_hazard_test.test_type = test_type.fake_score_high; } else if (rSetC.Checked) { current_hazard_test.test_type = test_type.fake_score_low; } foreach (Hazard_video h in hazard_videos) { Hazard_test_question q = new Hazard_test_question(); q.video = h; current_hazard_test.hazard_test_questions.Add(q); current_hazard_test.hazard_test_questions.Sort(delegate(Hazard_test_question h1, Hazard_test_question h2) { return(h1.ordering_key.CompareTo(h2.ordering_key)); }); } save_test_state(); pre_test_detail_panel.Visible = false; panel1.Visible = true; continue_test(); }
private void load_test_state() { return; if (File.Exists("definitions/test_state.json")) { using (StreamReader sr = new StreamReader("definitions/test_state.json")) { string state = sr.ReadToEnd(); current_hazard_test = Newtonsoft.Json.JsonConvert.DeserializeObject <Hazard_test>(state); continue_test(); } } }
private void load_test_state() { return; if (File.Exists("definitions/test_state.json")) { using (StreamReader sr = new StreamReader("definitions/test_state.json")) { string state = sr.ReadToEnd(); current_hazard_test = Newtonsoft.Json.JsonConvert.DeserializeObject<Hazard_test>(state); continue_test(); } } }