張正龍 陳永政 李冀明
【摘??要】在互聯網技術高速發展的今天,依然有很多學校使用傳統的手工組卷的方式生成試卷,方式組卷無疑是浪費了教師資源,花費了大量時間,對于題目來說有很多主觀的隨意性。而使用計算機技術就可以更好的解決手工組卷的不定的、有主觀的。針對傳統組卷局限性,開發了基于SSM架構自動組卷系統,通過遺傳算法生成試卷,大大的減輕了教師的工作量,提高了試卷的準確性,科學性。
【關鍵詞】組卷;SSM;遺傳算法
1.緒論
隨著教育水平提高和網絡發展,2019年高考人數突破1000萬,還不算初高中大學的人數,國內教師總人數達到了1600萬,即使有這么多教師,而教師在國內的缺口依然比較大,教師資源非常緊張,由此可知在教育行業對一款能夠節省教師時間,提高組卷效率的軟件有著迫切的需求。但在如此大的需求下,市面上卻沒有幾款自動組卷系統,更多的卻是在線答題系統等網上練習系統和一些教輔系統,因此自動組卷的研究有較高實用價值。
2.功能設計
擬開發基于SSM架構的自動組卷系統,提高了教師的工作效率,節省了教師的時間,同時提高了試卷的科學性和準確性,極大地提高教師組卷效率。本系統主要功能模塊有用戶信息模塊、教師信息模塊、院系信息模塊、班級信息模塊、課程信息模塊、角色信息模塊、試題類型模塊、知識點信息模塊、試卷信息模塊、試題類型模塊、組卷規則模塊、手動組卷信息模塊、自動組卷知識點模塊、自動組卷試題綁定模塊等。
3.遺傳算法自動組卷的功能實現
(1)初始化種群個數
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;
//保留上一代最優秀的個體
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?機械工業出版社[M].2016.
[2]??https://www.jianshu.com/p/ae5157c26af9?[DB/OL].
[3]??張峰.應用SpringBoot改變web應用開發模式[J].科技創新與應用.2017年23期.
(作者單位:重慶工程學院)