From 1347614e57488f9ab635d39c194577d45969dbba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=AD=8F=E9=81=87=E5=8D=BF?= <358614401@qq.com> Date: Sat, 20 Jun 2020 15:22:14 +0800 Subject: [PATCH] update I don't know what and why i update it. --- out/production/fuckJavaGui/autoScore/a.class | Bin 0 -> 560 bytes .../fuckJavaGui/autoScore/answer.class | Bin 0 -> 1824 bytes .../fuckJavaGui/autoScore/mainDo.class | Bin 507 -> 507 bytes .../fuckJavaGui/autoScore/mainGUI.class | Bin 2533 -> 0 bytes .../fuckJavaGui/autoScore/score.class | Bin 449 -> 516 bytes .../fuckJavaGui/autoScore/userIn$1.class | Bin 1041 -> 1041 bytes .../fuckJavaGui/autoScore/userIn$2.class | Bin 647 -> 647 bytes .../fuckJavaGui/autoScore/userIn$3.class | Bin 1035 -> 1035 bytes .../fuckJavaGui/autoScore/userIn.class | Bin 1874 -> 1874 bytes src/autoScore/a.java | 20 ++++ src/autoScore/answer.java | 31 ++++- src/autoScore/mainDo.java | 7 +- src/autoScore/mainGUI.java | 110 +++++++++++++----- src/autoScore/score.java | 3 + src/autoScore/userIn.java | 7 ++ 15 files changed, 145 insertions(+), 33 deletions(-) create mode 100644 out/production/fuckJavaGui/autoScore/a.class create mode 100644 out/production/fuckJavaGui/autoScore/answer.class delete mode 100644 out/production/fuckJavaGui/autoScore/mainGUI.class create mode 100644 src/autoScore/a.java diff --git a/out/production/fuckJavaGui/autoScore/a.class b/out/production/fuckJavaGui/autoScore/a.class new file mode 100644 index 0000000000000000000000000000000000000000..d1c372782149056faa53eaaceeacd751c967b01d GIT binary patch literal 560 zcmZuu%TB^j5Iw`Al~Nv3!3Vz34Y;s-A#O}eOz@G^uyJ*%4PJznl-9((U*aF=LK7E$ zfZt?{a|;ViXp^~_nRCvZJNN77;}gIU_6?+v){!xhg+?e3#e=X%!XMa|{h{YZ1g#@| z866YS%~mgmCFFD%Ch{=#7wGo6CoMcSE2MHCkj0=ZW}0~q@!$N85M%H z07K9xiZSvDndVumr(=bX7jYCgZV-C5;QC2$>k&#_>3bLPxbKD6qCetFr5m_n)Dxjp z`Mj8k?&OqE=>E}Yv&dLTo>6Pw%&aDNW}ng@v|Byyi*Ud+YeAbp?1Ii%)QN<9e=a8T zS%wqDq3fMWVjy%;w7su1yXC~Smn&-llaUYyn|knc8#NIgV(#t(VPLWhIP(z z*g%~titMtO616g&df9k}_C)jwz5a%Rl1f8K)p#0EU|^Bot;C`g{;fp1Hlt$`TZ~EZ Vi)>?u#dkSl3*X2qca5aC_X}AbYBB%- literal 0 HcmV?d00001 diff --git a/out/production/fuckJavaGui/autoScore/answer.class b/out/production/fuckJavaGui/autoScore/answer.class new file mode 100644 index 0000000000000000000000000000000000000000..e42889b0e7c7d427219eb330913a88d1d9c9a921 GIT binary patch literal 1824 zcmZ`)TUQ%Z7~N-bnIsHQZYfEN1*$eFrD?IEhT0YawAcW(AP|X{$z&iy!%Un^to=p4 z_@F+7E?LV*AN(=?1lxTk7YNpsHFIXpciZ3o_MH6v?;n2x$f6d5f`E#kh7iI6myYxw z^-NW_4>OykBh&B%!uKuP@*W5TQt2HP5dqD2vYgDSRW&1s3EW-I7I!VX?7Xb!ww>kT zf#sUT$EIz1mQi1CR6VO!HFFimGR)$lU4Lo1F{sdF(SCukRQ{~&mgidb;X-;xdJJl~ zgdu@w)v9~4T3ui$mELdpw-GGFFoIDPV;bVP%pUZH=WH2{Yi4x67JKMC45il6y}>FH z0>kG!dT#1v32+=&B*3e(WN(b*;XQ%N7f~-Ytg0V6fj|UP0&L;BK)jQEsc~>%x@Ngk zVHzLE3LgrLoKBX~=1q~i-1~_Ijgpe$)$I=%KAyRDb1 z+!@Y0hF;y#T}!^VH-lcqqWp&Q7v;4eAS_;MEKzq2DO2L?b|T;Dq8@N1C#-itz6||= z6PEUx?p4UXD+S0&_vC2nLO`jP1QP!{N2c>(UKA%WC?#ec?`G|lBkh5@M+e0q24z3T zM7;X9Jl%M)uGiW$#8!SX%$jF8c3s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bWk^cP#m zm&5M!G+{UK?{QKwS8xI1K)^4i;R*z@Sab{Jfp1YRvRD#uXYoX!(si~{gtAx@aAmPB zz=4f{k}PUw5bF1DoyN9~8Eo&L#?H>5%O%11DT`-<6{WYaFN=dgF47p})RtftZTxfu z_|pq_pNHSHiG82n zAM@1%){xd}lu@YVSkD)912$nJpRP>^^YPn-AfJE`TCfE@*otF}4q+Q*+6kSb3Cfef zUYx;mxIpA(9KhE&h?~6j@1hYuq6xq7y8jie_>sZPpv z+CP-Vn^#ccA9A{5x$c1J}>OsAyC1xZnW?gfs*i+=uF8Q?#a<0NR1#HiST zVQyYSJw~`mJzqYz>y*!O@CCkPiC)rkiR2XF3fC)z`(IRfFj-bs#=)x$72(={>_vo) diff --git a/out/production/fuckJavaGui/autoScore/score.class b/out/production/fuckJavaGui/autoScore/score.class index 0dfa3ea00deed15706ada2cba0705d65f61fa182..bd3d6eb80409e7df9f8e5309e8e9f91b19621fba 100644 GIT binary patch delta 192 zcmX@e+`__j>ff$?3=9lb3{n%ht_c<==NF}h;AmlBlv*P-IgwE*R{>+(0%DL=tK$BZCB3l_UTV Clob2` delta 127 zcmZo+Impa)>ff$?3=9lb3=$K$u1)-+#K<&RoY78!k%5napMjBq6DXI-z{J1;qMSV9cKKy4tF2$03hAPQtNGca-i LrNw|uCI)c;cd8Db diff --git a/out/production/fuckJavaGui/autoScore/userIn$1.class b/out/production/fuckJavaGui/autoScore/userIn$1.class index 968a485ced318d1a9986c1e1731ab312cbe18ff2..a9cef3063a411058fdc8eb189a307a3a824f0a71 100644 GIT binary patch delta 31 mcmbQpF_B|~2{WVpWK-rsUMB`t24@Bp1{Vf>2KULEnd1O&%m%Um delta 31 mcmbQpF_B|~2{WVJWK-rsUPlI21}6p;24@C+2DizZnd1O&i3Y6z diff --git a/out/production/fuckJavaGui/autoScore/userIn$2.class b/out/production/fuckJavaGui/autoScore/userIn$2.class index 3b36cf39a9e071e6664fc7f5b5800d96a09932ce..5037f2d3507bb04f3ff3bb77acb787a8a04a8dc5 100644 GIT binary patch delta 19 acmZo?ZD-x^n~~9T@*hSgM&HTyOdbG4O9o2- delta 19 acmZo?ZD-x^n~~9D@*hSgMxV*{OdbG4I|fMr diff --git a/out/production/fuckJavaGui/autoScore/userIn$3.class b/out/production/fuckJavaGui/autoScore/userIn$3.class index cacf272ef492d1d911223fea25229aa9719ab933..68df5691335a9dde4ee4deb97d3c0eeeb4b4cc26 100644 GIT binary patch delta 31 mcmeC?=;qj<$IR$IS)aL(H;93iA(%mhA%sDnA$;;$<~RUxXa?i} delta 31 mcmeC?=;qj<$IR$AS)aL(H;{pqA&5bRA(%m*A#Czm<~RUxB?jLB diff --git a/out/production/fuckJavaGui/autoScore/userIn.class b/out/production/fuckJavaGui/autoScore/userIn.class index 739be47b74be5e03a1d7eccfc9c05d093ad37af8..224d08f672cf5e146902c189fb64dffe4337cb7c 100644 GIT binary patch delta 145 zcmWN}txiH=0D$4=D+dCj5ZDN3BPil@<8SJOjTxN*f))yHu%SStG8>g}Zh%YBTOb-w zq?ow_6XV4932$0Vi{J0jS5>5}q@pg?aiQnZlbRP-hMB&(HgaR))>6Yt(^|_$+t!_( rdp{oRJ^Iy^W`~2mqi6pHA!lrcf)+NQfW^8v3!ZHQHPq?hE(`_6m-U zcWiO)4VuI|9!{2I$?7S7pNfi(l++!&a;C3rsA8mQqGp=UgNA2KAI^Qc@a586%fhv# qwjUj9H#WL5J--J2-1;{T2kyO~AP^3{ddn5On+fSQo`lDA7w`7$av8<| diff --git a/src/autoScore/a.java b/src/autoScore/a.java new file mode 100644 index 0000000..2d8c42b --- /dev/null +++ b/src/autoScore/a.java @@ -0,0 +1,20 @@ +/* + * Copyright (c) 2020 魏遇卿 All Rights Reserved. + * FileName: a.java + * @author: 魏遇卿@date: 2020/6/19 下午8:02@version: 1.0 + * E-mail:358614401@qq.com + * Code with UTF-8 + */ + +package autoScore; + +public class a { + public static void main(String[] args) { + int a=1; + if (a <10) { + a++; + + } + System.out.println(a); + } +} diff --git a/src/autoScore/answer.java b/src/autoScore/answer.java index 00c64a6..17f23f2 100644 --- a/src/autoScore/answer.java +++ b/src/autoScore/answer.java @@ -8,5 +8,34 @@ package autoScore; +import java.io.*; + public class answer { -} + public static File answer(int i) { + File srcFile = new File("D:\\WindowsCToD\\fire\\GeneticsMultipleChoice\\Answer"); + File[] fileArr = srcFile.listFiles(); + return fileArr[i]; + } + + public static char readFireAnswer(int q) throws FileNotFoundException, IOException { + File filepath = answer(q); + FileReader rader = new FileReader(filepath); + StringBuilder sb = new StringBuilder(); + String s = ""; + BufferedReader br = new BufferedReader(new FileReader(filepath)); + + while ((s = br.readLine()) != null) { + sb.append(s); + } + + br.close(); + String str = sb.toString(); + char ch[]=str.toCharArray(); + char answer = ch[0]; + return answer; + } + + public static void main(String[] args) throws IOException { + System.out.println(readFireAnswer(0)); + } +} \ No newline at end of file diff --git a/src/autoScore/mainDo.java b/src/autoScore/mainDo.java index f596c74..4abdd9d 100644 --- a/src/autoScore/mainDo.java +++ b/src/autoScore/mainDo.java @@ -7,14 +7,11 @@ */ package autoScore; -import autoScore.userIn; -import autoScore.*; - import java.io.IOException; public class mainDo{ public static void main(String[] args) throws IOException { - int score=0; + //int score=0; mainGUI gui=new mainGUI(); } -} \ No newline at end of file +} diff --git a/src/autoScore/mainGUI.java b/src/autoScore/mainGUI.java index d7f8b11..b5b263a 100644 --- a/src/autoScore/mainGUI.java +++ b/src/autoScore/mainGUI.java @@ -14,27 +14,33 @@ import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.io.IOException; +import static autoScore.answer.readFireAnswer; import static autoScore.question.readFile; import static autoScore.score.getScore; public class mainGUI extends JFrame implements ActionListener { + // public static JTextField questionStudent; + JTextField questionStudent = new JTextField("问题的位置"); + //GridBagLayout questionText =new GridBagLayout(); + // questionStudent.setLineWrap(true); + int score; + Container c;//创建主容器 private JTextArea question; private JButton A; private JButton B; private JButton C; private JButton D; - int score; - Container c;//创建主容器 + //构造方法 public mainGUI() throws IOException { //创建窗口容器 super("Auto score to exam"); - /* this.setBounds(100,100,100,100);*/ + /* this.setBounds(100,100,100,100);*/ //获取主容器并设置为网格组布局 - c=this.getContentPane(); + c = this.getContentPane(); c.setLayout(null); this.setVisible(true); - this.setSize(900,300);//设置窗口大小 + this.setSize(900, 300);//设置窗口大小 this.setResizable(false);//设置窗口固定大小 this.setLocationRelativeTo(null);//设置窗口居中 this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);//设置默认关闭操作 @@ -42,11 +48,12 @@ public class mainGUI extends JFrame implements ActionListener { //网格组布局管理器 //创建问题显示位置 - JTextArea questionStudent = new JTextArea("这是问题的位置andFuckJavaGUI"); - GridBagLayout questtionText = new GridBagLayout(); - questionStudent.setBounds(0,0,900,200); - questionStudent.setText(readFile(11));//更改标签内容 - questionStudent.setLineWrap(true); + //JTextArea questionStudent = new JTextArea("这是问题的位置andFuckJavaGUI"); + // questionStudent + //GridBagLayout questtionText = new GridBagLayout(); + questionStudent.setBounds(0, 0, 900, 200); + questionStudent.setText(readFile(0));//更改标签内容 + //questionStudent.setLineWrap(true); questionStudent.setEditable(false); /* JTextField textAreaOutput = new JTextField(); questionStudent.add(new JScrollPane(textAreaOutput));*/ @@ -56,9 +63,9 @@ public class mainGUI extends JFrame implements ActionListener { //pack(); //字体 - questionStudent.setFont(new Font("微软雅黑",Font.BOLD,20)); + questionStudent.setFont(new Font("微软雅黑", Font.BOLD, 20)); - // setLayout(null); + // setLayout(null); A = new JButton("A"); A.addActionListener(this); @@ -87,27 +94,76 @@ public class mainGUI extends JFrame implements ActionListener { @Override public void actionPerformed(ActionEvent e) { - String str = new String(); - if(e.getActionCommand().equals("A")){ - str= "A"; - getScore(score,A,anwer); - } - if (e.getActionCommand().equals("B")){ - str= "B"; + //int用来存储现在是第几题 + int whatQuestionW = 0; + if (whatQuestionW < 20) { - } - if (e.getActionCommand().equals("C")){ - str= "C"; - } - if (e.getActionCommand().equals("D")){ - str= "D"; + //int whatQuestionW =0; + String str = new String(); + if (e.getActionCommand().equals("A")) { + str = "A"; + chooseDo(str, whatQuestionW); + } + /*str = "A"; + char ch[] = str.toCharArray(); + char answer = ch[0]; + try { + getScore(score, answer, readFireAnswer(whatQuestionW)); + } catch (IOException ioException) { + ioException.printStackTrace(); + } + whatQuestionW++; + System.out.println(whatQuestionW); + try { + questionStudent.setText(readFile(1)); + } catch (IOException ioException) { + ioException.printStackTrace(); + } + }*/ + if (e.getActionCommand().equals("B")) { + str = "B"; + chooseDo(str, whatQuestionW); +// System.out.println(whatQuestionW); + } + if (e.getActionCommand().equals("C")) { + str = "C"; + chooseDo(str, whatQuestionW); + } + if (e.getActionCommand().equals("D")) { + str = "D"; + chooseDo(str, whatQuestionW); + } + whatQuestionW++; + } else { + //这里写最后结果被写入文件夹啊 } - } - } + + //按键之后要做的事 + public void chooseDo(String str, int whatQuestionW) { + //str = "A"; + char ch[] = str.toCharArray(); + char answer = ch[0]; + + try { + getScore(score, answer, readFireAnswer(whatQuestionW)); + } catch (IOException ioException) { + ioException.printStackTrace(); + } + whatQuestionW++; + System.out.println(whatQuestionW); + try { + questionStudent.setText(readFile(1)); + } catch (IOException ioException) { + ioException.printStackTrace(); + } + //mainGUI=new mainGUI(); + //actionPerformed(ActionEvent e); + } +} /*public clstatic void main(String[] args) throws IOException { mainGUI mainGUI= new mainGUI(); }*/ diff --git a/src/autoScore/score.java b/src/autoScore/score.java index f9346ba..1507e35 100644 --- a/src/autoScore/score.java +++ b/src/autoScore/score.java @@ -9,4 +9,7 @@ public class score { return score; } } + public static void scoreToTxt(/*String name*,*/int score){ + + } } \ No newline at end of file diff --git a/src/autoScore/userIn.java b/src/autoScore/userIn.java index a5a039e..0440402 100644 --- a/src/autoScore/userIn.java +++ b/src/autoScore/userIn.java @@ -16,6 +16,7 @@ import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.awt.event.MouseAdapter; import java.awt.event.MouseEvent; +import java.io.IOException; public class userIn extends JFrame implements ActionListener { //设置组件 @@ -85,6 +86,12 @@ public class userIn extends JFrame implements ActionListener { } } }); + /*login.addMouseListener(new MouseAdapter() { + public void mouseClicked(MouseAdapter e) throws IOException {] + int c=e.getButton(); + mainGUI a=new mainGUI(); + } + });*/ } @Override