張正龍 陳永政 李冀明
【摘??要】在互聯(lián)網(wǎng)技術(shù)高速發(fā)展的今天,依然有很多學校使用傳統(tǒng)的手工組卷的方式生成試卷,方式組卷無疑是浪費了教師資源,花費了大量時間,對于題目來說有很多主觀的隨意性。而使用計算機技術(shù)就可以更好的解決手工組卷的不定的、有主觀的。針對傳統(tǒng)組卷局限性,開發(fā)了基于SSM架構(gòu)自動組卷系統(tǒng),通過遺傳算法生成試卷,大大的減輕了教師的工作量,提高了試卷的準確性,科學性。
【關(guān)鍵詞】組卷;SSM;遺傳算法
1.緒論
隨著教育水平提高和網(wǎng)絡(luò)發(fā)展,2019年高考人數(shù)突破1000萬,還不算初高中大學的人數(shù),國內(nèi)教師總?cè)藬?shù)達到了1600萬,即使有這么多教師,而教師在國內(nèi)的缺口依然比較大,教師資源非常緊張,由此可知在教育行業(yè)對一款能夠節(jié)省教師時間,提高組卷效率的軟件有著迫切的需求。但在如此大的需求下,市面上卻沒有幾款自動組卷系統(tǒng),更多的卻是在線答題系統(tǒng)等網(wǎng)上練習系統(tǒng)和一些教輔系統(tǒng),因此自動組卷的研究有較高實用價值。
2.功能設(shè)計
擬開發(fā)基于SSM架構(gòu)的自動組卷系統(tǒng),提高了教師的工作效率,節(jié)省了教師的時間,同時提高了試卷的科學性和準確性,極大地提高教師組卷效率。本系統(tǒng)主要功能模塊有用戶信息模塊、教師信息模塊、院系信息模塊、班級信息模塊、課程信息模塊、角色信息模塊、試題類型模塊、知識點信息模塊、試卷信息模塊、試題類型模塊、組卷規(guī)則模塊、手動組卷信息模塊、自動組卷知識點模塊、自動組卷試題綁定模塊等。
3.遺傳算法自動組卷的功能實現(xiàn)
(1)初始化種群個數(shù)
public?Population(int?size,boolean?init,Rule?rule){
init(size);
if(init){
Paper?paper;
Random?random?=?new?Random();
for(int?i?=?0;i?
paper?=?new?Paper();
paper.setId(i?+?1);
while(paper.getTotalScore()!=?rule.getExceptScore()){
paper.clearQuestion();
List
}
paper.getKpCoverage(rule);
paper.setAdaptationDegree(rule,Global.KP_WEIGHT,Global.DIFFICULTY_WEIGHT);
paperList.add(paper);
}
}
}
(2)選擇
public?static?Population?evolvePopulation(Population?population,Rule?rule){
Population?newPop?=?new?Population(population.size());
int?elitismOffset;
//精英主義
if(ELITISM){
elitismOffset?=?1;
//保留上一代最優(yōu)秀的個體
Paper?fitness?=?population.getFitness();
fitness.setId(0);
newPop.setPaper(0,fitness);
}
//種群交叉
for(int?i?=?elitismOffset;i?
Paper?paper1?=?select(population);
Paper?paper2?=?select(population);
while(paper1.getId()==?paper2.getId()){
paper2?=select(population);
}
}
return?population;
}
(3)交叉算子
public?static?Paper?crossover(Paper?paper1,Paper?paper2,Rule?rule){
Paper?child?=?new?Paper(paper1.getQuestionSize());
int?s1?=(int)(Math.random()*?paper1.getQuestionSize());
int?s2?=(int)(Math.random()*?paper1.getQuestionSize());
int?start?=?Math.min(s1,s2);
int?end?=?Math.max(s1,s2);
for(int?i?=?start;i?
child.saveQuestion(i,paper1.getQuestion(i));
}
List
for(int?i?=?0;i?
if(!child.containsQuestion(paper2.getQuestion(i))){
child.saveQuestion(i,paper2.getQuestion(i));
}else?{
int?type?=?getTypeByIndex(i,rule);
}
}
for(int?i?=?end;i?
if(!child.containsQuestion(paper2.getQuestion(i))){
child.saveQuestion(i,paper2.getQuestion(i));
}else?{
int?type?=?getTypeByIndex(i,rule);
}
}
return?child;
}
參考文獻:
[1]??陳韶鍵.深入理解spring?boot?機械工業(yè)出版社[M].2016.
[2]??https://www.jianshu.com/p/ae5157c26af9?[DB/OL].
[3]??張峰.應(yīng)用SpringBoot改變web應(yīng)用開發(fā)模式[J].科技創(chuàng)新與應(yīng)用.2017年23期.
(作者單位:重慶工程學院)