当前位置:首页 > 代码 > 正文

java评卷系统代码(java题库和组卷系统)

admin 发布:2022-12-19 08:53 170


本篇文章给大家谈谈java评卷系统代码,以及java题库和组卷系统对应的知识点,希望对各位有所帮助,不要忘了收藏本站喔。

本文目录一览:

求JAVA评委打分代码

正好我闲着,给你写一个吧。

我写的这个评委分数是在代码里固定到数组里了,如果你需要运行时手动输入评分,可以将oldScores里的数据改成手动输入就行了(这个不用我再写了吧,如果不会再追问,再告诉你)。

你先新建一个类,将下面的main方法全部复制进去就能运行了,自己看一下吧。

/** 主方法 */

    public static void main(String[] args)

    {

        /** 保存原始评分的数组(如果你需要运行时手动输入分数,将 oldScores中的数据改成手动输入就行了 */

        double[] oldScores = {15, 77, 55, 88, 79, 98, 67, 89, 68, 88};

        /** 最终将用来保存排序后的数组 */

        double[] scores = new double[oldScores.length];

        double temp;

        /** 平均分 */

        double avg = 0;

        int k;

        

        /** 将原始评分放入最终排序数组 */

        for (int i = 0; i  oldScores.length; i++)

        {

            scores[i] = oldScores[i];

        }

        

        /** 开始排序 */

        for (int i = 0; i  scores.length - 1; i++)

        {

            k = i;

            for (int j = i + 1; j  scores.length; j++)

            {

                if (scores[k]  scores[j])

                {

                    k = j;

                }

            }

            if (i != k)

            {

                temp = scores[k];

                scores[k] = scores[i];

                scores[i] = temp;

            }

        }

        

        /** 计算去掉最高分和最低分之后的和 */

        double sum = 0;

        /** 记录计算平均分的分数个数 */

        double num = 0;

        for (int i = 1; i  scores.length - 1; i++)

        {

            num++;

            sum += scores[i];

        }

        /** 计算平均分 */

        avg = sum / num;

        

        /** 最公平的肯定不是在scores数组两端 */

        double zgp = 0;

        double cha = 0;

        /** 标记与平均值差值最小的分数位置 */

        int flag = 0;

        /** 开始寻找最公平评分 */

        for (int i = 1; i  scores.length - 1; i++)

        {

            /** 为cha赋初始值,注意比较差值要使用绝对值比较 */

            if (i == 1)

            {

                cha = Math.abs(scores[i] - avg);

            }

            double cha1 = Math.abs(scores[i] - avg);

            if (cha1  cha)

            {

                cha = cha1;

                flag = i;

            }

        }

        zgp = scores[flag];

        

        /** 由于最不公平的分数肯定在scores数组的第一个或者是最后一个 */

        double bgp = 0;

        if (Math.abs(scores[0] - avg)  Math.abs(scores[scores.length - 1] - avg))

        {

            bgp = scores[0];

        }

        else

        {

            bgp = scores[scores.length - 1];

        }

        

        /** 全部计算完成,下面开始输出结果 */

        System.out.println("原始评委分数如下:");

        for (int i = 0; i  oldScores.length; i++)

        {

            System.out.print(oldScores[i] + ", ");

        }

        System.out.println();

        

        System.out.println("排序后分数如下:");

        for (int i = 0; i  scores.length; i++)

        {

            System.out.print(scores[i] + ", ");

        }

        System.out.println();

        

        System.out.println("去掉最高分和最低分后平均分:" + avg);

        System.out.println("最公平分数:" + zgp);

        System.out.println("最不公平分数:" + bgp);

    }

用Java语言编写一个代码,输入几个评委分数,去掉一个最大和最小取平均值,

package com.test;

import java.io.InputStream;

import java.util.Scanner;

public class Test {

int[] nums = new int[5]; //评委分数数组

int avg; //平均分

int num=0;  //输入的值

int num2=0; //冒泡用的

int num3=0; //冒泡用的

int sun=0; //总分

Scanner input = new Scanner(System.in);

public void test(){

for(int i=0;i5;i++){ // 输入5个评委分

System.out.println("请评委输入分数:");

num = input.nextInt();

if(num0  num=10){

nums[i]=num;

}else{

System.out.println("分数只能在0-10之间");

i--;

continue;

}

}

for(int i=0;inums.length;i++){

sun=sun+nums[i];

}

for(int i = 0; inums.length-1 ;i++){

 if(nums[i]  nums[i+1]){

 num2 = nums[i];

 nums[i]=nums[i+1];

 nums[i+1]=num2;

 }

}

for(int i = 1; inums.length-1 ;i++){

 if(nums[i]  nums[i+1]){

 num3 = nums[i];

 nums[i]=nums[i+1];

 nums[i+1]=num2;

 }

}

avg=(sun-nums[0]-nums[1])/3;

System.out.println("平均分为:"+avg);

}

public static void main(String[] args) {

Test tt = new Test();

tt.test();

}

}

求用Java编写的学生成绩管理系统的完整代码

package jdbcproj;

import java.sql.*;

import java.awt.BorderLayout;

import java.awt.EventQueue;

import javax.swing.JFrame;

import javax.swing.JPanel;

import javax.swing.border.EmptyBorder;

import javax.swing.JLabel;

import javax.swing.JOptionPane;

import javax.swing.JTextField;

import javax.swing.JButton;

import java.awt.event.ActionListener;

import java.sql.Connection;

import java.sql.PreparedStatement;

import java.sql.SQLException;

import java.awt.event.ActionEvent;

public class MainFrame extends JFrame {

private JPanel contentPane;

private JTextField txtname;

private JTextField txtpassword;

/**

 * Launch the application.

 */

public static void main(String[] args) {

EventQueue.invokeLater(new Runnable() {

public void run() {

try {

MainFrame frame = new MainFrame();

frame.setVisible(true);

} catch (Exception e) {

e.printStackTrace();

}

}

});

}

/**

 * Create the frame.

 */

public MainFrame() {

setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

setBounds(100, 100, 661, 399);

contentPane = new JPanel();

contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));

setContentPane(contentPane);

contentPane.setLayout(null);

JLabel lblNewLabel = new JLabel("\u7528\u6237\u540D");

lblNewLabel.setBounds(114, 51, 72, 18);

contentPane.add(lblNewLabel);

JLabel lblNewLabel_1 = new JLabel("\u5BC6\u7801");

lblNewLabel_1.setBounds(114, 106, 72, 18);

contentPane.add(lblNewLabel_1);

txtname = new JTextField();

txtname.setBounds(261, 48, 86, 24);

contentPane.add(txtname);

txtname.setColumns(10);

txtpassword = new JTextField();

txtpassword.setBounds(261, 103, 86, 24);

contentPane.add(txtpassword);

txtpassword.setColumns(10);

JButton btnadd = new JButton("\u589E\u52A0");

btnadd.addActionListener(new ActionListener() {

public void actionPerformed(ActionEvent e) {

if(txtname.getText().equals("")||txtpassword.getText().equals(""))

{

JOptionPane.showMessageDialog(getContentPane(), "用户名和密码不能为空","提示信息框",JOptionPane.WARNING_MESSAGE);

}

else{

Users u=new Users();

u.setPwd(txtpassword.getText());

u.setUsername(txtname.getText());

UserDAO usdo=new UserDAO();

usdo.addUser(u);

}

}

});

btnadd.setBounds(45, 205, 113, 27);

contentPane.add(btnadd);

JButton btndelete = new JButton("\u5220\u9664");

btndelete.addActionListener(new ActionListener() {

public void actionPerformed(ActionEvent arg0) {

if(txtname.getText().equals(""))

{

JOptionPane.showMessageDialog(getContentPane(), "用户名不能为空","提示信息框",JOptionPane.WARNING_MESSAGE);

}

else{

UserDAO usdo=new UserDAO();

usdo.delUser(txtname.getText());;

}

}

});

btndelete.setBounds(172, 205, 113, 27);

contentPane.add(btndelete);

JButton btnupdate = new JButton("\u4FEE\u6539");

btnupdate.addActionListener(new ActionListener() {

public void actionPerformed(ActionEvent e) {

if(txtname.getText().equals("")||txtpassword.getText().equals(""))

{

JOptionPane.showMessageDialog(getContentPane(), "用户名和密码不能为空","提示信息框",JOptionPane.WARNING_MESSAGE);

}

else{

Users u=new Users();

u.setPwd(txtpassword.getText());

u.setUsername(txtname.getText());

UserDAO usdo=new UserDAO();

usdo.updateUser(u);;

}

}

});

btnupdate.setBounds(300, 205, 113, 27);

contentPane.add(btnupdate);

JButton btnfind = new JButton("\u67E5\u8BE2");

btnfind.addActionListener(new ActionListener() {

public void actionPerformed(ActionEvent e) {

if(txtname.getText().equals(""))

{

JOptionPane.showMessageDialog(getContentPane(), "用户名不能为空","提示信息框",JOptionPane.WARNING_MESSAGE);

}

else{

Users u=new Users();

UserDAO usdo=new UserDAO();

u=usdo.findUser(txtname.getText(), txtpassword.getText());

if(u!=null){

JOptionPane.showMessageDialog(getContentPane(), "该用户存在!","提示信息框",JOptionPane.WARNING_MESSAGE);

}

else{

JOptionPane.showMessageDialog(getContentPane(), "该用户不存在!","提示信息框",JOptionPane.WARNING_MESSAGE);

}

}

}

});

btnfind.setBounds(427, 205, 113, 27);

contentPane.add(btnfind);

//记得要写这个

setVisible(true);

}

}

求一个能够 自动生成小学生数学练习题目 的Java程序。

按照你的要求编写的小学数学练习题目自动生成系统的Java程序如下

import java.awt.BorderLayout;

import java.awt.Color;

import java.awt.Font;

import java.awt.event.ActionEvent;

import java.awt.event.ActionListener;

import javax.swing.JButton;

import javax.swing.JFrame;

import javax.swing.JLabel;

import javax.swing.JMenu;

import javax.swing.JMenuBar;

import javax.swing.JMenuItem;

import javax.swing.JOptionPane;

import javax.swing.JPanel;

import javax.swing.JTextField;

public class B extends JFrame implements ActionListener{

 int max=20;

 int MAX=10;

 int TYPE=1;

 JLabel jlTitle=new JLabel();

 JLabel jl=new JLabel("");

 JLabel jlAnswer=new JLabel("");

 JLabel jlTotal=new JLabel("共"+max+"题");

 JLabel jlcorrect=new JLabel();

 JTextField jtf=new JTextField(3);

 JMenuBar jmb=new JMenuBar();

 JMenu jm=new JMenu("类型 ");

 JMenuItem jmi1=new JMenuItem("10以内加法");

 JMenuItem jmi2=new JMenuItem("10以内减法");

 JMenuItem jmi3=new JMenuItem("20以内加法");

 JMenuItem jmi4=new JMenuItem("20以内减法");

 JMenuItem jmi5=new JMenuItem("100以内加法");

 JMenuItem jmi6=new JMenuItem("100以内减法");

 JMenuItem jmi7=new JMenuItem("100以内乘法");

 JMenuItem jmi8=new JMenuItem("100以内除法");

 JButton jb1=new JButton("上一题");

 JButton jb2=new JButton("下一题");

 JButton jb3=new JButton("评卷");

 JButton jb4=new JButton("答案");

 JPanel jp1=new JPanel();

 JPanel jp2=new JPanel();

 JPanel jp3=new JPanel();

 String[] question=new String[max];

 int[] answer=new int[max];

 String[] studentAnswer=new String[max];

 boolean[]correct=new boolean[max];

 int count=1;

 boolean submitFlag=false;

 B(){

  super("小学数学测试");

  jlTitle.setFont(new Font(null,Font.PLAIN,20));

  jlTotal.setFont(new Font(null,Font.PLAIN,20));

  jlAnswer.setFont(new Font(null,Font.PLAIN,20));

  jl.setFont(new Font(null,Font.PLAIN,20));

  jlcorrect.setFont(new Font(null,Font.PLAIN,20));

  jlcorrect.setForeground(Color.RED);

  jtf.setFont(new Font(null,Font.PLAIN,20));

  fillQuestion();

  jb1.addActionListener(this);

  jb2.addActionListener(this);

  jb3.addActionListener(this);

  jb4.addActionListener(this);

  jmi1.addActionListener(this);

  jmi2.addActionListener(this);

  jmi3.addActionListener(this);

  jmi4.addActionListener(this);

  jmi5.addActionListener(this);

  jmi6.addActionListener(this);

  jmi7.addActionListener(this);

  jmi8.addActionListener(this);

  jm.add(jmi1);jm.add(jmi2);jm.add(jmi3);jm.add(jmi4);jm.add(jmi5);jm.add(jmi6);jm.add(jmi7);jm.add(jmi8);

  jmb.add(jm);

  setJMenuBar(jmb);

  jp1.add(jlTitle);jp1.add(jlTotal);jp1.add(jb3);jp1.add(jb4);

  jp2.add(jl);jp2.add(jtf);jp2.add(jlcorrect);jp2.add(jlAnswer);

  jp3.add(jb1);jp3.add(jb2);

  add(jp1,BorderLayout.NORTH);

  add(jp2,BorderLayout.CENTER);

  add(jp3,BorderLayout.SOUTH);

  setSize(300, 200);

  setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

  setLocationRelativeTo(null);

  setVisible(true);

 }

 @Override

 public void actionPerformed(ActionEvent ae) {

  if(ae.getSource()==jb1){

   if(submitFlag==false){

    try{

     int tempanswer=Integer.parseInt(jtf.getText().trim());

     studentAnswer[count-1]=jtf.getText().trim();

     if(count==1)count=max;

     else count--;

     jlTitle.setText("第"+count+"题");

     jl.setText(question[count-1]);

     jtf.setText("");

     if(studentAnswer[count-1]==null||studentAnswer[count-1].equals("")){

     }else{

      jtf.setText(studentAnswer[count-1]);

     }

    }catch(NumberFormatException nfe){

     JOptionPane.showMessageDialog(this, "请输入正整数!");

     jtf.requestFocus();

    }

   }else{

    if(count==1)count=max;

    else count--;

    jlTitle.setText("第"+count+"题");

    jl.setText(question[count-1]);

    jlAnswer.setText("");

    jtf.setEnabled(false);

    jtf.setText(studentAnswer[count-1]);

    jb4.setEnabled(true);

    if(correct[count-1]==true){

     jlcorrect.setText("√");

    }else{

     jlcorrect.setText("×");

    }

   }

  }

  if(ae.getSource()==jb2){

   if(submitFlag==false){

    try{

     int tempanswer=Integer.parseInt(jtf.getText().trim());

     studentAnswer[count-1]=jtf.getText().trim();

     if(count==max)count=1;

     else count++;

     jlTitle.setText("第"+count+"题");

     jl.setText(question[count-1]);

     jtf.setText("");

     if(studentAnswer[count-1]==null||studentAnswer[count-1].equals("")){

     }else{

      jtf.setText(studentAnswer[count-1]);

     }

    }catch(NumberFormatException nfe){

     JOptionPane.showMessageDialog(this, "请输入正整数!");

     jtf.requestFocus();

    }

   }else{

    if(count==max)count=1;

    else count++;

    jlTitle.setText("第"+count+"题");

    jl.setText(question[count-1]);

    jlAnswer.setText("");

    jtf.setEnabled(false);

    jtf.setText(studentAnswer[count-1]);

    jb4.setEnabled(true);

    if(correct[count-1]==true){

     jlcorrect.setText("√");

    }else{

     jlcorrect.setText("×");

    }

   }

  }

  if(ae.getSource()==jb3){

   try{

    int tempanswer=Integer.parseInt(jtf.getText().trim());

    studentAnswer[count-1]=jtf.getText().trim();

    for(int i=0;imax;i++){

     if(studentAnswer[i]==null||studentAnswer[i].equals("")){

      correct[i]=false;

     }else if(Integer.parseInt(studentAnswer[i])==answer[i]){

      correct[i]=true;

     }else{

      correct[i]=false;

     }

    }

    int correctAnswer=0;

    for(int i=0;imax;i++){

     if(correct[i]==true){

      correctAnswer++;

     }

    }

    String s="共"+max+"道题\n";

    s=s+"答对"+correctAnswer+"道题\n";

    s=s+"答错"+(max-correctAnswer)+"道题\n";

    s=s+"成绩"+String.format("%.2f",(100*(float)correctAnswer/max))+"分\n";

    JOptionPane.showMessageDialog(this, s);

    submitFlag=true;

    jb4.setEnabled(true);

    jtf.setEnabled(false);

    jtf.setText(studentAnswer[count-1]);

    if(correct[count-1]==true){

     jlcorrect.setText("√");

    }else{

     jlcorrect.setText("×");

    }

   }catch(NumberFormatException nfe){

    JOptionPane.showMessageDialog(this, "请输入正整数!");

    jtf.requestFocus();

   }

  }

  if(ae.getSource()==jb4){

   jlAnswer.setText(String.valueOf(answer[count-1]));

  }

  if(ae.getSource()==jmi1){

   MAX=10;TYPE=1;fillQuestion();

  }

  if(ae.getSource()==jmi2){

   MAX=10;TYPE=2;fillQuestion();

  }

  if(ae.getSource()==jmi3){

   MAX=20;TYPE=1;fillQuestion();

  }

  if(ae.getSource()==jmi4){

   MAX=20;TYPE=2;fillQuestion();

  }

  if(ae.getSource()==jmi5){

   MAX=100;TYPE=1;fillQuestion();

  }

  if(ae.getSource()==jmi6){

   MAX=100;TYPE=2;fillQuestion();

  }

  if(ae.getSource()==jmi7){

   MAX=100;TYPE=3;fillQuestion();

  }

  if(ae.getSource()==jmi8){

   MAX=100;TYPE=4;fillQuestion();

  }

 }

 public static void main(String[] args) {

  new B();

 }

 public void fillQuestion(){

  count=1;

  for(int i=0;imax;i++){

   String s=randomQuestion(MAX,TYPE);

   question[i]=s.substring(0,s.indexOf("=")+1);

   answer[i]=Integer.parseInt(s.substring(s.indexOf("=")+1));

  }

  studentAnswer=new String[max];

  correct=new boolean[max];

  jl.setText(question[0]);

  jlTitle.setText("第"+count+"题");

  jlcorrect.setText("");

  jlAnswer.setText("");

  submitFlag=false;

  jtf.setEnabled(true);

  jtf.setText("");

  jb4.setEnabled(false);

 }

 public String randomQuestion(int MAX,int TYPE) {

  String s="";

  int answer=MAX+1;

  while(answerMAX||answer0){

   int a=(int)(Math.random()*MAX+1);

   int b=(int)(Math.random()*MAX+1);

   switch(TYPE){

    case 1:answer=a+b;break;

    case 2:answer=a-b;break;

    case 3:answer=a*b;break;

    case 4:

     if(a%b==0){

      answer=a/b;

     }

     break;

   }

   if(answer=MAXanswer=0){

    s=s+a;

    switch(TYPE){

     case 1:s=s+"+";break;

     case 2:s=s+"-";break;

     case 3:s=s+"*";break;

     case 4:s=s+"/";break;

    }

    s=s+b+"="+answer;

   }

  }

  return s;

 }

}

运行结果

跪求用Java语言实现试卷的难度与区分度 信度评估算法的源代码

简单的说,所谓调查问卷的信度是指这个问卷是不是可靠的,这个包含多层含义,比如说这份问卷是不是多次重复做结果都接近等等。

效度是指这个问卷是不是考察出了你想要考察的结果,一般这个会和一个校标做校标关联系数。

信度一般用阿尔法系数做检验

效度一般用T检验,显著性差异指数P检验。

一般应该先用小样本做信度和效度,但是做效度的样本也不应该低于60人。然后再做推广。

还有你这种量表是否应该在做效度时用校标关联系数呢,但这又需要你有新的校标。

因为不太了解具体情况,所以先这么说,在做的时候你要遇到什么问题,你在问我哈。还有建议关于怎么做信度和效度,你还是看一下相关书籍。我觉得这还是很有必要的。

一、信度系数与信度指数

大部分情况下,信度是以信度系数为指标,它是一种相关系数。常常是同一被试样本所得到的两组资料的相关,理论上说就是真分数方差与实得分数方差的比值,公式为:

r(xx)=r^2(xt)=S^2(t)/S^2(x)

公式中r^2(xt)是真分数标准差与实得分数标准差的比值,称作信度系数,公式为:

r(xt)=S(t)/S(x)

可见信度指数的平方就是信度系数。

二、测量标准误

信度系数仅表示一组测量的实得分数与真分数的符合程度,但并没有直接指出个人测验分数的变异量。我们可以用一组被试两次测量结果来代替对同一个人的反复施测,于是有了信度的另一个指标,公式为:

SE=S(x)√1-r(xx)

公式中SE为测量的标准误,S(x)是所得分数的标准差,r(xx)为测验的信度系数,从公式我们可以看出测量的标准误与信度之间有互为消长的关系:信度越高,标准误越小,信度越低,标准误越大。

p value 和t value 我在百度百科上没看到,你自己再找找吧

关于java评卷系统代码和java题库和组卷系统的介绍到此就结束了,不知道你从中找到你需要的信息了吗 ?如果你还想了解更多这方面的信息,记得收藏关注本站。

版权说明:如非注明,本站文章均为 AH站长 原创,转载请注明出处和附带本文链接;

本文地址:http://ahzz.com.cn/post/5544.html


取消回复欢迎 发表评论:

分享到

温馨提示

下载成功了么?或者链接失效了?

联系我们反馈

立即下载