求C#自动组卷主要代码
要求写出一个类,根据试题库的难度生成试卷。如:一个方法:publicPaperProduce(intintDifficulty){}Paper是一个试卷对象给具体算法:选...
要求写出一个类,根据试题库的难度生成试卷。
如:一个方法:public Paper Produce(int intDifficulty){
}
Paper是一个试卷对象
给具体算法:
选择题表:selectid,selectname,pri(难度) 展开
如:一个方法:public Paper Produce(int intDifficulty){
}
Paper是一个试卷对象
给具体算法:
选择题表:selectid,selectname,pri(难度) 展开
展开全部
enum Difficulty {
beginng,
easy
normal,
advance,
expert
}
public class PaperFactory {
public static Paper Produce(Difficulty difficulty) {
}
}
public class Paper {
Difficulty Difficulty;
IEnumable<Question> Questions { get; set; }
}
public class Question {
Difficulty Difficulty;
}
To be continued...
beginng,
easy
normal,
advance,
expert
}
public class PaperFactory {
public static Paper Produce(Difficulty difficulty) {
}
}
public class Paper {
Difficulty Difficulty;
IEnumable<Question> Questions { get; set; }
}
public class Question {
Difficulty Difficulty;
}
To be continued...
展开全部
public Paper Produce(int intDifficulty)
{
Paper paper = new Paper();
switch(intDifficulty)
{
case 0:
paper = PaperService.getPaperByPri(intDifficulty);
break;
case 1:
paper = PaperService.getPaperByPri(intDifficulty);
break;
case 2:
paper = PaperService.getPaperByPri(intDifficulty);
break;
//……
}
return paper;
}
/**
* 数据连接层
*/
public class PaperService
{
public static Paper getPaperByPri(int pri)
{
string sql = "select * from paper where pri = "+pri;
//……
}
}
{
Paper paper = new Paper();
switch(intDifficulty)
{
case 0:
paper = PaperService.getPaperByPri(intDifficulty);
break;
case 1:
paper = PaperService.getPaperByPri(intDifficulty);
break;
case 2:
paper = PaperService.getPaperByPri(intDifficulty);
break;
//……
}
return paper;
}
/**
* 数据连接层
*/
public class PaperService
{
public static Paper getPaperByPri(int pri)
{
string sql = "select * from paper where pri = "+pri;
//……
}
}
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询