基于javaweb+ssh的课程资源管理在线考试平台(java+SSH+mysql+maven+tomcat)

一、项目简述
功能包括: 管理员可以增删改查教材、教材商、入库教材、用户(用 户包括学生和教师)可以对教材商、教材进行。xcel的导入 导出操作。教师可以领取入库的教材,可以退还教材。学 生只能在对应的教师那里领取教材,并且可以退还教材、 查询自己已经领取的教材。并且对已领教材付款等等。

二、项目运行
环境配置: Jdk1.8 + Tomcat8.5 + mysql + Eclispe (IntelliJ IDEA,Eclispe,MyEclispe,Sts 都支持)

项目技术: JSP +Struts+Spring+Hibernate + html+ css + JavaScript + JQuery + Ajax等等。

请添加图片描述
请添加图片描述
请添加图片描述
请添加图片描述
请添加图片描述

适用

课程设计,大作业,毕业设计,项目练习,学习演示等

    }
    /**
     * 管理员 查询院系列表
     */
    @RequestMapping(value = "/department/qryPage", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"})
    @RoleAnnotation(types = {RoleEnum.admin})
    public ListResult<Department> qryPage(HttpRequest request) {
        Map<String, Object> param = new HashMap<>();
        int pageNo = request.containsKey("page_no") ? request.getInteger("page_no") : 1;
        int pageSize = request.containsKey("page_size") ? request.getInteger("page_size") : 20;
        if (request.containsKey("department_id")) {
            param.put("department_id", request.getString("department_id"));
        }
        if (request.containsKey("department_name")) {
            param.put("department_name", request.getString("department_name"));
        }
        return departmentService.qryPage(param, pageNo, pageSize);
    }
    /**
     * 管理员 添加院系
     */
    @RequestMapping(value = "/department/add", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"})
        String urlId = request.getString("url_id");
        Token token = TokenCache.getInstance().get(urlId);
        if(token == null){
            ExceptionHelper.error(ErrorCode.ERROR_CODE_0003);
        }
        try {
            Claims claims = TokenUtils.parseToken(refreshToken);
            if (StringUtils.isNotEmpty((String.valueOf(claims.getOrDefault("student_id", ""))))) {
                claims.put("student_id", SessionContext.get("student_id"));
            }
            if (StringUtils.isNotEmpty((String.valueOf(claims.getOrDefault("teacher_id", ""))))) {
                claims.put("teacher_id", SessionContext.get("teacher_id"));
            }
            if (StringUtils.isNotEmpty((String.valueOf(claims.getOrDefault("login_name", ""))))) {
                claims.put("login_name", SessionContext.get("login_name"));
            }
            claims.put("name", claims.get("name"));
            token.setToken(TokenUtils.createToken(claims, TokenUtils.expireTime));
            token.setRefreshToken(TokenUtils.createToken(claims, TokenUtils.long_expireTime));
        Map<String, Object> param = new HashMap<>();
        int pageNo = request.containsKey("page_no") ? request.getInteger("page_no") : 1;
        int pageSize = request.containsKey("page_size") ? request.getInteger("page_size") : 20;
        return examInfoService.qryPage(param, pageNo, pageSize);
    }
    /**
     * 教师 添加新的考试信息
     */
    @RequestMapping(value = "/examinfo/add", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"})
    @RoleAnnotation(types = {RoleEnum.teacher})
    public Result<ExamInfo> insert(HttpRequest request) {
        ExamInfo exam = new ExamInfo();
        exam.setTestPaperId(request.getInteger("test_paper_id"));
        exam.setClassId(request.getString("class_id"));
 */
@RestController
public class ExamInfoController {
    @Resource(name = "examInfoService")
    private IExamInfoService examInfoService;
    /**
     * 教师 查询考试列表
     */
    @RequestMapping(value = "/examinfo/qryPage", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"})
    @RoleAnnotation(types = {RoleEnum.teacher})
    public ListResult<ExamInfo> exam(HttpRequest request) {
        Map<String, Object> param = new HashMap<>();
        int pageNo = request.containsKey("page_no") ? request.getInteger("page_no") : 1;
        int pageSize = request.containsKey("page_size") ? request.getInteger("page_size") : 20;
        return examInfoService.qryPage(param, pageNo, pageSize);
    }
    /**
     * 教师 添加新的考试信息
     */
    @RequestMapping(value = "/examinfo/add", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"})
    @RoleAnnotation(types = {RoleEnum.teacher})
    public Result<ExamInfo> insert(HttpRequest request) {
        ExamInfo exam = new ExamInfo();
    @RequestMapping(value = "/examinfo/qryMarkQueList", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"})
    @RoleAnnotation(types = {RoleEnum.teacher})
    public Result<StudentExamQuestionRecord> qryMarkQueList(HttpRequest request) {
        return examInfoService.qryMarkQueList(request.getInteger("exam_id"), request.getString("student_id"), request.getInteger("question_group_id"));
    }
    /**
     * 教师 记录学生考试分数 complete
     */
    @RequestMapping(value = "/examinfo/updateQueScore", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"})
    @RoleAnnotation(types = {RoleEnum.teacher})
    public Result<ExamInfo> updateQueScore(HttpRequest request) {
        StudentExamQuestionRecord record = new StudentExamQuestionRecord();
        record.setExamId(request.getInteger("exam_id"));
        record.setStudentId(request.getString("student_id"));
        record.setQuestionGroupId(request.getInteger("question_group_id"));
        record.setQuestionId(request.getLong("question_id"));
        record.setScore(request.getFloat("score"));
        record.setCorrect(request.getBoolean("correct"));
        return examInfoService.updateQueScore(record);
    }
    /**
     * 教师 完成评分
     */
    @RequestMapping(value = "/examinfo/complete", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"})
    @RoleAnnotation(types = {RoleEnum.teacher})
    public Result<ExamInfo> complete(HttpRequest request) {
    /**
     * 教师 完成评分
     */
    @RequestMapping(value = "/examinfo/complete", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"})
    @RoleAnnotation(types = {RoleEnum.teacher})
    public Result<ExamInfo> complete(HttpRequest request) {
        return examInfoService.complete(request.getInteger("exam_id"),
                request.getString("student_id"));
    }
}
院系管理控制器:
/**
 * 院系管理控制器
 */
@RestController
public class DepartmentController {
    @Resource(name = "departmentService")
    private IDepartmentService departmentService;
    /**
     * 查询所有院系
     */
    @RequestMapping(value = "/department/qryAllList", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"})
    @RoleAnnotation(types = {RoleEnum.admin})
    }
    /**
     * 管理员 添加院系
     */
    @RequestMapping(value = "/department/add", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"})
    @RoleAnnotation(types = {RoleEnum.admin})
    public Result<Department> insert(HttpRequest request) {
        Department department = new Department();
        department.setDepartmentId(request.getString("department_id"));
        department.setDepartmentName(request.getString("department_name"));
        department.setUpdateTime(new Date());
        return departmentService.insert(department);
    }
    /**
     * 管理员 更新院系
     */
    @RequestMapping(value = "/department/update", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"})
    @RoleAnnotation(types = {RoleEnum.admin})
    public Result<Department> update(HttpRequest request) {
        record.setExamId(request.getInteger("exam_id"));
        record.setStudentId(request.getString("student_id"));
        record.setQuestionGroupId(request.getInteger("question_group_id"));
        record.setQuestionId(request.getLong("question_id"));
        record.setScore(request.getFloat("score"));
        record.setCorrect(request.getBoolean("correct"));
        return examInfoService.updateQueScore(record);
    }
    /**
     * 教师 完成评分
     */
    @RequestMapping(value = "/examinfo/complete", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"})
    @RoleAnnotation(types = {RoleEnum.teacher})
    public Result<ExamInfo> complete(HttpRequest request) {
        return examInfoService.complete(request.getInteger("exam_id"),
                request.getString("student_id"));
        if (request.containsKey("department_id")) {
            param.put("department_id", request.getString("department_id"));
        }
        if (request.containsKey("department_name")) {
            param.put("department_name", request.getString("department_name"));
        }
        return departmentService.qryPage(param, pageNo, pageSize);
    }
    /**
     * 管理员 添加院系
     */
    @RequestMapping(value = "/department/add", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"})
    @RoleAnnotation(types = {RoleEnum.admin})
    public Result<Department> insert(HttpRequest request) {
        Department department = new Department();
        department.setDepartmentId(request.getString("department_id"));
        department.setDepartmentName(request.getString("department_name"));
        department.setUpdateTime(new Date());
        return departmentService.insert(department);
    }
    /**
     * 管理员 更新院系
     */
    @RequestMapping(value = "/department/update", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"})
    @RoleAnnotation(types = {RoleEnum.admin})
    public Result<Department> update(HttpRequest request) {
        Department department = new Department();
        department.setUpdateTime(new Date());
        return departmentService.update(department);
    }
    /**
     * 管理员 删除院系
     */
    @RequestMapping(value = "/department/del", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"})
    @RoleAnnotation(types = {RoleEnum.admin})
    public Result<Department> del(HttpRequest request) {
        List<String> departmentIdList = new ArrayList<>();
        JSONArray array = request.getJSONArray("department_id_list");
        for (int i = 0; i < array.size(); i++) {
            departmentIdList.add(array.getString(i));
        }
        return departmentService.del(departmentIdList);

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
在用户界面部分,根据需求分析的结果,用户需要一个用户友善界面。在界面设计上,应做到简单明了,易于操作,并且要注意到界面的布局,应突出的显示重要以及出错信息。外观上也要做到合理化,考虑到用户多对网页较熟悉,应尽量向这一方向靠拢。在设计语言上,已决定使用 Java 语言进行编程。 其中管理界面要做到操作简单,易于管理。总的来说,系统的用户界面应作到可靠性、简单性、易学习和使用。 2.4.2 外部接口 硬件接口,在输入方面对于键盘鼠标的输入用标准的输入/输出,对输入进行处理。在输出方面的屏幕和打印机连接以及使用用标准的输入输出进行处理。 2.4.3 内部接口 各模块之间采用函数调用,参数传递,返回值的方式进行信息传递。接口传递的信息将是以数据结构封装了的数据,以参数传递或返回值的形式在各模块间传输 2.5 运行设计 运行程序,执行登录模块,如果是新用户,就进入注册模块,已注册的用户直接进行身份验证进入主界面,通过主界面可以进行在线考试,此时执行考试模块,也可以查询考试成绩、修改个人资料等功能。 2.6 系统数据库设计 数据库是本系统核心和基础。它把本中大量的数据按一定的模型组织起来,提供存储、维护、检索数据的功能,使信息系统可以方便、及时、准确地从数据库中获得所需的信息。 2.6.1 数据库概念设计 开发在线考试系统时,为了灵活地维护系统,设计了后台管理员模块,通过后台管理员模块可以方便地对整个在线考试系统进行维护。这时,必须建立一个数据表用于存储所有的管理员信息。管理员信息实体E-R 图如图6所示。当考生成功登录在线考试系统后,可以根据需要选择考试的科目,考生不同可能选择的考试科目会不同,系统必须提供一些参加考试课程,供考生选择。这时,在数据库中应该建立一个存储所有参加课程的数据表。考试课程信息实体E-R图如图7所示。 

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值