您好!我是岛上程序猿,感谢您阅读本文,欢迎一键三连哦。
在线考试的需求和管理上的不断提升,在线考试管理的潜力将无限扩大,在线考试系统在业界被广泛关注,本系统及对此进行总体分析,将在线考试信息管理的发展提供参考。在线考试系统对高校有着明显的带动效应,对管理帮助更大。
本系统主要包括管理员,学生和教师三个角色组成;主要包括:首页,个人中心,学生管理,教师管理,课程分类管理,课程信息管理,在线考试管理,试题管理,习题管理,考试管理等功能的管理系统。
开发语言:Java
框架:springboot
JDK版本:JDK1.8
服务器:tomcat7
数据库:mysql 5.7 (一定要5.7版本)
数据库工具:Navicat11
开发软件:eclipse/myeclipse/idea
Maven包:Maven3.3.9
浏览器:谷歌浏览器
为了更好的去理清本系统整体思路,对该系统以结构图的形式表达出来,设计实现该在线考试系统的功能结构图如下所示:
数据库E/R图
ER图是由实体及其关系构成的图,通过E/R图可以清楚地描述系统涉及到的实体之间的相互关系。在系统中对一些主要的几个关键实体如下图:
(1)课程信息E/R图如下所示:
(2)在线考试E/R图如下所示:
/**
* 通用接口
*/
@RestController
public class CommonController{
@Autowired
private CommonService commonService;
private static AipFace client = null;
@Autowired
private ConfigService configService;
/**
* 获取table表中的column列表(联动接口)
* @param table
* @param column
* @return
*/
@IgnoreAuth
@RequestMapping("/option/{tableName}/{columnName}")
public R getOption(@PathVariable("tableName") String tableName, @PathVariable("columnName") String columnName,String level,String parent) {
Map params = new HashMap();
params.put("table", tableName);
params.put("column", columnName);
if(StringUtils.isNotBlank(level)) {
params.put("level", level);
}
if(StringUtils.isNotBlank(parent)) {
params.put("parent", parent);
}
List data = commonService.getOption(params);
return R.ok().put("data", data);
}
/**
* 根据table中的column获取单条记录
* @param table
* @param column
* @return
*/
@IgnoreAuth
@RequestMapping("/follow/{tableName}/{columnName}")
public R getFollowByOption(@PathVariable("tableName") String tableName, @PathVariable("columnName") String columnName, @RequestParam String columnValue) {
Map params = new HashMap();
params.put("table", tableName);
params.put("column", columnName);
params.put("columnValue", columnValue);
Map result = commonService.getFollowByOption(params);
return R.ok().put("data", result);
}
/**
* 修改table表的sfsh状态
* @param table
* @param map
* @return
*/
@RequestMapping("/sh/{tableName}")
public R sh(@PathVariable("tableName") String tableName, @RequestBody Map map) {
map.put("table", tableName);
commonService.sh(map);
return R.ok();
}
/**
* 获取需要提醒的记录数
* @param tableName
* @param columnName
* @param type 1:数字 2:日期
* @param map
* @return
*/
@IgnoreAuth
@RequestMapping("/remind/{tableName}/{columnName}/{type}")
public R remindCount(@PathVariable("tableName") String tableName, @PathVariable("columnName") String columnName,
@PathVariable("type") String type,@RequestParam Map map) {
map.put("table", tableName);
map.put("column", columnName);
map.put("type", type);
if(type.equals("2")) {
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
Calendar c = Calendar.getInstance();
Date remindStartDate = null;
Date remindEndDate = null;
if(map.get("remindstart")!=null) {
Integer remindStart = Integer.parseInt(map.get("remindstart").toString());
c.setTime(new Date());
c.add(Calendar.DAY_OF_MONTH,remindStart);
remindStartDate = c.getTime();
map.put("remindstart", sdf.format(remindStartDate));
}
if(map.get("remindend")!=null) {
Integer remindEnd = Integer.parseInt(map.get("remindend").toString());
c.setTime(new Date());
c.add(Calendar.DAY_OF_MONTH,remindEnd);
remindEndDate = c.getTime();
map.put("remindend", sdf.format(remindEndDate));
}
}
int count = commonService.remindCount(map);
return R.ok().put("count", count);
}
/**
* 单列求和
*/
@IgnoreAuth
@RequestMapping("/cal/{tableName}/{columnName}")
public R cal(@PathVariable("tableName") String tableName, @PathVariable("columnName") String columnName) {
Map params = new HashMap();
params.put("table", tableName);
params.put("column", columnName);
Map result = commonService.selectCal(params);
return R.ok().put("data", result);
}
/**
* 分组统计
*/
@IgnoreAuth
@RequestMapping("/group/{tableName}/{columnName}")
public R group(@PathVariable("tableName") String tableName, @PathVariable("columnName") String columnName) {
Map params = new HashMap();
params.put("table", tableName);
params.put("column", columnName);
List
/**
* 课程分类
* 后端接口
* @author
* @email
* @date 2022-03-18 10:34:29
*/
@RestController
@RequestMapping("/kechengfenlei")
public class KechengfenleiController {
@Autowired
private KechengfenleiService kechengfenleiService;
/**
* 后端列表
*/
@RequestMapping("/page")
public R page(@RequestParam Map params,KechengfenleiEntity kechengfenlei,
HttpServletRequest request){
EntityWrapper ew = new EntityWrapper();
PageUtils page = kechengfenleiService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, kechengfenlei), params), params));
return R.ok().put("data", page);
}
/**
* 前端列表
*/
@IgnoreAuth
@RequestMapping("/list")
public R list(@RequestParam Map params,KechengfenleiEntity kechengfenlei,
HttpServletRequest request){
EntityWrapper ew = new EntityWrapper();
PageUtils page = kechengfenleiService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, kechengfenlei), params), params));
return R.ok().put("data", page);
}
/**
* 列表
*/
@RequestMapping("/lists")
public R list( KechengfenleiEntity kechengfenlei){
EntityWrapper ew = new EntityWrapper();
ew.allEq(MPUtil.allEQMapPre( kechengfenlei, "kechengfenlei"));
return R.ok().put("data", kechengfenleiService.selectListView(ew));
}
/**
* 查询
*/
@RequestMapping("/query")
public R query(KechengfenleiEntity kechengfenlei){
EntityWrapper< KechengfenleiEntity> ew = new EntityWrapper< KechengfenleiEntity>();
ew.allEq(MPUtil.allEQMapPre( kechengfenlei, "kechengfenlei"));
KechengfenleiView kechengfenleiView = kechengfenleiService.selectView(ew);
return R.ok("查询课程分类成功").put("data", kechengfenleiView);
}
/**
* 后端详情
*/
@RequestMapping("/info/{id}")
public R info(@PathVariable("id") Long id){
KechengfenleiEntity kechengfenlei = kechengfenleiService.selectById(id);
return R.ok().put("data", kechengfenlei);
}
/**
* 前端详情
*/
@IgnoreAuth
@RequestMapping("/detail/{id}")
public R detail(@PathVariable("id") Long id){
KechengfenleiEntity kechengfenlei = kechengfenleiService.selectById(id);
return R.ok().put("data", kechengfenlei);
}
/**
* 后端保存
*/
@RequestMapping("/save")
public R save(@RequestBody KechengfenleiEntity kechengfenlei, HttpServletRequest request){
kechengfenlei.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue());
//ValidatorUtils.validateEntity(kechengfenlei);
kechengfenleiService.insert(kechengfenlei);
return R.ok();
}
/**
* 前端保存
*/
@RequestMapping("/add")
public R add(@RequestBody KechengfenleiEntity kechengfenlei, HttpServletRequest request){
kechengfenlei.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue());
//ValidatorUtils.validateEntity(kechengfenlei);
kechengfenleiService.insert(kechengfenlei);
return R.ok();
}
/**
* 修改
*/
@RequestMapping("/update")
public R update(@RequestBody KechengfenleiEntity kechengfenlei, HttpServletRequest request){
//ValidatorUtils.validateEntity(kechengfenlei);
kechengfenleiService.updateById(kechengfenlei);//全部更新
return R.ok();
}
/**
* 删除
*/
@RequestMapping("/delete")
public R delete(@RequestBody Long[] ids){
kechengfenleiService.deleteBatchIds(Arrays.asList(ids));
return R.ok();
}
/**
* 提醒接口
*/
@RequestMapping("/remind/{columnName}/{type}")
public R remindCount(@PathVariable("columnName") String columnName, HttpServletRequest request,
@PathVariable("type") String type,@RequestParam Map map) {
map.put("column", columnName);
map.put("type", type);
if(type.equals("2")) {
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
Calendar c = Calendar.getInstance();
Date remindStartDate = null;
Date remindEndDate = null;
if(map.get("remindstart")!=null) {
Integer remindStart = Integer.parseInt(map.get("remindstart").toString());
c.setTime(new Date());
c.add(Calendar.DAY_OF_MONTH,remindStart);
remindStartDate = c.getTime();
map.put("remindstart", sdf.format(remindStartDate));
}
if(map.get("remindend")!=null) {
Integer remindEnd = Integer.parseInt(map.get("remindend").toString());
c.setTime(new Date());
c.add(Calendar.DAY_OF_MONTH,remindEnd);
remindEndDate = c.getTime();
map.put("remindend", sdf.format(remindEndDate));
}
}
Wrapper wrapper = new EntityWrapper();
if(map.get("remindstart")!=null) {
wrapper.ge(columnName, map.get("remindstart"));
}
if(map.get("remindend")!=null) {
wrapper.le(columnName, map.get("remindend"));
}
int count = kechengfenleiService.selectCount(wrapper);
return R.ok().put("count", count);
}
}