(php毕业设计)基于php学生在线考试管理系统
基于php学生在线考试管理系统
学生在线考试管理系统是基于php编程语言,mysql数据库进行开发,本系统分为学生,教师,管理员三个角色,其中学生可以注册登陆系统,查看公告,查看试卷,在线考试,查看得分,考试错题记录等。教师可以登陆系统,对试题,试卷进行管理,查看成绩,查看公告;管理员对学生,教师信息管理,对考试试题管理,生成试卷,还有班级,科目进行管理。本系统功能齐全,带论文,适合作为php毕业设计和课程设计参考学习。
一.技术环境
php版本: 5.3
开发工具: notepad++,sublime,phpstorm都可
数据库: mysql
服务器: apache
集成环境: phpstudy,小皮面板,wamp都可以
详细技术:HTML+CSS+JS+PHP+MYSQL+PhpStudy
二.项目文件(项目获取请看文末官网)
三.系统功能
四.代码示例
package com.lmu.controller;
/*** 和登陆有关的都在这里*/import com.opensymphony.xwork2.ActionContext;
import com.opensymphony.xwork2.ActionSupport;
import com.lmu.model.Role;
import com.lmu.model.User;
import com.lmu.service.RoleService;
import com.lmu.service.UserService;
import com.lmu.utils.JsonUtils;
import com.lmu.utils.UserUtils;import org.apache.commons.collections.map.HashedMap;
import org.apache.struts2.ServletActionContext;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Controller;import java.io.IOException;
import java.util.HashMap;
import java.util.Map;@Controller("loginController")
@Scope("prototype")
public class LoginController extends ActionSupport {@Autowiredprivate UserService userService;@Autowiredprivate RoleService roleService;private User user;private Map<String, Object> map = new HashMap();public User getUser() {return user;}public void setUser(User user) {this.user = user;}public UserService getUserService() {return userService;}public void setUserService(UserService userService) {this.userService = userService;}/*** 用户登陆* @return*/public void index() throws IOException {User user1 = userService.getUser(user);if (user1 != null){if (user1.getIsSh() == 1){if (user1.getRole().getEnName().equals("admin")){ActionContext.getContext().getSession().put("user", user1);}if (user1.getRole().getEnName().equals("js")){ActionContext.getContext().getSession().put("user1", user1);}if (user1.getRole().getEnName().equals("xs")){ActionContext.getContext().getSession().put("user2", user1);}map.put("flag", 1);map.put("url", "login_indexs.do");map.put("id", user1.getId());JsonUtils.toJson(map);} else {map.put("flag", 2);JsonUtils.toJson(map);}} else {map.put("flag", 3);JsonUtils.toJson(map);}}public String indexs() throws IOException {User u = UserUtils.getUser();if (u != null){ActionContext.getContext().put("user", u);String ss = u.getRole().getEnName();ActionContext.getContext().put("role", u.getRole().getEnName());}return SUCCESS;}//登陆页面public String login() {return SUCCESS;}//退出public String tuichu() {ActionContext ac = ActionContext.getContext();Map session = ac.getSession();session.remove("userName");session.remove("userId");ServletActionContext.getRequest().getSession().invalidate();return "login";}}
package com.lmu.controller;/*** 用户新增*/import com.opensymphony.xwork2.ActionContext;
import com.opensymphony.xwork2.ActionSupport;
import com.opensymphony.xwork2.ModelDriven;
import com.lmu.model.Role;
import com.lmu.model.User;
import com.lmu.service.RoleService;
import com.lmu.service.UserService;
import com.lmu.utils.JsonUtils;
import com.lmu.utils.Pager;
import com.lmu.utils.UserUtils;import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Controller;import java.awt.event.FocusEvent;
import java.io.IOException;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;@Controller("userController")
@Scope("prototype")
public class UserController extends ActionSupport implements ModelDriven<User> {@Autowiredprivate UserService userService;@Autowiredprivate RoleService roleService;private User user;private Integer userId;private Map<String, Object> map = new HashMap();/*** list** @return*/public String list() throws IOException {User user1 = UserUtils.getUser();if (user1 == null || user1.getId() == null){ActionContext.getContext().put("login", 1);return SUCCESS;}Pager<User> pagers = null;Role role = user1.getRole();if (role.getEnName().equals("admin")) {pagers = userService.getList(user);ActionContext.getContext().put("pagers", pagers);ActionContext.getContext().put("user", user1);ActionContext.getContext().put("role", role);ActionContext.getContext().put("bean", user);return SUCCESS;} else if (role.getEnName().equals("xs") || role.getEnName().equals("js")) {pagers = userService.getList(user1);ActionContext.getContext().put("pagers", pagers);ActionContext.getContext().put("bean", user);return SUCCESS;}return null;}/*** 跳转add** @return*/public String add() {Pager<Role> pagers = roleService.pagers();ActionContext.getContext().put("pagers", pagers);return SUCCESS;}/*** 查询修改** @return*/public String edit() {User bean = userService.findById(userId);Pager<Role> pagers = roleService.pagers();ActionContext.getContext().put("bean", bean);ActionContext.getContext().put("pagers", pagers);return SUCCESS;}/*** 审核** @return*/public void updateSh() throws IOException {user.setIsSh(1);userService.updates(user);map.put("flag", true);map.put("url", "user_list.do");JsonUtils.toJson(map);}/*** 更新** @return*/public String update() throws IOException {if (user.getPass().equals("")){user.setPass(null);}userService.updates(user);map.put("flag", true);map.put("url", "user_list.do");JsonUtils.toJson(map);return SUCCESS;}/*** 保存** @return*/public void save() throws IOException {if (userService.getUser(user) != null){map.put("flag", false);map.put("url", "login_login.do");JsonUtils.toJson(map);} else {user.setTime(new Date());userService.save(user);map.put("flag", true);map.put("url", "login_login.do");JsonUtils.toJson(map);}}public void delete() throws IOException {User user1 = userService.findById(userId);user1.setIsDelete(1);userService.update(user1);map.put("flag", true);map.put("url", "user_list.do");JsonUtils.toJson(map);}@Overridepublic User getModel() {if (user == null) {user = new User();}return user;}public Integer getUserId() {return userId;}public void setUserId(Integer userId) {this.userId = userId;}public User getUser() {return user;}public void setUser(User user) {this.user = user;}
}
五.项目截图
项目获取
(php毕业设计)基于php学生在线考试管理系统相关推荐
- 基于springboot+vue前后端分离的学生在线考试管理系统
一.基于springboot+vue前后端分离的学生在线考试管理系统 本系统通过教师用户创建班级编写试卷信息然后发布到班级.学生用户进入班级,在线作答,考试结果数据通过网络回收,系统自动进行判分,生成 ...
- ThinkPHP学生在线考试管理系统
Q 1115487855 ThinkPHP学生在线考试系统 一 项目介绍 ThinkPHP学生在线考试管理系统,前台使用MVC模式 后台使用VUE.js MVVC模式 基于ThinkPHP5.1框架, ...
- Java项目:学生在线考试管理系统(java+SpringBoot+Thymleaf+BootStrap+Html+mysql)
源码获取:博客首页 "资源" 里下载! 项目介绍 学生在线考试管理系统,分为管理员与老师.学生三种角色: 教师/管理员主要功能: 1. 学生管理:查看所有学生的基本信息,管理员则还 ...
- 用 Python 写了一个学生在线考试管理系统
版权声明:本文为博主原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明.本文链接: https://blog.csdn.net/weixin_44269312/arti ...
- 基于Springboot实现在线考试管理系统
项目编号:BS-XX-067 运行环境: 开发工具:IDEA / ECLIPSE 数据库:MYSQL5.7+Redis 应用服务器:TOMCAT8.5.31 JDK:1.8 后台开发技术:Spring ...
- 毕业设计-基于SSM实现在线考试及题库管理系统
作者主页:编程指南针 简介:Java领域优质创作者.CSDN博客专家 Java项目.简历模板.学习资料.面试题库.技术互助 文末获取源码 项目编号:BS-GX-019 本项目是一个基于WEB的试题库 ...
- 计算机毕业设计基于Android的在线相册管理系统
随着人民物质生活水平的提高,国家节假日的合理安排,越来越多的人在国家法定节假日选择旅游出行,照片留念已经是旅游当中必备的项目.在这中情况下,为了进一步方便人门的娱乐和生活,开发了在线相册管理系统. 随 ...
- 基于java SpringMVC的在线考试管理系统
最近给一个同学成了基于SpringMVC的在线考试管理系统,其实,单纯的MVC模式已经有点过时了,因为有更加成熟的SpringBoot框架.但是既然有要求,就应该按照要求来.利用不到一周的时间,完成了 ...
- Java毕设课设-在线考试管理系统
计算机课程设计|毕业设计之在线考试管理系统代码-基于SSM的在线考试管理系统 > > 所有工具下载链接: JDK版本下载 Eclipse下载链接 Mysql下载链接 tomcat下载链接 ...
最新文章
- 扩增子分析解读3格式转换,去冗余,聚类
- mfc编辑框显示数据_Excel表格技巧—Excel表格中怎么给数据分等级
- numpy.divide详解
- python time strptime_Python中操作时间之strptime()方法的使用
- php mysql 云虚拟机_虚拟机+apache+php+mysql 环境安装配置
- IBM DS300 安装
- 生成icon图标 1005 html 左上角icon图标
- 宁波Uber优步司机奖励政策(12月21日到12月27日)
- 哈夫曼树【最优二叉树】【Huffman】
- 09年关门歇业的15大网站 雅虎旗下4网站上榜
- 输入网址到出现页面的过程
- 纸质办公电子化——iWebOffice中间件
- IDEA2019版下载和安装
- 柯洁预言AI绘画会替代大部分画师,网友:初代AI受害者现身说法
- 【PAT乙级】B1001-B1095刷题记录
- 今天16:00 | 中科院计算所研究员孙晓明老师带大家走进量子的世界
- 通过maven打nar报错问题
- 一学校出150名在校“老板”
- 异常处理之Validates struts.xml files for syntactic and reference errors.
- 电脑程序在计算机丢失怎么办,电脑中dll文件丢失怎么恢复?计算机中丢失dll文件修复方法...
热门文章
- html的轮播点怎么设置,html轮播效果的实现
- 【Linux】Linux入门学习之常用命令四
- Cisco Router and Security Device Manager (SDM) Demo Install
- linux下VsFTP配置全方案
- 1%苹果股票,可是超级富豪的概念
- Excel提取年月日①
- OSPF不规则区域知识点
- 【调剂】2023齐齐哈尔大学通信与信息系统(学硕)电子信息(专硕)招收调剂生...
- 好久不来了,这是入职三个月以来公司的笔记,我的葵花宝典,各种有的没的实用的前端知识
- 为什么我会选择做软件测试