private void timer1_Tick(object sender, EventArgs e) { TimeSpan t = TimeSpan.Parse("0:0:1"); if (this.leftTime == TimeSpan.Parse("0:0:0")) { //强制提交 if (this.model == 1) { this.Hide(); this.timer1.Enabled = false; score sc = new score(this); this.Hide(); sc.WindowState = FormWindowState.Maximized; sc.ShowDialog(); DialogResult = DialogResult.OK; submit(); this.Close(); return; } else if (this.model == 2) { //提交并关闭 submit(); //转综合写作 write wrt1 = new write(tponum, 2); write wrt2 = new write(tponum, 1); wrt1.ShowDialog(); wrt2.ShowDialog(); //给结果 score sc = new score(this); this.Hide(); sc.WindowState = FormWindowState.Maximized; sc.ShowDialog(); this.Close(); DialogResult = DialogResult.OK; return; } } if (this.button2.Text != "暂停") { return; } this.leftTime = this.leftTime.Subtract(t); this.label1.Text = this.leftTime.ToString(); if (this.leftTime <= TimeSpan.Parse("0:0:30")) { this.label1.ForeColor = Color.Red; if (this.leftTime == TimeSpan.Parse("0:0:30")) { this.label1.Visible = true; this.button1.Text = "隐藏时间"; } } else { this.label1.ForeColor = Color.Black; } }
private void listView3_SelectedIndexChanged(object sender, EventArgs e) { if (listView3.SelectedItems.Count != 1) { return; } write wrt = new write(1, Convert.ToInt32(listView3.SelectedItems[0].SubItems[1].Text)); wrt.ShowDialog(); }
private void button6_Click(object sender, EventArgs e) { string ans = ""; ans += checkBox1.Checked ? "A" : ""; ans += checkBox2.Checked ? "B" : ""; ans += checkBox3.Checked ? "C" : ""; ans += checkBox4.Checked ? "D" : ""; ans += checkBox5.Checked ? "E" : ""; ans += checkBox6.Checked ? "F" : ""; this.studentAnswers[nownum] = ans; if (this.model == 1) { //提交函数 //保存答题结果!!!! submit(); score sc = new score(this); this.Hide(); sc.WindowState = FormWindowState.Maximized; sc.ShowDialog(); DialogResult = DialogResult.OK; } else if (this.model == 2) { if (this.nowarti <= 1) { this.nowarti += 1; this.webBrowser1.DocumentText = "<span style='color: rgb(128, 128, 128); text-transform: none; text-indent: 0px; letter-spacing: normal; font-family: \"Helvetica Neue\", Helvetica, \"Hiragino Sans GB\", \"Microsoft YaHei\", Arial, sans-serif; font-size: 16px; font-style: normal; font-weight: 400; word-spacing: 0px; float: none; display: inline !important; white-space: normal; orphans: 2; widows: 2; background-color: rgb(255, 255, 255); font-variant-ligatures: normal; font-variant-caps: normal; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial;'>" + "<p align=\"center\">" + artis[nowarti].title + "</p>" + "<p>" + artis[nowarti].content.Replace("\r\n", "</p><p>").Replace("\n", "</p><p>") + "</p></span>"; this.nowartinum = 0; if (this.nowarti == 1) { this.nownum = this.artis[0].questionnum; button3.Enabled = false; button4.Enabled = true; } else if (this.nowarti == 2) { this.nownum = this.artis[0].questionnum + this.artis[1].questionnum; button3.Enabled = false; button4.Enabled = true; } load_left_ins(); } else { //提交并关闭 submit(); //转综合写作 write wrt1 = new write(tponum, 2); write wrt2 = new write(tponum, 1); wrt1.ShowDialog(); wrt2.ShowDialog(); //给结果 score sc = new score(this); this.Hide(); sc.WindowState = FormWindowState.Maximized; sc.ShowDialog(); DialogResult = DialogResult.OK; } } else if (this.model == 3) { score sc = new score(this); this.Hide(); sc.WindowState = FormWindowState.Maximized; sc.ShowDialog(); DialogResult = DialogResult.OK; } }
private void button5_Click(object sender, EventArgs e) { write write_form = new write(tpoNo); write_form.ShowDialog(); }