package haue.edu.cn.controller;
import java.util.List;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;
import org.apache.http.protocol.HTTP;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.servlet.ModelAndView;
import haue.edu.cn.model.AjaxResult;
import haue.edu.cn.model.Paper;
import haue.edu.cn.model.PaperDetail;
import haue.edu.cn.model.Student;
import haue.edu.cn.service.impl.PaperDetailServiceImpl;
import haue.edu.cn.service.impl.PaperServiceImpl;
@Controller
@RequestMapping("admin/paper")
public class PaperController implements CommonController<Paper> {
@Autowired
private PaperServiceImpl paperService;
@Autowired
private PaperDetailServiceImpl pdService;
@RequestMapping("manage.do")
public String manage(){
return "admin/paper";
}
public AjaxResult ajaxResult = new AjaxResult();
@RequestMapping(value="select.do",method=RequestMethod.GET)
public ModelAndView selectPaper(ModelAndView model){
// session.getAttribute("currentUser");
model.addObject("papers", paperService.get());
model.setViewName("selectPaper");
return model;
}
// 需要先选择试卷,再进行考试
// @RequestMapping(value="select.do",method=RequestMethod.GET)
// public ModelAndView selectPaper( HttpServletRequest request,HttpServletResponse response,ModelAndView model){
// model.addObject("selectPaperFm", new SelectPaperFm());
// model.addObject("papers", paperService.get());
// model.setViewName("selectPaper");
// return model;
// }
// 需要先选择试卷,再进行试卷展示
// @RequestMapping(value="select.do",method=RequestMethod.POST)
// public String execSelectPaper(HttpServletRequest request,RedirectAttributes attr,ModelAndView model){
// // 将获取的试卷id 作为参数
// Integer pid = Integer.parseInt(request.getParameter("papers"));
// attr.addFlashAttribute("pid", pid);
// model.setViewName("display");
// return "redirect:display.do";
// }
// 显示考试内容
// @RequestMapping("display.do")
// public String displayQuestions(HttpServletRequest request,Model model){
// int pid = Integer.parseInt(request.getParameter("id"));
// List<PaperDetail> paperQuestionList = pdService.getQuestions(pid);
// model.addAttribute("questionList", paperQuestionList);
// model.addAttribute("paperId", pid);
// return "display";
// }
@RequestMapping("display.do")
public ModelAndView displayQuestions(HttpServletRequest request,HttpSession session,ModelAndView model){
int pid = Integer.parseInt(request.getParameter("pid"));
int uid = Integer.parseInt(request.getParameter("uid"));
List<PaperDetail> paperQuestionList = pdService.getQuestions(pid);
Student student = (Student) session.getAttribute("currentUser");
model.addObject("questionList", paperQuestionList);
model.addObject("paperId", pid);
model.addObject("userId", uid);
model.setViewName("display");
model.addObject("currentUser", student);
return model;
}
@Override
@RequestMapping("get.do")
@ResponseBody
public List<Paper> get() {
return paperService.get();
}
@Override
@RequestMapping("one.do")
public Paper getOne(HttpServletRequest request) {
int id = Integer.parseInt(request.getParameter("id"));
return paperService.getOne(id);
}
@Override
@RequestMapping("add.do")
@ResponseBody
public AjaxResult add(@RequestBody Paper record) {
paperService.add(record);
return ajaxResult;
}
@Override
@RequestMapping("delete.do")
@ResponseBody
public AjaxResult delete(@RequestBody Paper record) {
paperService.delete(record);
return ajaxResult;
}
@Override
@RequestMapping("update.do")
@ResponseBody
public AjaxResult update(@RequestBody Paper record) {
paperService.update(record);
return ajaxResult;
}
@Override
@RequestMapping("query.do")
@ResponseBody
public List<Paper> query(@RequestBody Paper condition) {
return paperService.get();
}
}
没有合适的资源?快使用搜索试试~ 我知道了~
基于ssm框架写的在线考试系统,毕业设计.zip
共317个文件
java:58个
png:57个
css:47个
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
0 下载量 58 浏览量
2023-08-05
11:38:08
上传
评论
收藏 1.55MB ZIP 举报
温馨提示
基于ssm框架写的在线考试系统,毕业设计.zip
资源推荐
资源详情
资源评论
收起资源包目录
基于ssm框架写的在线考试系统,毕业设计.zip (317个子文件)
all-wcprops 736B
.classpath 2KB
org.eclipse.wst.common.component 661B
org.eclipse.wst.jsdt.ui.superType.container 49B
bootstrap.css 144KB
bootstrap.min.css 120KB
bootstrap.min.css 120KB
easyui.css 57KB
bootstrap-theme.css 26KB
style_j.css 25KB
font-awesome.min.css 23KB
bootstrap-theme.min.css 23KB
templatemo-style.css 16KB
style.css 14KB
tabs.css 9KB
mobile.css 7KB
color.css 6KB
datagrid.css 5KB
linkbutton.css 4KB
calendar.css 4KB
tree.css 3KB
panel.css 3KB
layout.css 3KB
icon.css 2KB
window.css 2KB
default.css 2KB
menu.css 2KB
textbox.css 2KB
tooltip.css 2KB
menubutton.css 2KB
datalist.css 2KB
switchbutton.css 2KB
slider.css 2KB
pagination.css 1KB
style.css 1KB
index.css 1KB
searchbox.css 1KB
spinner.css 1KB
dialog.css 907B
messager.css 898B
accordion.css 838B
propertygrid.css 716B
progressbar.css 653B
combobox.css 634B
combo.css 625B
datebox.css 622B
zzcStyle.css 496B
filebox.css 355B
splitbutton.css 293B
validatebox.css 94B
numberbox.css 0B
entries 795B
fontawesome-webfont.eot 59KB
glyphicons-halflings-regular.eot 20KB
top_leftname_2.gif 11KB
noscript.gif 11KB
top_leftname.gif 6KB
tools-sprites-trans.gif 3KB
loading.gif 2KB
blocks.gif 1KB
plugin_big.gif 1KB
layout-browser-hd-bg.gif 532B
topbg.gif 417B
blank.gif 43B
blank.gif 43B
.gitignore 9B
input.html 252B
PaperController.java 4KB
QuestionController.java 4KB
PaperDetailServiceImpl.java 4KB
ScoreController.java 3KB
LoginController.java 3KB
StudentController.java 3KB
PaperDetailController.java 3KB
ExamDetailController.java 3KB
Student.java 3KB
Paper.java 3KB
QuestionDBController.java 2KB
Question.java 2KB
Admin.java 2KB
ExamDetail.java 2KB
ExamInfoController.java 2KB
ScoreServiceImpl.java 2KB
ExamDetailServiceImpl.java 2KB
QuestionServiceImpl.java 2KB
ExamInfo.java 2KB
UserController.java 1KB
StudentServiceImpl.java 1KB
ExamInfoServiceImpl.java 1KB
AdminController.java 1KB
PaperDetail.java 1KB
QuestionMapper.java 1KB
QuestionDB.java 1KB
AdminServiceImpl.java 1KB
PaperServiceImpl.java 1KB
SpringMVCTest.java 934B
QuestionDBServiceImpl.java 839B
AbstractController.java 808B
PaperCondition.java 791B
ExamDetailMapper.java 743B
共 317 条
- 1
- 2
- 3
- 4
资源评论
AbelZ_01
- 粉丝: 894
- 资源: 5441
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功