springboot testcontext @sql_一个基于 Spring Boot 的在线考试系统

fabed5d4d3dca391dfbac2b88a651f53.png

今天推荐一款超级美观的在线考试系统,感兴趣可以先去预览地址看看该项目。

在线 Demo预览,http://129.211.88.191 ,账户分别是admin、teacher、student,密码是admin123

GitHub地址:github.com/19920625lsg/spring-boot-online-exam

功能简介

  • 支持单选题、多选题、判断题

  • 支持学生(student)、教师(teacher)、管理员(admin)三种角色

    • 学生:参加考试和查看我的考试

    • 教师:学生的所有权限+创建/编辑题目+创建/编辑考试

    • 管理员:教师的所有权限+管理用户

软件架构

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

  • 后端采用SpringBoot+JPA++Swagger2+JWT校验,根据不同用户的权限返回给用户不同的数据

  • 前端采用Vue+AntDesign,组件化拆分,封装了很多年公共组件,方便维护和二次开发

使用教程

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 即可查看演示效果

登陆

首页

ef4ceaea247cfbcec3f9ed72d55591c8.png 8e710a2c14b8040f2d67a0b8fa241f62.png

答题

4f268d413cab19e390c3398dff9e4089.png

考试管理

3694e7b6c0bb78408901024834534666.png

考试列表

9880c9fbc1925e8a837b3b99b3b27514.png
  • 0
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
@ContextConfiguration注解是Spring Framework中的一个注解,它用于在使用JUnit4进行集成测试时配置应用程序的上下文。这个注解可以用来引入一个或多个配置文件,通过加载xml、groovy或使用@Configuration注解标记的配置类等来构建ApplicationContext。对于单个配置文件,可以使用@ContextConfiguration(Locations="../applicationContext.xml")或@ContextConfiguration(classes = SimpleConfiguration.class),而对于多个配置文件,可以使用@ContextConfiguration(locations = { "classpath*:/spring1.xml", "classpath*:/spring2.xml" })。在测试类中,通常会结合@RunWith(SpringJUnit4ClassRunner.class)一起使用,如下所示: ``` @RunWith(SpringJUnit4ClassRunner.class) @ContextConfiguration(locations = {"classpath*:/spring1.xml", "classpath*:/spring2.xml"}) public class CDPlayerTest { // 测试代码 } ``` 这样可以确保在运行测试时,Spring会根据指定的配置文件构建ApplicationContext,并将相应的bean注入到测试类中。<span class="em">1</span><span class="em">2</span><span class="em">3</span> #### 引用[.reference_title] - *1* [Java Spring 【@ContextConfiguration】java世界的那些注解](https://blog.csdn.net/fuyifang/article/details/52792012)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v92^chatsearchT3_1"}}] [.reference_item style="max-width: 33.333333333333336%"] - *2* [Spring TestContext Framework @ContextConfiguration注解的使用](https://blog.csdn.net/qq_26950567/article/details/117196210)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v92^chatsearchT3_1"}}] [.reference_item style="max-width: 33.333333333333336%"] - *3* [@ContextConfiguration注解](https://blog.csdn.net/qq_69626670/article/details/127334493)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v92^chatsearchT3_1"}}] [.reference_item style="max-width: 33.333333333333336%"] [ .reference_list ]
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值