java組卷
『壹』 如何用java實現隨機出題
import java.io.*;
import java.sql.*;
import javax.servlet.*;
import javax.servlet.http.*;
import oracle.jdbc.driver.OracleDriver;
public class GenPaperServlet extends HttpServlet
{
    Connection conn;
    Statement stmt;
    ResultSet rs;
    int total_question_num;
    int total_question_in_paper;
    int total_paper_num;
    String curr_classid;
    public GenPaperServlet()
    {
        conn = null;
        stmt = null;
        rs = null;
        total_question_num = 0;
        total_question_in_paper = 0;
        total_paper_num = 0;
        curr_classid = "";
    }
    public void doGet(HttpServletRequest httpservletrequest, HttpServletResponse httpservletresponse)
        throws ServletException, IOException
    {
        httpservletresponse.setContentType("text/html;charset=GBK");
        PrintWriter printwriter = httpservletresponse.getWriter();
        printwriter.println("<html><head></head><body><center>");
        printwriter.println("請以POST方式提交");
        printwriter.println("</center></body></html>");
        printwriter.close();
    }
    public void doPost(HttpServletRequest httpservletrequest, HttpServletResponse httpservletresponse)
        throws ServletException, IOException
    {
        httpservletresponse.setContentType("text/html;charset=GBK");
        PrintWriter printwriter = httpservletresponse.getWriter();
        String s = httpservletrequest.getParameter("classid");  //"20"
        String s1 = httpservletrequest.getParameter("paper_num");  //"1"
        if(s == null || s1 == null)
        {
            printwriter.println("<center>");
            printwriter.println("請按照正常方式提交數據<br>");
            printwriter.println("<a href=/test/admin/genpaper.jsp>單擊這里設置生成試卷的參數</a>");
            printwriter.println("</center>");
        }
        total_paper_num = Integer.parseInt(s1);
        curr_classid = s;
        int i = 0;
        if(!open_db(curr_classid))
        {
            printwriter.println("打開資料庫錯誤!");
            return;
        }
        if(!setParams(curr_classid))
        {
            System.out.println("設置系統參數錯誤!");
            return;
        }
        if(!verify_QuertionLib())
        {
            printwriter.println("試題庫中試卷不足,請增加新的試題!");
            printwriter.println("班級代號:" + curr_classid);
            printwriter.println("該班級一套試卷中的試題數:" + total_question_in_paper);
            printwriter.println("目前題庫中該班級的試題總數:" + total_question_num);
            return;
        }
        i = genPaper(total_paper_num, curr_classid);
        if(i == 0)
        {
            printwriter.println("生成試卷操作失敗!");
            return;
        }
        if(!updateOtherTable(i, curr_classid))
        {
            printwriter.println("更新相關表操作失敗!");
            return;
        } else
        {
            printwriter.println("<center>");
            printwriter.println("動態組捲成功!<br>");
            printwriter.println("共生成了 " + i + " 套試卷<br>");
            printwriter.println("<a href=/test/admin/genpaper.jsp>單擊這里設置生成試卷的參數</a>");
            printwriter.println("</center>");
            return;
        }
    }
    public boolean open_db(String s)
    {
        try
        {
            new OracleDriver();
            conn = DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521:ora9", "scott", "tiger");
            stmt = conn.createStatement();
        }
        catch(Exception exception)
        {
            return false;
        }
        return true;
    }
    public boolean setParams(String s)
    {
        String s1 = "";
        try
        {
            String s2 = "select count(questionid) as countquestionid  from test_question_lib ";
            s2 = s2 + "where classid='" + s + "'";
            rs = stmt.executeQuery(s2);
            rs.next();
            total_question_num = rs.getInt("countquestionid");
            s2 = "select totalques from test_classinfo ";
            s2 = s2 + "where classid='" + s + "'";
            rs = stmt.executeQuery(s2);
            rs.next();
            total_question_in_paper = rs.getInt("totalques");
        }
        catch(Exception exception)
        {
            return false;
        }
        return true;
    }
    public boolean verify_QuertionLib()
    {
        return total_question_num >=   total_question_in_paper;
    }
    public boolean updateOtherTable(int i, String s)
    {
        int j = 0;
        String s1 = "update test_classinfo set totalpaper=totalpaper+";
        s1 = s1 + i + " where classid='" + s + "'";
        try
        {
            j = stmt.executeUpdate(s1);
        }
        catch(Exception exception)
        {
            return false;
        }
        return j == 1;
    }
    public int genPaper(int i, String s)
    {
        boolean flag = false;
        boolean flag1 = false;
        boolean flag2 = false;
        boolean flag3 = false;
        String s1 = "";
        try
        {  
            int ai[] = new int[total_question_num];
            int i1 = 0;
            boolean flag4 = false;
            String s2 = "select max(paper_id) as max_paper_id from test_paper_lib";
            rs = stmt.executeQuery(s2);
            rs.next();
            int j = rs.getInt("max_paper_id") + 1;
            s2 = "select questionid from test_question_lib where classid='" + s + "'";
            
            for(rs = stmt.executeQuery(s2); rs.next();)
                ai[i1++] = rs.getInt("questionid");
            for(int k1 = 0; k1 < i; k1++)
            {
                int k = ai.length; //8
                for(int l1 = 0; l1 < total_question_in_paper; l1++)
                {
                 // int ai[] ={1 ,3 , 5 ,9 , 56,30 96 ,25};
                    int j1 = (int)Math.floor(Math.random() * (double)k); // 4
                    String s3 = "insert into test_paper_lib values(";
                    s3 = s3 + "test_seq_paper.nextval," + j + "," + ai[j1] + ")";
                    stmt.executeUpdate(s3);
                    
                    int l = ai[k - 1];
                    ai[k - 1] = ai[j1];
                    ai[j1] = l;
                    k--;
                }
                j++;
            }
        }
        catch(Exception exception)
        {
            return 0;
        }
        return i;
    }
}
『貳』 跪求java實現B/S考試系統的思路(最好有源代碼)
做這個題庫系統需要按照mvc設計一下, 最近我也實現一個類似的, 下面說下我的設計
- 資料庫mysql+開發環境eclipse+jdk1.8, 然後基於一個整合框架把項目搭建起來 
- 設計基礎試題表, 這個主要有類型難度等等 
- 設計試卷表, 試卷表由create的時候根據輸入的規則自動根據上面的基礎題庫表組裝而成 
- 剩下的用戶管理, 導出就比較容易了, 導出可以用poi導出成word 
『叄』 用java開發基於web的試卷自動生成系統,要可以導出word文檔
你盡管放心,不會有大俠為你提供的,你這叫定製開發,得付費的!哈哈!
『肆』 java實現組卷功能
組卷一般分兩種模式  
一種是固定試卷 你直接在你題庫選擇題目 拼成了試卷 生成你直接拼接字元串生成一個html文件就可以了
一種是隨機試卷,你設計好 選擇題幾個  問答題幾個 。。。類似  然後一鍵生成 根據你設定的參數去隨機取題目 然後 按一定的規律拼接就可以了  比如3個選擇 2個填空  1個問答 剩下那些拼接都是布局的問題了
『伍』 有什麼好用的在線考試系統嗎Java的。
考試雲就是這樣一個好的考試系統,擁有如下特點:
1、支持新增考生信息,可以使用Excel模板批量導入考生信息;可以進行組無限層級織架構的建設,分部門分組管理考生信息。
2、支持可視化批量新增試題,支持word、Excel、TXT導題模板一鍵導入試題;導入試題時,系統會自動檢測相似題目和試題格式,並給出相應的提示,避免試題的重復錄入。
3、支持免登錄、口令、免登錄+口令、賬號密碼四種考生參加考試的方式;支持固定試卷、抽題試卷、隨機試卷三種試卷類型,可以根據考試業務靈活組卷。

4、有模擬考場環境的參數設置,如考試時間、答題時長、參考次數、成績顯示等;還有防止作弊的措施,如人臉識別、視頻抓怕監考、隨機打亂試題順序、禁止考試中途切屏、禁止考生復制、粘貼等操作。
5、支持自動閱卷,主觀題可設置得分點、關鍵詞進行判卷,具備多維度的成績統計分析,讓考試結果一目瞭然。
『陸』 哪位高手有隨機組卷的思路 最好有源碼 我用的是java+jsp+servlet。
M我 晚上我給你一套源碼
『柒』 求一個java智能試卷生成系統,基於web形式的,做畢業設計
這個簡單呀,你先把試題存到資料庫中,然後再讀取出來,生成web頁面,如果你想生成的每一份試題都不一樣,也可以添加一些演算法,這樣生成的試卷每個都不一樣。。思路就這樣。。。
『捌』 使用java來實現在智能組卷中的遺傳演算法(急急急)
題目好像是讓你做個增強版的List ,簡單的都實現了 程序架子大概是這樣,排序查找什麼的網路搜下 演算法很多,套著每樣寫個方法就行了,測試就在main『方法里寫
publicclassMyList{
privateString[]arr;
privateintcount;
publicMyList(intcount){
arr=newString[count];
this.count=count;
}
publicMyList(int[]intArr){
arr=newString[intArr.length];
this.count=intArr.length;
for(inti=0;i<intArr.length;i++){
arr[i]=intArr[i]+"";
}
}
publicMyList(String[]stringArr){
arr=stringArr;
this.count=stringArr.length;
}
publicintgetLength(){
returncount;
}
//清空容器內的數組。
publicvoidclearAll(){
arr=newString[count];
}
//通過給定元素下標來刪除某一元素
publicvoidremoveBySeqn(intseqn){
if(seqn>=0&&seqn<count){
arr[seqn]=null;
}
}
publicstaticvoidmain(String[]args){
MyListlist=newMyList(40);
MyListlist1=newMyList({3,2,125,56,123});
MyListlist2=newMyList({"123",""ad});
list2.removeBySeqn(0);
list1.clearAll();
}
}
					