Code Monkey home page Code Monkey logo

lsgwr / spring-boot-online-exam Goto Github PK

View Code? Open in Web Editor NEW
1.5K 40.0 540.0 3.45 MB

基于Spring Boot的在线考试系统(预览地址 http://129.211.88.191 ,账户分别是admin、teacher、student,密码是admin123),也有Python实现

Home Page: https://gitee.com/lsgwr/spring-boot-online-exam

License: MIT License

Java 30.96% Dockerfile 0.04% Shell 0.10% JavaScript 16.95% HTML 0.56% Vue 47.81% Less 3.58%
exam springboot spring vue web

spring-boot-online-exam's Introduction

spring-boot-online-exam

在线Demo预览,http://129.211.88.191 ,账户分别是admin、teacher、student,密码是admin123。视频讲解代码:https://www.bilibili.com/video/BV1FP4y1L7xt/

好消息!!!一个小伙伴做了Python实现,欢迎大家star:https://github.com/xingxingzaixian/django-drf-online-exam

1.快速体验

1.1 事先准备

clone代码并进入代码路径

git clone [email protected]:lsgwr/spring-boot-online-exam.git
cd spring-boot-online-exam

下面按照Linux和windows说明快速搭建的方法

1.2 Linux

执行代码下的脚本start.sh即可

然后访问 http://ip:80 即可访问自己搭建的考试系统

1.3 windows

  • 1.安装JDK,推荐JDK8
  • 2.从官方仓库下载发布的jar包,建议选择最新版:https://github.com/lsgwr/spring-boot-online-exam/releases
  • 3.安装MySQL,创建数据库exam,并初始化密码为aA111111,导入doc/sql/exam.sql文件来创建数据库
  • 4.启动jar包:java -jar exam.jar
  • 5.访问:http://ip:9527 即可访问自己搭建的考试系统

2.介绍

基于springboot的在线考试系统

2.1 功能简介

  • 支持单选题、多选题、判断题
  • 支持学生(student)、教师(teacher)、管理员(admin)三种角色
    • 学生:参加考试和查看我的考试
    • 教师:学生的所有权限+创建/编辑题目+创建/编辑考试
    • 管理员:教师的所有权限+管理用户

2.3 软件架构

前后端分离,前段组件化,方便二次开发;后端

  • 后端采用SpringBoot+JPA++Swagger2+JWT校验,根据不同用户的权限返回给用户不同的数据
  • 后端采用Vue+AntDesign,组件化拆分,封装了很多年公共组件,方便维护和二次开发

2.3 使用教程

  • 1.下载代码
    git clone https://github.com/19920625lsg/spring-boot-online-exam.git
  • 2.初始化数据库

    安装mysql的步骤这里省略,网上的教程很多。安装好mysql后,新建exam数据库,密码和spring-boot-online-exam/backend/exam/src/main/resources/application.ymlpassword: xxxxxx保持一致,然后导入spring-boot-online-exam/doc/sql/exam.sql

  • 3.启动后端

    打开spring-boot-online-exam/backend/exam这个Maven项目,可以在IDE里启动或者执行mvn install生成jar包启动

  • 4.启动前端
    • 进入到前端代码路径 cd spring-boot-online-exam/frontend/exam/
    • 安装依赖 npm install
    • 启动前端 npm run serve
  • 5.部署完毕,查看效果

    打开 http://localhost:8000 或者 http://本机ip:8000 即可查看演示效果

3.功能图示

  • 1.管理题目
    • 1.1 题目列表

      题目查看

    • 1.2 题目创建

      题目创建

    • 1.3 题目更新

      题目更新

  • 2.考试管理
    • 2.1 考试列表

      考试查看

    • 2.2 考试创建

      考试创建

    • 2.3 考试更新(还有点小bug,开发中)

      考试更新

  • 3.我的考试
    • 3.1 参加考试

      在"考试列表"模块点击自己想参加的考试卡片即可 参加考试1 参加考试2

    • 3.2 考试记录查看

      考试记录查看

4.参与贡献

  1. Fork 本仓库
  2. 新建 exam_xxx 分支
  3. 提交代码
  4. 新建 Pull Request

5.Todo

  • 0.修复issue提地bug:题目创建失败
  • 1.考试详情编辑
  • 2.支持题目和考试的删除删除的话比较麻烦,先不做了,最好是弄个visible字段,不实际删除,要不后面有些关联数据找不到就不好了

    如果题目有关联的考试则必须先删除对应的考试,反过来删除考试则不用删除题目

  • 3.图片改成base64存到数据库中
  • 4.题干和选项支持富文本
  • 5.支持批量导入题目
  • 6.新增用户管理、学科管理功能
  • 7.老师能考到所有学生的成绩以及考试的统计信息
  • 8.更多的数据分析功能
  • 9.支持容器化一键式部署(编好Dockerfile)
  • 10.支持移动端,最好用uniapp做
  • ......抓紧做吧,争取每周末做一点......

spring-boot-online-exam's People

Contributors

dependabot[bot] avatar lsgwr avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

spring-boot-online-exam's Issues

Linux下运行start.sh报错

Linux下运行start.sh报错:
Error response from daemon: Container ba37672916ddb50694ab7a168881c0454d96da482480a4bf9f48c875f57147a7 is not running

Insecure File Upload Vulnerability

1. PathTravel

The current implementation of the file upload functionality lacks proper filtering and validation of the uploaded file names. This allows attackers to upload files with malicious names that can potentially traverse to arbitrary paths on the server. By exploiting this vulnerability, an attacker can upload files to unintended directories, potentially compromising the system's integrity and confidentiality.

It is necessary to implement robust checks on the file name obtained from file.getOriginalFilename() to ensure it does not contain any path traversal sequences like "..". Additionally, validate the final path to ensure it falls within the intended directory specified by the "dir" parameter.

image

2. Duplicate File Uploads

The current implementation of the file upload feature does not include a file renaming mechanism. This poses a risk as it allows for the overwriting of existing files with the same name. This functionality gap can be exploited by attackers to maliciously overwrite files belonging to other users, leading to data loss or unauthorized access to sensitive information.

重要bug, 重新打开页面就会404

bug太多,

  1. 无故404;表单异常退出
  2. api接口访问后无法持续保留
  3. exam接口详情无法打开
  4. 功能不齐全,增加相关的内容还需要 alter/update/delete 数据库操作;功能不完善。

能不能给前端build环境也搞个dockerfile?

按照文档里的指示,前端build总是失败,貌似有多个版本冲突,比较难搞,能不能直接搞个dockerfile?
这个dockerfile最好是包含构建前端,后端和运行的。谢谢

请求大神解答下列疑问。

java -jar C:\Users\Desktop\webproject\spring-boot-online-exam\backend\exam\target\exam-0.0.1-SNAPSHOT.jar

  1. ERROR 13736 --- [ main] com.zaxxer.hikari.pool.HikariPool : HikariPool-1 - Exception during pool initialization.
  2. java.sql.SQLNonTransientConnectionException: Public Key Retrieval is not allowed
  3. WARN 13736 --- [ main] o.s.b.a.orm.jpa.DatabaseLookup : Unable to determine jdbc url from datasource
    org.springframework.jdbc.support.MetaDataAccessException: Could not get Connection for extracting meta-data; nested exception is org.springframework.jdbc.CannotGetJdbcConnectionException: Failed to obtain JDBC Connection; nested exception is java.sql.SQLNonTransientConnectionException: Public Key Retrieval is not allowed
    Caused by: org.springframework.jdbc.CannotGetJdbcConnectionException: Failed to obtain JDBC Connection; nested exception is java.sql.SQLNonTransientConnectionException: Public Key Retrieval is not allowed
  4. ERROR 13736 --- [ main] com.zaxxer.hikari.pool.HikariPool : HikariPool-1 - Exception during pool initialization.
  5. java.sql.SQLNonTransientConnectionException: Public Key Retrieval is not allowed
  6. 2020-12-20 14:40:29.094 WARN 13736 --- [ main] o.h.e.j.e.i.JdbcEnvironmentInitiator : HHH000342: Could not obtain connection to query metadata : Public Key Retrieval is not allowed
  7. 2020-12-20 14:40:29.094 WARN 13736 --- [ main] ConfigServletWebServerApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory' defined in class path resource [org/springframework/boot/autoconfigure/orm/jpa/HibernateJpaConfiguration.class]: Invocation of init method failed; nested exception is org.hibernate.service.spi.ServiceException: Unable to create requested service [org.hibernate.engine.jdbc.env.spi.JdbcEnvironment]
  8. Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
  9. 2020-12-20 14:40:29.125 ERROR 13736 --- [ main] o.s.boot.SpringApplication : Application run failed
  10. org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory' defined in class path resource [org/springframework/boot/autoconfigure/orm/jpa/HibernateJpaConfiguration.class]: Invocation of init method failed; nested exception is org.hibernate.service.spi.ServiceException: Unable to create requested service [org.hibernate.engine.jdbc.env.spi.JdbcEnvironment]
    进行解析包的时候,出现以上错误,配置文件不知道从哪里开始配置,请求解答,感激不尽。救救孩子小白叭

考试倒计时

1.开始考试之后,页面中的倒计时似乎没有反应,是不是应该有一个显示的时间进行倒计时,时间到了自动提交呢?
2.批量导入题库这一块怎么设计呢?

前端无法代理到后端

vue和后端的配置端口都是8000 但是后端报错无法代理到'localhost:9527'这种情况该怎么解决呀?

安装教程不是很明白

请问在spring-boot-online-exam/backend/exam/src/main/resources/application.yml中是没有password的选项的,只有后面application-dev和application-prod有而且密码不一样,希望能重新更新一下安装配置教程,新手真的好难看懂,谢谢,辛苦了

不同身份的用户切换登录时有时会落到404

不同身份的用户切换登录时,存在跳转到404页面的情况
比如教师先登录,然后切换到“考试管理”这一栏,再退出登录,再以学生身份登录,则会跳转到404.
根据我个人的分析,在代码中你应该有专门的逻辑对用户当前访问的路由进行记录,并且重新登录时会跳转到那个路由。但不同身份的用户的路由权限不同,所以造成无法访问从而落到404的情况。
我觉得每次重新登录跳转到首页就可以了,因此可以在退出登录的时候将当前访问的路由置为“/home”,就能避免这种bug。

由于代码比较复杂,我不知道记录当前访问的路由是不是下面这个selectedKeys(在component/Menu/menu.js文件下)

data () { return { openKeys: [], selectedKeys: [],//是这个吗? cachedOpenKeys: [] } },

仅个人建议,仅供参考

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.