微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

SSM+Vue+Element-UI实现四六级在线考试系统

文末获取源码

开发语言:Java
框架:ssm
JDK版本:JDK1.8
服务器:tomcat7
数据库MysqL 5.7/8.0
数据库工具:Navicat11
开发软件:eclipse/myeclipse/idea
Maven包:Maven3.3.9
浏览器:谷歌浏览器

前言介绍 

随着现在网络的快速发展,网上管理系统也逐渐快速发展起来,网上管理模式很快融入到了许多学院的之中,随之就产生了“四六级在线考试系统”,这样就让四六级在线考试系统更加方便简单。

对于本四六级在线考试系统的设计来说,系统开发主要是采用java语言技术,在整个系统的设计中应用MysqL数据库来完成数据存储,具体根据四六级在线考试系统的现状来进行开发的,具体根据现实的需求来实现四六级在线考试系统网络化的管理,各类信息有序地进行存储,进入四六级在线考试系统页面之后,方可开始操作主控界面,主要功能包括管理员首页、个人中心、用户管理、考试成绩管理、公告通知管理、考生通知管理、试题管理、试卷管理、考试管理,用户首页、个人中心、考试成绩管理、公告通知管理、考生通知管理、考试管理等功能

本论文主要讲述了四六级在线考试系统开发背景,该系统它主要是对需求分析和功能需求做了介绍,并且对系统做了详细的测试和总结。具体从业务流程、数据库设计和系统结构等多方面的问题。望能利用先进的计算机技术和网络技术来改变目前的四六级在线考试系统状况,提高管理效率。

系统功能需求分析 

对于一个新的网站来说开发新网站我们就要做出这个系统的任务需求分析,因为对系统分析的质量好坏它可以决定这个网站开发的意义,俗话说得好一个好的开头是成功的一半,对于开发这个四六级在线考试系统来说前期的分析是比较重要的,所以任务分析它可以决定这系统的开展和设计,这样就可以保证用户满意性。

任务的需求它能决定这个系统开发过程当中一个重要环节,所以我们在系统开发过程所用质量是比较重要的,因为我们在系统应用过程当中不一定那会出现问题,所以我们在进行对系统分析是比较重要的,因为它可以决定这个系统功能和需求。

本课题要求实现一套四六级在线考试系统的开发与实现,主要实现功能包括管理员首页、个人中心、用户管理、考试成绩管理、公告通知管理、考生通知管理、试题管理、试卷管理、考试管理,用户首页、个人中心、考试成绩管理、公告通知管理、考生通知管理、考试管理。

(1)管理员用例需求如图

(2)用户用例需求如图

系统的功能结构图

通过系统需求分析,本四六级在线考试系统主要实现功能包括管理员首页、个人中心、用户管理、考试成绩管理、公告通知管理、考生通知管理、试题管理、试卷管理、考试管理,用户首页、个人中心、考试成绩管理、公告通知管理、考生通知管理、考试管理等功能。其功能结构图如下图 

管理员登录实现

管理员登录,通过填写用户名、密码、角色等信息,输入完成后选择登录即可进入四六级在线考试系统,如图 

用户管理

管理员用户管理进行填写账号、密码、姓名、性别、年龄、电话、邮箱、身份证、照片并进行详情、删除修改用户管理效果图如图

考试成绩管理

管理员考试成绩管理获取账号、姓名、科目、成绩、状态、日期等信息进行详情、删除修改操作。考试成绩管理效果图如图

试卷管理

管理员对试卷管理进行编辑试卷名称、考试时长、试卷状态等信息进行详情、删除修改操作。试卷管理效果图如图 

试题管理

管理员对试题管理可以查看试卷、试题名称、分值、答案、类型等信息进行详情、删除修改操作。试题管理效果图如图 

公告通知管理

管理员对公告通知管理可以查看通知、类型、日期等信息进行详情、删除修改操作。公告通知管理效果图如图 

考生通知管理

管理员对考生通知管理可以查看账号、姓名、科目、通知、日期等信息进行详情、删除修改操作。考生通知管理效果图如图 

用户功能实现 

个人信息

用户进入个人信息可以查看账号、密码、姓名、性别、年龄、电话、邮箱、身份证、照片等信息进行详情。个人信息效果图如图

考试成绩管理

用户对考试成绩管理进行查看账号、姓名、科目、成绩、状态、日期等信息。考试成绩管理效果图如图 

考生通知管理

用户对考生通知管理进行查看账号、姓名、科目、通知、日期等信息。考生通知管理效果图如图

 

考试记录

用户对考试记录进行查看用户ID、试卷、试题名称、分值、正确答案、考生答案、考生分值、考试时间等信息。考试记录效果图如图 

部分核心代码

登录相关

@RequestMapping("config")
@RestController
public class ConfigController{
	
	@Autowired
	private ConfigService configService;

	/**
     * 列表
     */
    @RequestMapping("/page")
    public R page(@RequestParam Map<String, Object> params,ConfigEntity config){
        EntityWrapper<ConfigEntity> ew = new EntityWrapper<ConfigEntity>();
    	PageUtils page = configService.queryPage(params);
        return R.ok().put("data", page);
    }
    
	/**
     * 列表
     */
    @IgnoreAuth
    @RequestMapping("/list")
    public R list(@RequestParam Map<String, Object> params,ConfigEntity config){
        EntityWrapper<ConfigEntity> ew = new EntityWrapper<ConfigEntity>();
    	PageUtils page = configService.queryPage(params);
        return R.ok().put("data", page);
    }

    /**
     * 信息
     */
    @RequestMapping("/info/{id}")
    public R info(@PathVariable("id") String id){
        ConfigEntity config = configService.selectById(id);
        return R.ok().put("data", config);
    }
    
    /**
     * 详情
     */
    @IgnoreAuth
    @RequestMapping("/detail/{id}")
    public R detail(@PathVariable("id") String id){
        ConfigEntity config = configService.selectById(id);
        return R.ok().put("data", config);
    }
    
    /**
     * 根据name获取信息
     */
    @RequestMapping("/info")
    public R infoByName(@RequestParam String name){
        ConfigEntity config = configService.selectOne(new EntityWrapper<ConfigEntity>().eq("name", "faceFile"));
        return R.ok().put("data", config);
    }
    
    /**
     * 保存
     */
    @PostMapping("/save")
    public R save(@RequestBody ConfigEntity config){
//    	ValidatorUtils.validateEntity(config);
    	configService.insert(config);
        return R.ok();
    }

    /**
     * 修改
     */
    @RequestMapping("/update")
    public R update(@RequestBody ConfigEntity config){
//        ValidatorUtils.validateEntity(config);
        configService.updateById(config);//全部更新
        return R.ok();
    }

    /**
     * 删除
     */
    @RequestMapping("/delete")
    public R delete(@RequestBody Long[] ids){
    	configService.deleteBatchIds(Arrays.asList(ids));
        return R.ok();
    }
}

上传文件

*/
@RestController
@RequestMapping("file")
@SuppressWarnings({"unchecked","rawtypes"})
public class FileController{
	@Autowired
    private ConfigService configService;
	/**
	 * 上传文件
	 */
	@RequestMapping("/upload")
	public R upload(@RequestParam("file") multipartfile file, String type,HttpServletRequest request) throws Exception {
		if (file.isEmpty()) {
			throw new EIException("上传文件不能为空");
		}
		String fileExt = file.getoriginalFilename().substring(file.getoriginalFilename().lastIndexOf(".")+1);
		String fileName = new Date().getTime()+"."+fileExt;
		File dest = new File(request.getSession().getServletContext().getRealPath("/upload")+"/"+fileName);
		file.transferTo(dest);
		if(StringUtils.isNotBlank(type) && type.equals("1")) {
			ConfigEntity configEntity = configService.selectOne(new EntityWrapper<ConfigEntity>().eq("name", "faceFile"));
			if(configEntity==null) {
				configEntity = new ConfigEntity();
				configEntity.setName("faceFile");
				configEntity.setValue(fileName);
			} else {
				configEntity.setValue(fileName);
			}
			configService.insertOrUpdate(configEntity);
		}
		return R.ok().put("file", fileName);
	}
	
	/**
	 * 下载文件
	 */
	@IgnoreAuth
	@RequestMapping("/download")
	public void download(@RequestParam String fileName, HttpServletRequest request, HttpServletResponse response) {
		try {
			File file = new File(request.getSession().getServletContext().getRealPath("/upload")+"/"+fileName);
			if (file.exists()) {
				response.reset();
				response.setHeader("Content-disposition", "attachment; filename=\"" + fileName+"\"");
				response.setHeader("Cache-Control", "no-cache");
				response.setHeader("Access-Control-Allow-Credentials", "true");
				response.setContentType("application/octet-stream; charset=UTF-8");
				IoUtils.write(FileUtils.readFiletoByteArray(file), response.getoutputStream());
			}

		} catch (IOException e) {
			e.printstacktrace();
		}
	}
	
}

考试成绩

* @author 
 * @email 
 * @date 2021-02-25 09:39:54
 */
@RestController
@RequestMapping("/kaoshichengji")
public class KaoshichengjiController {
    @Autowired
    private KaoshichengjiService kaoshichengjiService;
    


    /**
     * 后端列表
     */
    @RequestMapping("/page")
    public R page(@RequestParam Map<String, Object> params,KaoshichengjiEntity kaoshichengji, HttpServletRequest request){

		String tableName = request.getSession().getAttribute("tableName").toString();
		if(tableName.equals("yonghu")) {
			kaoshichengji.setZhanghao((String)request.getSession().getAttribute("username"));
		}
        EntityWrapper<KaoshichengjiEntity> ew = new EntityWrapper<KaoshichengjiEntity>();
		PageUtils page = kaoshichengjiService.queryPage(params, mputil.sort(mputil.between(mputil.likeOrEq(ew, kaoshichengji), params), params));
        return R.ok().put("data", page);
    }
    
    /**
     * 前端列表
     */
    @RequestMapping("/list")
    public R list(@RequestParam Map<String, Object> params,KaoshichengjiEntity kaoshichengji, HttpServletRequest request){
        EntityWrapper<KaoshichengjiEntity> ew = new EntityWrapper<KaoshichengjiEntity>();
		PageUtils page = kaoshichengjiService.queryPage(params, mputil.sort(mputil.between(mputil.likeOrEq(ew, kaoshichengji), params), params));
        return R.ok().put("data", page);
    }

	/**
     * 列表
     */
    @RequestMapping("/lists")
    public R list( KaoshichengjiEntity kaoshichengji){
       	EntityWrapper<KaoshichengjiEntity> ew = new EntityWrapper<KaoshichengjiEntity>();
      	ew.allEq(mputil.allEQMapPre( kaoshichengji, "kaoshichengji")); 
        return R.ok().put("data", kaoshichengjiService.selectListView(ew));
    }

	 /**
     * 查询
     */
    @RequestMapping("/query")
    public R query(KaoshichengjiEntity kaoshichengji){
        EntityWrapper< KaoshichengjiEntity> ew = new EntityWrapper< KaoshichengjiEntity>();
 		ew.allEq(mputil.allEQMapPre( kaoshichengji, "kaoshichengji")); 
		KaoshichengjiView kaoshichengjiView =  kaoshichengjiService.selectView(ew);
		return R.ok("查询考试成绩成功").put("data", kaoshichengjiView);
    }
	
    /**
     * 后端详情
     */
    @RequestMapping("/info/{id}")
    public R info(@PathVariable("id") Long id){
        KaoshichengjiEntity kaoshichengji = kaoshichengjiService.selectById(id);
        return R.ok().put("data", kaoshichengji);
    }

    /**
     * 前端详情
     */
    @RequestMapping("/detail/{id}")
    public R detail(@PathVariable("id") Long id){
        KaoshichengjiEntity kaoshichengji = kaoshichengjiService.selectById(id);
        return R.ok().put("data", kaoshichengji);
    }
    



    /**
     * 后端保存
     */
    @RequestMapping("/save")
    public R save(@RequestBody KaoshichengjiEntity kaoshichengji, HttpServletRequest request){
    	kaoshichengji.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue());
    	//ValidatorUtils.validateEntity(kaoshichengji);

        kaoshichengjiService.insert(kaoshichengji);
        return R.ok();
    }
    
    /**
     * 前端保存
     */
    @RequestMapping("/add")
    public R add(@RequestBody KaoshichengjiEntity kaoshichengji, HttpServletRequest request){
    	kaoshichengji.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue());
    	//ValidatorUtils.validateEntity(kaoshichengji);

        kaoshichengjiService.insert(kaoshichengji);
        return R.ok();
    }

    /**
     * 修改
     */
    @RequestMapping("/update")
    public R update(@RequestBody KaoshichengjiEntity kaoshichengji, HttpServletRequest request){
        //ValidatorUtils.validateEntity(kaoshichengji);
        kaoshichengjiService.updateById(kaoshichengji);//全部更新
        return R.ok();
    }
    

    /**
     * 删除
     */
    @RequestMapping("/delete")
    public R delete(@RequestBody Long[] ids){
        kaoshichengjiService.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<String, Object> 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<KaoshichengjiEntity> wrapper = new EntityWrapper<KaoshichengjiEntity>();
		if(map.get("remindstart")!=null) {
			wrapper.ge(columnName, map.get("remindstart"));
		}
		if(map.get("remindend")!=null) {
			wrapper.le(columnName, map.get("remindend"));
		}

		String tableName = request.getSession().getAttribute("tableName").toString();
		if(tableName.equals("yonghu")) {
			wrapper.eq("zhanghao", (String)request.getSession().getAttribute("username"));
		}

		int count = kaoshichengjiService.selectCount(wrapper);
		return R.ok().put("count", count);
	}
	


}

原文地址:https://www.jb51.cc/wenti/3285479.html

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。

相关推荐