├── .classpath ├── .myhibernatedata ├── .project ├── .settings ├── .jsdtscope ├── org.eclipse.core.resources.prefs ├── org.eclipse.jdt.core.prefs ├── org.eclipse.wst.common.component ├── org.eclipse.wst.common.project.facet.core.xml ├── org.eclipse.wst.jsdt.ui.superType.container └── org.eclipse.wst.jsdt.ui.superType.name ├── WebRoot ├── META-INF │ └── MANIFEST.MF ├── WEB-INF │ ├── classes │ │ ├── com │ │ │ └── andy │ │ │ │ ├── action │ │ │ │ ├── AddQuestionAction.class │ │ │ │ ├── CourseAddAction.class │ │ │ │ ├── CourseAddTeacherAction.class │ │ │ │ ├── CourseGetAllNamesAction.class │ │ │ │ ├── CourseGetAllTeachersAction.class │ │ │ │ ├── DeleteQuestionAction.class │ │ │ │ ├── ImageReponseAction.class │ │ │ │ ├── JuageAnwserAction.class │ │ │ │ ├── ManagerLoginAction.class │ │ │ │ ├── ManagerLogoutAction.class │ │ │ │ ├── PaperSetCouAndTeaAction.class │ │ │ │ ├── QuestionMainAction.class │ │ │ │ ├── ScoreShowAllAction.class │ │ │ │ ├── StudentAddAction.class │ │ │ │ ├── StudentDeleteAction.class │ │ │ │ ├── StudentGetAllNamesAction.class │ │ │ │ ├── StudentGetInfoByIdAction.class │ │ │ │ ├── StudentLoginAction.class │ │ │ │ ├── StudentLogoutAction.class │ │ │ │ ├── StudentModifyPasswordAction.class │ │ │ │ ├── StudentShowInfoAction.class │ │ │ │ ├── StudentShowScoreAction.class │ │ │ │ ├── StudentUpdateAction.class │ │ │ │ ├── TeacherAddAction.class │ │ │ │ ├── TeacherDeleteAction.class │ │ │ │ ├── TeacherGetAllNamesAction.class │ │ │ │ ├── TeacherGetInfoByIdAction.class │ │ │ │ ├── TeacherLoginAction.class │ │ │ │ ├── TeacherLogoutAction.class │ │ │ │ ├── TeacherModifyPasswordAction.class │ │ │ │ ├── TeacherShowInfoAction.class │ │ │ │ ├── TeacherUpdateAction.class │ │ │ │ └── UpdateQuestionAction.class │ │ │ │ ├── dao │ │ │ │ ├── CourseDao.class │ │ │ │ ├── CourseDaoImpl.class │ │ │ │ ├── ManagerDao.class │ │ │ │ ├── ManagerDaoImpl.class │ │ │ │ ├── QuestionDao.class │ │ │ │ ├── QuestionDaoImpl.class │ │ │ │ ├── ScoreDao.class │ │ │ │ ├── ScoreDaoImpl.class │ │ │ │ ├── StudentDao.class │ │ │ │ ├── StudentDaoImpl.class │ │ │ │ ├── TeacherDao.class │ │ │ │ └── TeacherDaoImpl.class │ │ │ │ ├── entity │ │ │ │ ├── Course.class │ │ │ │ ├── Course.hbm.xml │ │ │ │ ├── Manager.class │ │ │ │ ├── Manager.hbm.xml │ │ │ │ ├── Question.class │ │ │ │ ├── Question.hbm.xml │ │ │ │ ├── Score.class │ │ │ │ ├── Score.hbm.xml │ │ │ │ ├── Student.class │ │ │ │ ├── Student.hbm.xml │ │ │ │ ├── Teacher.class │ │ │ │ └── Teacher.hbm.xml │ │ │ │ ├── service │ │ │ │ ├── CourseService.class │ │ │ │ ├── CourseServiceImpl.class │ │ │ │ ├── ManagerService.class │ │ │ │ ├── ManagerServiceImpl.class │ │ │ │ ├── QuestionService.class │ │ │ │ ├── QuestionServiceImpl.class │ │ │ │ ├── ScoreService.class │ │ │ │ ├── ScoreServiceImpl.class │ │ │ │ ├── StudentService.class │ │ │ │ ├── StudentServiceImpl.class │ │ │ │ ├── TeacherService.class │ │ │ │ └── TeacherServiceImpl.class │ │ │ │ ├── test │ │ │ │ └── Test.class │ │ │ │ └── util │ │ │ │ ├── DBUtil.class │ │ │ │ └── HibernateSessionUtil.class │ │ ├── hibernate.cfg.xml │ │ └── struts.xml │ ├── lib │ │ └── ojdbc14.jar │ └── web.xml ├── help.jsp ├── index.jsp ├── login.jsp ├── main.jsp ├── manager │ ├── showStudentInfo.jsp │ └── showTeacherInfo.jsp ├── modify.jsp ├── student │ ├── passwordModify.jsp │ ├── showInfo.jsp │ └── showScore.jsp ├── teacher │ ├── passwordModify.jsp │ ├── showAllScore.jsp │ └── showInfo.jsp ├── welcome_manager.jsp ├── welcome_stu.jsp └── welcome_tea.jsp ├── src ├── com │ └── andy │ │ ├── action │ │ ├── AddQuestionAction.java │ │ ├── CourseAddAction.java │ │ ├── CourseAddTeacherAction.java │ │ ├── CourseGetAllNamesAction.java │ │ ├── CourseGetAllTeachersAction.java │ │ ├── DeleteQuestionAction.java │ │ ├── ImageReponseAction.java │ │ ├── JuageAnwserAction.java │ │ ├── ManagerLoginAction.java │ │ ├── ManagerLogoutAction.java │ │ ├── PaperSetCouAndTeaAction.java │ │ ├── QuestionMainAction.java │ │ ├── ScoreShowAllAction.java │ │ ├── StudentAddAction.java │ │ ├── StudentDeleteAction.java │ │ ├── StudentGetAllNamesAction.java │ │ ├── StudentGetInfoByIdAction.java │ │ ├── StudentLoginAction.java │ │ ├── StudentLogoutAction.java │ │ ├── StudentModifyPasswordAction.java │ │ ├── StudentShowInfoAction.java │ │ ├── StudentShowScoreAction.java │ │ ├── StudentUpdateAction.java │ │ ├── TeacherAddAction.java │ │ ├── TeacherDeleteAction.java │ │ ├── TeacherGetAllNamesAction.java │ │ ├── TeacherGetInfoByIdAction.java │ │ ├── TeacherLoginAction.java │ │ ├── TeacherLogoutAction.java │ │ ├── TeacherModifyPasswordAction.java │ │ ├── TeacherShowInfoAction.java │ │ ├── TeacherUpdateAction.java │ │ └── UpdateQuestionAction.java │ │ ├── dao │ │ ├── CourseDao.java │ │ ├── CourseDaoImpl.java │ │ ├── ManagerDao.java │ │ ├── ManagerDaoImpl.java │ │ ├── QuestionDao.java │ │ ├── QuestionDaoImpl.java │ │ ├── ScoreDao.java │ │ ├── ScoreDaoImpl.java │ │ ├── StudentDao.java │ │ ├── StudentDaoImpl.java │ │ ├── TeacherDao.java │ │ └── TeacherDaoImpl.java │ │ ├── entity │ │ ├── Course.hbm.xml │ │ ├── Course.java │ │ ├── Manager.hbm.xml │ │ ├── Manager.java │ │ ├── Question.hbm.xml │ │ ├── Question.java │ │ ├── Score.hbm.xml │ │ ├── Score.java │ │ ├── Student.hbm.xml │ │ ├── Student.java │ │ ├── Teacher.hbm.xml │ │ └── Teacher.java │ │ ├── service │ │ ├── CourseService.java │ │ ├── CourseServiceImpl.java │ │ ├── ManagerService.java │ │ ├── ManagerServiceImpl.java │ │ ├── QuestionService.java │ │ ├── QuestionServiceImpl.java │ │ ├── ScoreService.java │ │ ├── ScoreServiceImpl.java │ │ ├── StudentService.java │ │ ├── StudentServiceImpl.java │ │ ├── TeacherService.java │ │ └── TeacherServiceImpl.java │ │ ├── test │ │ └── Test.java │ │ └── util │ │ ├── DBUtil.java │ │ └── HibernateSessionUtil.java ├── hibernate.cfg.xml └── struts.xml └── 学生在线考试系统资料 ├── course.sql ├── course_score.sql ├── course_student.sql ├── course_teacher.sql ├── manager.sql ├── score.sql ├── teacher.sql ├── 学生在线考试系统资料.zip ├── 学生在线考试系统需求分析设计.doc ├── 截屏 ├── QQ截图20160103152834.png ├── QQ截图20160103152848.png ├── QQ截图20160103152905.png ├── QQ截图20160103152914.png ├── QQ截图20160103152920.png ├── QQ截图20160103152934.png ├── QQ截图20160103152945.png ├── QQ截图20160103153009.png ├── QQ截图20160103153021.png ├── QQ截图20160103153028.png ├── QQ截图20160103153103.png ├── QQ截图20160103153110.png ├── QQ截图20160103153116.png ├── QQ截图20160103153131.png ├── QQ截图20160103153137.png ├── QQ截图20160103153155.png ├── QQ截图20160103153215.png ├── QQ截图20160103153222.png ├── QQ截图20160103153250.png ├── QQ截图20160103153330.png ├── QQ截图20160103153343.png ├── QQ截图20160103153351.png ├── 登陆-学生.png ├── 登陆-管理员.png └── 登陆-老师.png ├── 报告范本.pdf └── 计算机科学与技术专业12级《综合课程设计》报告-学生在线考试系统.doc /.classpath: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | -------------------------------------------------------------------------------- /.myhibernatedata: -------------------------------------------------------------------------------- 1 | #MyEclipse Hibernate Properties 2 | #Tue Oct 20 08:32:20 CST 2015 3 | genVersionTag=false 4 | genAnnotations=false 5 | configFile=/Andy_OnlineExam/src/hibernate.cfg.xml 6 | reStrategyClass= 7 | sessionFactoryId= 8 | profile= 9 | detectM2M=false 10 | genBasicCompId=false 11 | keyGenerator= 12 | createConfigFile=true 13 | basePersistenceClass= 14 | detectO2O=false 15 | useJavaTypes=true 16 | reSettingsFile= 17 | -------------------------------------------------------------------------------- /.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | Andy_OnlineExam 4 | 5 | 6 | 7 | 8 | 9 | org.eclipse.wst.jsdt.core.javascriptValidator 10 | 11 | 12 | 13 | 14 | org.eclipse.jdt.core.javabuilder 15 | 16 | 17 | 18 | 19 | org.eclipse.wst.common.project.facet.core.builder 20 | 21 | 22 | 23 | 24 | org.eclipse.wst.validation.validationbuilder 25 | 26 | 27 | 28 | 29 | com.genuitec.eclipse.j2eedt.core.DeploymentDescriptorValidator 30 | 31 | 32 | 33 | 34 | com.genuitec.eclipse.ast.deploy.core.DeploymentBuilder 35 | 36 | 37 | 38 | 39 | 40 | org.eclipse.jem.workbench.JavaEMFNature 41 | org.eclipse.wst.common.modulecore.ModuleCoreNature 42 | org.eclipse.wst.common.project.facet.core.nature 43 | org.eclipse.jdt.core.javanature 44 | org.eclipse.wst.jsdt.core.jsNature 45 | 46 | 47 | -------------------------------------------------------------------------------- /.settings/.jsdtscope: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.settings/org.eclipse.core.resources.prefs: -------------------------------------------------------------------------------- 1 | eclipse.preferences.version=1 2 | encoding//WebRoot/manager/showStudentInfo.jsp=UTF-8 3 | encoding//WebRoot/student/showInfo.jsp=UTF-8 4 | encoding/=UTF-8 5 | -------------------------------------------------------------------------------- /.settings/org.eclipse.jdt.core.prefs: -------------------------------------------------------------------------------- 1 | eclipse.preferences.version=1 2 | org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled 3 | org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6 4 | org.eclipse.jdt.core.compiler.compliance=1.6 5 | org.eclipse.jdt.core.compiler.problem.assertIdentifier=error 6 | org.eclipse.jdt.core.compiler.problem.enumIdentifier=error 7 | org.eclipse.jdt.core.compiler.source=1.6 8 | -------------------------------------------------------------------------------- /.settings/org.eclipse.wst.common.component: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /.settings/org.eclipse.wst.common.project.facet.core.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /.settings/org.eclipse.wst.jsdt.ui.superType.container: -------------------------------------------------------------------------------- 1 | org.eclipse.wst.jsdt.launching.baseBrowserLibrary -------------------------------------------------------------------------------- /.settings/org.eclipse.wst.jsdt.ui.superType.name: -------------------------------------------------------------------------------- 1 | Window -------------------------------------------------------------------------------- /WebRoot/META-INF/MANIFEST.MF: -------------------------------------------------------------------------------- 1 | Manifest-Version: 1.0 2 | Class-Path: 3 | 4 | -------------------------------------------------------------------------------- /WebRoot/WEB-INF/classes/com/andy/action/AddQuestionAction.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andybing/OnlineExamination/1d949e6c2c6aa54e799e831cb89fbbf3e24666c4/WebRoot/WEB-INF/classes/com/andy/action/AddQuestionAction.class -------------------------------------------------------------------------------- /WebRoot/WEB-INF/classes/com/andy/action/CourseAddAction.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andybing/OnlineExamination/1d949e6c2c6aa54e799e831cb89fbbf3e24666c4/WebRoot/WEB-INF/classes/com/andy/action/CourseAddAction.class -------------------------------------------------------------------------------- /WebRoot/WEB-INF/classes/com/andy/action/CourseAddTeacherAction.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andybing/OnlineExamination/1d949e6c2c6aa54e799e831cb89fbbf3e24666c4/WebRoot/WEB-INF/classes/com/andy/action/CourseAddTeacherAction.class -------------------------------------------------------------------------------- /WebRoot/WEB-INF/classes/com/andy/action/CourseGetAllNamesAction.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andybing/OnlineExamination/1d949e6c2c6aa54e799e831cb89fbbf3e24666c4/WebRoot/WEB-INF/classes/com/andy/action/CourseGetAllNamesAction.class -------------------------------------------------------------------------------- /WebRoot/WEB-INF/classes/com/andy/action/CourseGetAllTeachersAction.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andybing/OnlineExamination/1d949e6c2c6aa54e799e831cb89fbbf3e24666c4/WebRoot/WEB-INF/classes/com/andy/action/CourseGetAllTeachersAction.class -------------------------------------------------------------------------------- /WebRoot/WEB-INF/classes/com/andy/action/DeleteQuestionAction.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andybing/OnlineExamination/1d949e6c2c6aa54e799e831cb89fbbf3e24666c4/WebRoot/WEB-INF/classes/com/andy/action/DeleteQuestionAction.class -------------------------------------------------------------------------------- /WebRoot/WEB-INF/classes/com/andy/action/ImageReponseAction.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andybing/OnlineExamination/1d949e6c2c6aa54e799e831cb89fbbf3e24666c4/WebRoot/WEB-INF/classes/com/andy/action/ImageReponseAction.class -------------------------------------------------------------------------------- /WebRoot/WEB-INF/classes/com/andy/action/JuageAnwserAction.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andybing/OnlineExamination/1d949e6c2c6aa54e799e831cb89fbbf3e24666c4/WebRoot/WEB-INF/classes/com/andy/action/JuageAnwserAction.class -------------------------------------------------------------------------------- /WebRoot/WEB-INF/classes/com/andy/action/ManagerLoginAction.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andybing/OnlineExamination/1d949e6c2c6aa54e799e831cb89fbbf3e24666c4/WebRoot/WEB-INF/classes/com/andy/action/ManagerLoginAction.class -------------------------------------------------------------------------------- /WebRoot/WEB-INF/classes/com/andy/action/ManagerLogoutAction.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andybing/OnlineExamination/1d949e6c2c6aa54e799e831cb89fbbf3e24666c4/WebRoot/WEB-INF/classes/com/andy/action/ManagerLogoutAction.class -------------------------------------------------------------------------------- /WebRoot/WEB-INF/classes/com/andy/action/PaperSetCouAndTeaAction.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andybing/OnlineExamination/1d949e6c2c6aa54e799e831cb89fbbf3e24666c4/WebRoot/WEB-INF/classes/com/andy/action/PaperSetCouAndTeaAction.class -------------------------------------------------------------------------------- /WebRoot/WEB-INF/classes/com/andy/action/QuestionMainAction.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andybing/OnlineExamination/1d949e6c2c6aa54e799e831cb89fbbf3e24666c4/WebRoot/WEB-INF/classes/com/andy/action/QuestionMainAction.class -------------------------------------------------------------------------------- /WebRoot/WEB-INF/classes/com/andy/action/ScoreShowAllAction.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andybing/OnlineExamination/1d949e6c2c6aa54e799e831cb89fbbf3e24666c4/WebRoot/WEB-INF/classes/com/andy/action/ScoreShowAllAction.class -------------------------------------------------------------------------------- /WebRoot/WEB-INF/classes/com/andy/action/StudentAddAction.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andybing/OnlineExamination/1d949e6c2c6aa54e799e831cb89fbbf3e24666c4/WebRoot/WEB-INF/classes/com/andy/action/StudentAddAction.class -------------------------------------------------------------------------------- /WebRoot/WEB-INF/classes/com/andy/action/StudentDeleteAction.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andybing/OnlineExamination/1d949e6c2c6aa54e799e831cb89fbbf3e24666c4/WebRoot/WEB-INF/classes/com/andy/action/StudentDeleteAction.class -------------------------------------------------------------------------------- /WebRoot/WEB-INF/classes/com/andy/action/StudentGetAllNamesAction.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andybing/OnlineExamination/1d949e6c2c6aa54e799e831cb89fbbf3e24666c4/WebRoot/WEB-INF/classes/com/andy/action/StudentGetAllNamesAction.class -------------------------------------------------------------------------------- /WebRoot/WEB-INF/classes/com/andy/action/StudentGetInfoByIdAction.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andybing/OnlineExamination/1d949e6c2c6aa54e799e831cb89fbbf3e24666c4/WebRoot/WEB-INF/classes/com/andy/action/StudentGetInfoByIdAction.class -------------------------------------------------------------------------------- /WebRoot/WEB-INF/classes/com/andy/action/StudentLoginAction.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andybing/OnlineExamination/1d949e6c2c6aa54e799e831cb89fbbf3e24666c4/WebRoot/WEB-INF/classes/com/andy/action/StudentLoginAction.class -------------------------------------------------------------------------------- /WebRoot/WEB-INF/classes/com/andy/action/StudentLogoutAction.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andybing/OnlineExamination/1d949e6c2c6aa54e799e831cb89fbbf3e24666c4/WebRoot/WEB-INF/classes/com/andy/action/StudentLogoutAction.class -------------------------------------------------------------------------------- /WebRoot/WEB-INF/classes/com/andy/action/StudentModifyPasswordAction.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andybing/OnlineExamination/1d949e6c2c6aa54e799e831cb89fbbf3e24666c4/WebRoot/WEB-INF/classes/com/andy/action/StudentModifyPasswordAction.class -------------------------------------------------------------------------------- /WebRoot/WEB-INF/classes/com/andy/action/StudentShowInfoAction.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andybing/OnlineExamination/1d949e6c2c6aa54e799e831cb89fbbf3e24666c4/WebRoot/WEB-INF/classes/com/andy/action/StudentShowInfoAction.class -------------------------------------------------------------------------------- /WebRoot/WEB-INF/classes/com/andy/action/StudentShowScoreAction.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andybing/OnlineExamination/1d949e6c2c6aa54e799e831cb89fbbf3e24666c4/WebRoot/WEB-INF/classes/com/andy/action/StudentShowScoreAction.class -------------------------------------------------------------------------------- /WebRoot/WEB-INF/classes/com/andy/action/StudentUpdateAction.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andybing/OnlineExamination/1d949e6c2c6aa54e799e831cb89fbbf3e24666c4/WebRoot/WEB-INF/classes/com/andy/action/StudentUpdateAction.class -------------------------------------------------------------------------------- /WebRoot/WEB-INF/classes/com/andy/action/TeacherAddAction.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andybing/OnlineExamination/1d949e6c2c6aa54e799e831cb89fbbf3e24666c4/WebRoot/WEB-INF/classes/com/andy/action/TeacherAddAction.class -------------------------------------------------------------------------------- /WebRoot/WEB-INF/classes/com/andy/action/TeacherDeleteAction.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andybing/OnlineExamination/1d949e6c2c6aa54e799e831cb89fbbf3e24666c4/WebRoot/WEB-INF/classes/com/andy/action/TeacherDeleteAction.class -------------------------------------------------------------------------------- /WebRoot/WEB-INF/classes/com/andy/action/TeacherGetAllNamesAction.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andybing/OnlineExamination/1d949e6c2c6aa54e799e831cb89fbbf3e24666c4/WebRoot/WEB-INF/classes/com/andy/action/TeacherGetAllNamesAction.class -------------------------------------------------------------------------------- /WebRoot/WEB-INF/classes/com/andy/action/TeacherGetInfoByIdAction.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andybing/OnlineExamination/1d949e6c2c6aa54e799e831cb89fbbf3e24666c4/WebRoot/WEB-INF/classes/com/andy/action/TeacherGetInfoByIdAction.class -------------------------------------------------------------------------------- /WebRoot/WEB-INF/classes/com/andy/action/TeacherLoginAction.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andybing/OnlineExamination/1d949e6c2c6aa54e799e831cb89fbbf3e24666c4/WebRoot/WEB-INF/classes/com/andy/action/TeacherLoginAction.class -------------------------------------------------------------------------------- /WebRoot/WEB-INF/classes/com/andy/action/TeacherLogoutAction.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andybing/OnlineExamination/1d949e6c2c6aa54e799e831cb89fbbf3e24666c4/WebRoot/WEB-INF/classes/com/andy/action/TeacherLogoutAction.class -------------------------------------------------------------------------------- /WebRoot/WEB-INF/classes/com/andy/action/TeacherModifyPasswordAction.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andybing/OnlineExamination/1d949e6c2c6aa54e799e831cb89fbbf3e24666c4/WebRoot/WEB-INF/classes/com/andy/action/TeacherModifyPasswordAction.class -------------------------------------------------------------------------------- /WebRoot/WEB-INF/classes/com/andy/action/TeacherShowInfoAction.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andybing/OnlineExamination/1d949e6c2c6aa54e799e831cb89fbbf3e24666c4/WebRoot/WEB-INF/classes/com/andy/action/TeacherShowInfoAction.class -------------------------------------------------------------------------------- /WebRoot/WEB-INF/classes/com/andy/action/TeacherUpdateAction.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andybing/OnlineExamination/1d949e6c2c6aa54e799e831cb89fbbf3e24666c4/WebRoot/WEB-INF/classes/com/andy/action/TeacherUpdateAction.class -------------------------------------------------------------------------------- /WebRoot/WEB-INF/classes/com/andy/action/UpdateQuestionAction.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andybing/OnlineExamination/1d949e6c2c6aa54e799e831cb89fbbf3e24666c4/WebRoot/WEB-INF/classes/com/andy/action/UpdateQuestionAction.class -------------------------------------------------------------------------------- /WebRoot/WEB-INF/classes/com/andy/dao/CourseDao.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andybing/OnlineExamination/1d949e6c2c6aa54e799e831cb89fbbf3e24666c4/WebRoot/WEB-INF/classes/com/andy/dao/CourseDao.class -------------------------------------------------------------------------------- /WebRoot/WEB-INF/classes/com/andy/dao/CourseDaoImpl.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andybing/OnlineExamination/1d949e6c2c6aa54e799e831cb89fbbf3e24666c4/WebRoot/WEB-INF/classes/com/andy/dao/CourseDaoImpl.class -------------------------------------------------------------------------------- /WebRoot/WEB-INF/classes/com/andy/dao/ManagerDao.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andybing/OnlineExamination/1d949e6c2c6aa54e799e831cb89fbbf3e24666c4/WebRoot/WEB-INF/classes/com/andy/dao/ManagerDao.class -------------------------------------------------------------------------------- /WebRoot/WEB-INF/classes/com/andy/dao/ManagerDaoImpl.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andybing/OnlineExamination/1d949e6c2c6aa54e799e831cb89fbbf3e24666c4/WebRoot/WEB-INF/classes/com/andy/dao/ManagerDaoImpl.class -------------------------------------------------------------------------------- /WebRoot/WEB-INF/classes/com/andy/dao/QuestionDao.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andybing/OnlineExamination/1d949e6c2c6aa54e799e831cb89fbbf3e24666c4/WebRoot/WEB-INF/classes/com/andy/dao/QuestionDao.class -------------------------------------------------------------------------------- /WebRoot/WEB-INF/classes/com/andy/dao/QuestionDaoImpl.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andybing/OnlineExamination/1d949e6c2c6aa54e799e831cb89fbbf3e24666c4/WebRoot/WEB-INF/classes/com/andy/dao/QuestionDaoImpl.class -------------------------------------------------------------------------------- /WebRoot/WEB-INF/classes/com/andy/dao/ScoreDao.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andybing/OnlineExamination/1d949e6c2c6aa54e799e831cb89fbbf3e24666c4/WebRoot/WEB-INF/classes/com/andy/dao/ScoreDao.class -------------------------------------------------------------------------------- /WebRoot/WEB-INF/classes/com/andy/dao/ScoreDaoImpl.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andybing/OnlineExamination/1d949e6c2c6aa54e799e831cb89fbbf3e24666c4/WebRoot/WEB-INF/classes/com/andy/dao/ScoreDaoImpl.class -------------------------------------------------------------------------------- /WebRoot/WEB-INF/classes/com/andy/dao/StudentDao.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andybing/OnlineExamination/1d949e6c2c6aa54e799e831cb89fbbf3e24666c4/WebRoot/WEB-INF/classes/com/andy/dao/StudentDao.class -------------------------------------------------------------------------------- /WebRoot/WEB-INF/classes/com/andy/dao/StudentDaoImpl.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andybing/OnlineExamination/1d949e6c2c6aa54e799e831cb89fbbf3e24666c4/WebRoot/WEB-INF/classes/com/andy/dao/StudentDaoImpl.class -------------------------------------------------------------------------------- /WebRoot/WEB-INF/classes/com/andy/dao/TeacherDao.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andybing/OnlineExamination/1d949e6c2c6aa54e799e831cb89fbbf3e24666c4/WebRoot/WEB-INF/classes/com/andy/dao/TeacherDao.class -------------------------------------------------------------------------------- /WebRoot/WEB-INF/classes/com/andy/dao/TeacherDaoImpl.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andybing/OnlineExamination/1d949e6c2c6aa54e799e831cb89fbbf3e24666c4/WebRoot/WEB-INF/classes/com/andy/dao/TeacherDaoImpl.class -------------------------------------------------------------------------------- /WebRoot/WEB-INF/classes/com/andy/entity/Course.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andybing/OnlineExamination/1d949e6c2c6aa54e799e831cb89fbbf3e24666c4/WebRoot/WEB-INF/classes/com/andy/entity/Course.class -------------------------------------------------------------------------------- /WebRoot/WEB-INF/classes/com/andy/entity/Course.hbm.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /WebRoot/WEB-INF/classes/com/andy/entity/Manager.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andybing/OnlineExamination/1d949e6c2c6aa54e799e831cb89fbbf3e24666c4/WebRoot/WEB-INF/classes/com/andy/entity/Manager.class -------------------------------------------------------------------------------- /WebRoot/WEB-INF/classes/com/andy/entity/Manager.hbm.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /WebRoot/WEB-INF/classes/com/andy/entity/Question.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andybing/OnlineExamination/1d949e6c2c6aa54e799e831cb89fbbf3e24666c4/WebRoot/WEB-INF/classes/com/andy/entity/Question.class -------------------------------------------------------------------------------- /WebRoot/WEB-INF/classes/com/andy/entity/Question.hbm.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | -------------------------------------------------------------------------------- /WebRoot/WEB-INF/classes/com/andy/entity/Score.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andybing/OnlineExamination/1d949e6c2c6aa54e799e831cb89fbbf3e24666c4/WebRoot/WEB-INF/classes/com/andy/entity/Score.class -------------------------------------------------------------------------------- /WebRoot/WEB-INF/classes/com/andy/entity/Score.hbm.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 7 | 8 | 9 | 10 | 11 | 12 | seq_score 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | -------------------------------------------------------------------------------- /WebRoot/WEB-INF/classes/com/andy/entity/Student.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andybing/OnlineExamination/1d949e6c2c6aa54e799e831cb89fbbf3e24666c4/WebRoot/WEB-INF/classes/com/andy/entity/Student.class -------------------------------------------------------------------------------- /WebRoot/WEB-INF/classes/com/andy/entity/Student.hbm.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /WebRoot/WEB-INF/classes/com/andy/entity/Teacher.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andybing/OnlineExamination/1d949e6c2c6aa54e799e831cb89fbbf3e24666c4/WebRoot/WEB-INF/classes/com/andy/entity/Teacher.class -------------------------------------------------------------------------------- /WebRoot/WEB-INF/classes/com/andy/entity/Teacher.hbm.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /WebRoot/WEB-INF/classes/com/andy/service/CourseService.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andybing/OnlineExamination/1d949e6c2c6aa54e799e831cb89fbbf3e24666c4/WebRoot/WEB-INF/classes/com/andy/service/CourseService.class -------------------------------------------------------------------------------- /WebRoot/WEB-INF/classes/com/andy/service/CourseServiceImpl.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andybing/OnlineExamination/1d949e6c2c6aa54e799e831cb89fbbf3e24666c4/WebRoot/WEB-INF/classes/com/andy/service/CourseServiceImpl.class -------------------------------------------------------------------------------- /WebRoot/WEB-INF/classes/com/andy/service/ManagerService.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andybing/OnlineExamination/1d949e6c2c6aa54e799e831cb89fbbf3e24666c4/WebRoot/WEB-INF/classes/com/andy/service/ManagerService.class -------------------------------------------------------------------------------- /WebRoot/WEB-INF/classes/com/andy/service/ManagerServiceImpl.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andybing/OnlineExamination/1d949e6c2c6aa54e799e831cb89fbbf3e24666c4/WebRoot/WEB-INF/classes/com/andy/service/ManagerServiceImpl.class -------------------------------------------------------------------------------- /WebRoot/WEB-INF/classes/com/andy/service/QuestionService.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andybing/OnlineExamination/1d949e6c2c6aa54e799e831cb89fbbf3e24666c4/WebRoot/WEB-INF/classes/com/andy/service/QuestionService.class -------------------------------------------------------------------------------- /WebRoot/WEB-INF/classes/com/andy/service/QuestionServiceImpl.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andybing/OnlineExamination/1d949e6c2c6aa54e799e831cb89fbbf3e24666c4/WebRoot/WEB-INF/classes/com/andy/service/QuestionServiceImpl.class -------------------------------------------------------------------------------- /WebRoot/WEB-INF/classes/com/andy/service/ScoreService.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andybing/OnlineExamination/1d949e6c2c6aa54e799e831cb89fbbf3e24666c4/WebRoot/WEB-INF/classes/com/andy/service/ScoreService.class -------------------------------------------------------------------------------- /WebRoot/WEB-INF/classes/com/andy/service/ScoreServiceImpl.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andybing/OnlineExamination/1d949e6c2c6aa54e799e831cb89fbbf3e24666c4/WebRoot/WEB-INF/classes/com/andy/service/ScoreServiceImpl.class -------------------------------------------------------------------------------- /WebRoot/WEB-INF/classes/com/andy/service/StudentService.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andybing/OnlineExamination/1d949e6c2c6aa54e799e831cb89fbbf3e24666c4/WebRoot/WEB-INF/classes/com/andy/service/StudentService.class -------------------------------------------------------------------------------- /WebRoot/WEB-INF/classes/com/andy/service/StudentServiceImpl.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andybing/OnlineExamination/1d949e6c2c6aa54e799e831cb89fbbf3e24666c4/WebRoot/WEB-INF/classes/com/andy/service/StudentServiceImpl.class -------------------------------------------------------------------------------- /WebRoot/WEB-INF/classes/com/andy/service/TeacherService.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andybing/OnlineExamination/1d949e6c2c6aa54e799e831cb89fbbf3e24666c4/WebRoot/WEB-INF/classes/com/andy/service/TeacherService.class -------------------------------------------------------------------------------- /WebRoot/WEB-INF/classes/com/andy/service/TeacherServiceImpl.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andybing/OnlineExamination/1d949e6c2c6aa54e799e831cb89fbbf3e24666c4/WebRoot/WEB-INF/classes/com/andy/service/TeacherServiceImpl.class -------------------------------------------------------------------------------- /WebRoot/WEB-INF/classes/com/andy/test/Test.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andybing/OnlineExamination/1d949e6c2c6aa54e799e831cb89fbbf3e24666c4/WebRoot/WEB-INF/classes/com/andy/test/Test.class -------------------------------------------------------------------------------- /WebRoot/WEB-INF/classes/com/andy/util/DBUtil.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andybing/OnlineExamination/1d949e6c2c6aa54e799e831cb89fbbf3e24666c4/WebRoot/WEB-INF/classes/com/andy/util/DBUtil.class -------------------------------------------------------------------------------- /WebRoot/WEB-INF/classes/com/andy/util/HibernateSessionUtil.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andybing/OnlineExamination/1d949e6c2c6aa54e799e831cb89fbbf3e24666c4/WebRoot/WEB-INF/classes/com/andy/util/HibernateSessionUtil.class -------------------------------------------------------------------------------- /WebRoot/WEB-INF/classes/hibernate.cfg.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | org.hibernate.dialect.Oracle9Dialect 12 | 13 | 14 | jdbc:oracle:thin:@127.0.0.1:1521:orcl 15 | 16 | scott 17 | tiger 18 | 19 | oracle.jdbc.driver.OracleDriver 20 | 21 | 22 | oracle.jdbc.driver.OracleDriver 23 | 24 | true 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /WebRoot/WEB-INF/classes/struts.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | main.jsp 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | image/jpeg 23 | inputStream 24 | 2048 25 | 26 | 27 | 28 | 29 | 31 | 32 | 33 | 34 | login.jsp 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | student/showInfo.jsp 43 | 44 | 45 | 46 | student/showScore.jsp 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | manager/showStudentInfo.jsp 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | login.jsp 69 | 70 | 71 | 72 | teacher/showInfo.jsp 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | manager/showTeacherInfo.jsp 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | teacher/showAllScore.jsp 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | login.jsp 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | -------------------------------------------------------------------------------- /WebRoot/WEB-INF/lib/ojdbc14.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andybing/OnlineExamination/1d949e6c2c6aa54e799e831cb89fbbf3e24666c4/WebRoot/WEB-INF/lib/ojdbc14.jar -------------------------------------------------------------------------------- /WebRoot/WEB-INF/web.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | Andy_OnlineExam 4 | 5 | 6 | struts2 7 | org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter 8 | 9 | 10 | struts2 11 | /* 12 | 13 | 14 | index.jsp 15 | 16 | 17 | -------------------------------------------------------------------------------- /WebRoot/help.jsp: -------------------------------------------------------------------------------- 1 | <%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%> 2 | <% 3 | String path = request.getContextPath(); 4 | String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/"; 5 | %> 6 | 7 | 8 | 9 | 10 | 11 | 12 | help 13 | 22 | 23 | 24 | 25 |
26 |
27 | 1)考生登录需要准考生、姓名、密码验证。

28 | 2)考生点击随机分配试卷开始本次考试,考卷按照系统随机分配。

29 | 3)请大家避免作弊情况发生。

30 | 4)考试系统管理人员可以对试卷进行修改。考生不得对试卷做任何修改。

31 |
32 | 35 |
36 | 37 | 38 | -------------------------------------------------------------------------------- /WebRoot/index.jsp: -------------------------------------------------------------------------------- 1 | <%@ page language="java" import="java.util.*" pageEncoding="ISO-8859-1"%> 2 | 3 | <% 4 | String path = request.getContextPath(); 5 | String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/"; 6 | %> 7 | 8 | 9 | 10 | 11 | 12 | 13 | My JSP 'index.jsp' starting page 14 | 15 | 16 | 17 | 18 | 19 | 20 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | -------------------------------------------------------------------------------- /WebRoot/main.jsp: -------------------------------------------------------------------------------- 1 | <%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%> 2 | <%@ taglib uri="/struts-tags" prefix="s"%> 3 | <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> 4 | <% 5 | String path = request.getContextPath(); 6 | String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/"; 7 | %> 8 | 9 | 10 | 11 | 12 | 13 | 答题界面 14 | 34 | 35 | 36 | 37 |
38 |

39 | 一.做好考前准备

40 | ①.老师必备物品:准考证、身份证、学生证、2B铅笔、橡皮、圆珠笔或者钢笔、手表、小刀、直尺等。
41 | ②.看一下考试当天天气预报。
42 | ③.考试前记得吃清淡一些,以清爽可口,易消化为主。四级考试前早饭一定要吃。
43 |
44 |
45 | 【${name}】 您好...您的答题时间:<%=new Date() %> 46 |
47 | <% int num = 1; %> 48 |
49 | 50 | 暂时没有考试题库 51 | 52 | 53 | 54 | 55 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 |
.
56 | 57 | A. 58 |
B.
C.
D.

73 |
74 | 75 | 76 |
77 |
78 |
79 | 141 | 142 | 143 | -------------------------------------------------------------------------------- /WebRoot/manager/showStudentInfo.jsp: -------------------------------------------------------------------------------- 1 | <%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%> 2 | <% 3 | String path = request.getContextPath(); 4 | String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/"; 5 | %> 6 | 7 | 8 | 9 | 10 | 11 | 12 | My JSP 'showStudentInfo.jsp' starting page 13 | 19 | 20 | 21 | 22 |
23 |
学生信息查询
24 |
25 | 姓名:

26 | 性别:

27 | 班级:

28 | 地址:

29 | 年级:

30 | 31 | 32 |
33 |
34 | 35 | 92 | 93 | 94 | -------------------------------------------------------------------------------- /WebRoot/manager/showTeacherInfo.jsp: -------------------------------------------------------------------------------- 1 | <%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%> 2 | <% 3 | String path = request.getContextPath(); 4 | String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/"; 5 | %> 6 | 7 | 8 | 9 | 10 | 11 | 12 | showStudentInfo page 13 | 19 | 20 | 21 | 22 |
23 |
教师信息查询
24 |
25 | 姓名:

26 | 性别:

27 | 地址:

28 | 29 | 30 |
31 |
32 | 33 | 78 | 79 | 80 | -------------------------------------------------------------------------------- /WebRoot/student/passwordModify.jsp: -------------------------------------------------------------------------------- 1 | <%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%> 2 | <% 3 | String path = request.getContextPath(); 4 | String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/"; 5 | %> 6 | 7 | 8 | 9 | 10 | 11 | PasswordModify 12 | 18 | 19 | 20 | 21 |
22 | 修改密码 23 |
24 |
25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 |
编    号:
姓    名:
旧 密 码:
新 密 码:
确认新密码:
47 | 48 | 49 |
50 |
51 |
52 | 53 | 99 | 100 | 101 | -------------------------------------------------------------------------------- /WebRoot/student/showInfo.jsp: -------------------------------------------------------------------------------- 1 | <%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%> 2 | <% 3 | String path = request.getContextPath(); 4 | String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/"; 5 | %> 6 | 7 | 8 | 9 | 10 | 11 | 12 | StudentInfo 13 | 19 | 20 | 21 | 22 |
23 | 个人信息 24 |
25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 |
编 号:${student.id }
姓 名:${student.name }
性 别:${student.sex }
班 级:${student.clas }
生源地:${student.location }
年 级:${student.grade }
33 | 34 |
35 |
36 | 37 | 38 | -------------------------------------------------------------------------------- /WebRoot/student/showScore.jsp: -------------------------------------------------------------------------------- 1 | <%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%> 2 | <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> 3 | <%@ taglib prefix="s" uri="/struts-tags" %> 4 | <% 5 | String path = request.getContextPath(); 6 | String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/"; 7 | %> 8 | 9 | 10 | 11 | 12 | 13 | My JSP 'showScore.jsp' starting page 14 | 23 | 24 | 25 | 26 |
27 | 个人成绩查询 28 |
29 | 30 |
31 | 及格成绩查询(下拉展开) 32 |
33 |
34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 |
学号姓名科目成绩通过情况任课教师
54 |
55 | 56 |
57 | 不及格成绩查询(下拉展开) 58 |
59 | 60 |
61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 |
学号姓名科目成绩通过情况任课教师
81 |
82 | 83 | 102 | 103 | 104 | -------------------------------------------------------------------------------- /WebRoot/teacher/passwordModify.jsp: -------------------------------------------------------------------------------- 1 | <%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%> 2 | <% 3 | String path = request.getContextPath(); 4 | String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/"; 5 | %> 6 | 7 | 8 | 9 | 10 | 11 | TeacherPasswordModify 12 | 18 | 19 | 20 | 21 |
22 | 修改密码 23 |
24 |
25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 |
编    号:
姓    名:
旧 密 码:
新 密 码:
确认新密码:
47 | 48 | 49 |
50 |
51 |
52 | 53 | 99 | 100 | 101 | -------------------------------------------------------------------------------- /WebRoot/teacher/showAllScore.jsp: -------------------------------------------------------------------------------- 1 | <%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%> 2 | <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> 3 | <% 4 | String path = request.getContextPath(); 5 | String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/"; 6 | %> 7 | 8 | 9 | 10 | 11 | 12 | 13 | My JSP 'showAllScore.jsp' starting page 14 | 24 | 25 | 26 | 27 |
课程成绩查询
28 |
总体成绩排名(下拉展开)
29 |
30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 |
学号姓名科目成绩通过情况任课教师
50 |
51 | 52 |
及格成绩查询(下拉展开)
53 |
54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 |
学号姓名科目成绩通过情况任课教师
74 |
75 | 76 |
不及格成绩查询(下拉展开)
77 |
78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 |
学号姓名科目成绩通过情况任课教师
98 |
99 | 100 | 128 | 129 | 130 | -------------------------------------------------------------------------------- /WebRoot/teacher/showInfo.jsp: -------------------------------------------------------------------------------- 1 | <%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%> 2 | <% 3 | String path = request.getContextPath(); 4 | String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/"; 5 | %> 6 | 7 | 8 | 9 | 10 | 11 | 12 | StudentInfo 13 | 19 | 20 | 21 | 22 |
23 | 个人信息 24 |
25 | 26 | 27 | 28 | 29 | 30 |
编 号:${teacher.id }
姓 名:${teacher.name }
性 别:${teacher.sex }
生源地:${teacher.location }
31 | 32 |
33 |
34 | 35 | 36 | -------------------------------------------------------------------------------- /WebRoot/welcome_stu.jsp: -------------------------------------------------------------------------------- 1 | <%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%> 2 | <% 3 | String path = request.getContextPath(); 4 | String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/"; 5 | %> 6 | 7 | 8 | 9 | 10 | 11 | 12 | Welcome 13 | 28 | 29 | 30 | 31 |
32 | Welcome to Online-Examination System 33 | 【${name}】 34 | 41 |
42 |
43 | 请选择考试科目: 44 |

50 | 请选择任课教师: 51 |

57 | 58 |
59 |
60 | 67 |
68 | 161 | 162 | 163 | -------------------------------------------------------------------------------- /src/com/andy/action/AddQuestionAction.java: -------------------------------------------------------------------------------- 1 | package com.andy.action; 2 | 3 | import java.io.IOException; 4 | import java.io.PrintWriter; 5 | 6 | import javax.servlet.http.HttpServletResponse; 7 | 8 | import org.apache.struts2.ServletActionContext; 9 | 10 | import com.andy.dao.QuestionDao; 11 | import com.andy.dao.QuestionDaoImpl; 12 | import com.andy.entity.Course; 13 | import com.andy.entity.Question; 14 | import com.andy.service.CourseService; 15 | import com.andy.service.CourseServiceImpl; 16 | import com.opensymphony.xwork2.ActionSupport; 17 | 18 | public class AddQuestionAction extends ActionSupport{ 19 | private QuestionDao questionDao = new QuestionDaoImpl(); 20 | private CourseService courseService = new CourseServiceImpl(); 21 | private String id; 22 | private String ques; 23 | private String choose1; 24 | private String choose2; 25 | private String choose3; 26 | private String choose4; 27 | private String anwser; 28 | private String courseName; 29 | 30 | public String getCourseName() { 31 | return courseName; 32 | } 33 | public void setCourseName(String courseName) { 34 | this.courseName = courseName; 35 | } 36 | public String getId() { 37 | return id; 38 | } 39 | public void setId(String id) { 40 | this.id = id; 41 | } 42 | public String getQues() { 43 | return ques; 44 | } 45 | public void setQues(String ques) { 46 | this.ques = ques; 47 | } 48 | public String getChoose1() { 49 | return choose1; 50 | } 51 | public void setChoose1(String choose1) { 52 | this.choose1 = choose1; 53 | } 54 | public String getChoose2() { 55 | return choose2; 56 | } 57 | public void setChoose2(String choose2) { 58 | this.choose2 = choose2; 59 | } 60 | public String getChoose3() { 61 | return choose3; 62 | } 63 | public void setChoose3(String choose3) { 64 | this.choose3 = choose3; 65 | } 66 | public String getChoose4() { 67 | return choose4; 68 | } 69 | public void setChoose4(String choose4) { 70 | this.choose4 = choose4; 71 | } 72 | 73 | public String getAnwser() { 74 | return anwser; 75 | } 76 | public void setAnwser(String anwser) { 77 | this.anwser = anwser; 78 | } 79 | public void add() throws IOException{ 80 | //System.out.println(id+"-"+ques+"-"+choose1+"-"+choose2+"-"+choose3+"-"+choose4+"-"+anwser+"-"+courseName); 81 | Question question = new Question(id,ques,choose1,choose2,choose3,choose4,anwser); 82 | Course c = courseService.getCourseByName(courseName); 83 | question.setCourse(c); 84 | HttpServletResponse response = ServletActionContext.getResponse(); 85 | PrintWriter out = response.getWriter(); 86 | if(questionDao.addQuestion(question)){ 87 | out.print("yes"); 88 | }else{ 89 | out.print("no"); 90 | } 91 | } 92 | } 93 | -------------------------------------------------------------------------------- /src/com/andy/action/CourseAddAction.java: -------------------------------------------------------------------------------- 1 | package com.andy.action; 2 | 3 | import java.io.IOException; 4 | import java.io.PrintWriter; 5 | import java.util.ArrayList; 6 | import java.util.HashSet; 7 | import java.util.List; 8 | import java.util.Set; 9 | 10 | import javax.servlet.http.HttpServletRequest; 11 | import javax.servlet.http.HttpServletResponse; 12 | 13 | import org.apache.struts2.ServletActionContext; 14 | 15 | import com.andy.entity.Course; 16 | import com.andy.entity.Teacher; 17 | import com.andy.service.CourseService; 18 | import com.andy.service.CourseServiceImpl; 19 | import com.andy.service.TeacherService; 20 | import com.andy.service.TeacherServiceImpl; 21 | import com.opensymphony.xwork2.ActionSupport; 22 | 23 | public class CourseAddAction extends ActionSupport{ 24 | private CourseService courseService = new CourseServiceImpl(); 25 | private TeacherService teacherService = new TeacherServiceImpl(); 26 | private String ccid; 27 | private String ccname; 28 | private String teacherName; 29 | 30 | public String getTeacherName() { 31 | return teacherName; 32 | } 33 | public void setTeacherName(String teacherName) { 34 | this.teacherName = teacherName; 35 | } 36 | public String getCcid() { 37 | return ccid; 38 | } 39 | public void setCcid(String ccid) { 40 | this.ccid = ccid; 41 | } 42 | public String getCcname() { 43 | return ccname; 44 | } 45 | public void setCcname(String ccname) { 46 | this.ccname = ccname; 47 | } 48 | public void add() throws IOException{ 49 | HttpServletRequest request = ServletActionContext.getRequest(); 50 | HttpServletResponse response = ServletActionContext.getResponse(); 51 | response.setCharacterEncoding("utf-8"); 52 | request.setCharacterEncoding("utf-8"); 53 | PrintWriter out = response.getWriter(); 54 | Course c = new Course(ccid,ccname); 55 | Teacher t = teacherService.getTeacherByName(teacherName); 56 | Set teachers = new HashSet(); 57 | teachers.add(t); 58 | c.setTeachers(teachers); 59 | if(courseService.addCourse(c)){ 60 | out.print("yes"); 61 | }else{ 62 | out.print("no"); 63 | } 64 | } 65 | } 66 | -------------------------------------------------------------------------------- /src/com/andy/action/CourseAddTeacherAction.java: -------------------------------------------------------------------------------- 1 | package com.andy.action; 2 | 3 | import java.io.IOException; 4 | import java.io.PrintWriter; 5 | import java.util.Set; 6 | 7 | import javax.servlet.http.HttpServletRequest; 8 | import javax.servlet.http.HttpServletResponse; 9 | 10 | import org.apache.struts2.ServletActionContext; 11 | 12 | import com.andy.entity.Course; 13 | import com.andy.entity.Teacher; 14 | import com.andy.service.CourseService; 15 | import com.andy.service.CourseServiceImpl; 16 | import com.andy.service.TeacherService; 17 | import com.andy.service.TeacherServiceImpl; 18 | import com.opensymphony.xwork2.ActionSupport; 19 | 20 | public class CourseAddTeacherAction extends ActionSupport{ 21 | private CourseService courseService = new CourseServiceImpl(); 22 | private TeacherService teacherService = new TeacherServiceImpl(); 23 | private String courseName; 24 | private String teacherName; 25 | public String getCourseName() { 26 | return courseName; 27 | } 28 | public void setCourseName(String courseName) { 29 | this.courseName = courseName; 30 | } 31 | public String getTeacherName() { 32 | return teacherName; 33 | } 34 | public void setTeacherName(String teacherName) { 35 | this.teacherName = teacherName; 36 | } 37 | public void set() throws IOException{ 38 | HttpServletResponse response = ServletActionContext.getResponse(); 39 | PrintWriter out = response.getWriter(); 40 | Course course = courseService.getCourseByName(courseName); 41 | Teacher teacher = teacherService.getTeacherByName(teacherName); 42 | if(courseService.setTeacher(course, teacher)){ 43 | out.print("yes"); 44 | }else{ 45 | out.print("no"); 46 | } 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /src/com/andy/action/CourseGetAllNamesAction.java: -------------------------------------------------------------------------------- 1 | package com.andy.action; 2 | 3 | import java.io.PrintWriter; 4 | import java.util.List; 5 | 6 | import javax.servlet.http.HttpServletRequest; 7 | import javax.servlet.http.HttpServletResponse; 8 | 9 | import org.apache.struts2.ServletActionContext; 10 | 11 | import com.andy.service.CourseService; 12 | import com.andy.service.CourseServiceImpl; 13 | import com.opensymphony.xwork2.ActionSupport; 14 | 15 | public class CourseGetAllNamesAction extends ActionSupport{ 16 | private CourseService courseService = new CourseServiceImpl(); 17 | 18 | public void getNames() throws Exception { 19 | HttpServletRequest request = ServletActionContext.getRequest(); 20 | HttpServletResponse response = ServletActionContext.getResponse(); 21 | response.setCharacterEncoding("utf-8"); 22 | PrintWriter out = response.getWriter(); 23 | List names = courseService.getAllNames(); 24 | StringBuffer sb = new StringBuffer(); 25 | for(String s : names){ 26 | sb.append(s+" "); 27 | } 28 | out.print(sb.toString()); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /src/com/andy/action/CourseGetAllTeachersAction.java: -------------------------------------------------------------------------------- 1 | package com.andy.action; 2 | 3 | import java.io.IOException; 4 | import java.io.PrintWriter; 5 | import java.io.UnsupportedEncodingException; 6 | import java.util.Set; 7 | 8 | import javax.servlet.http.HttpServletRequest; 9 | import javax.servlet.http.HttpServletResponse; 10 | 11 | import org.apache.struts2.ServletActionContext; 12 | 13 | import com.andy.entity.Teacher; 14 | import com.andy.service.CourseService; 15 | import com.andy.service.CourseServiceImpl; 16 | import com.opensymphony.xwork2.ActionSupport; 17 | 18 | public class CourseGetAllTeachersAction extends ActionSupport{ 19 | private CourseService courseService = new CourseServiceImpl(); 20 | private String courseName; 21 | 22 | public String getCourseName() { 23 | return courseName; 24 | } 25 | 26 | public void setCourseName(String courseName) { 27 | this.courseName = courseName; 28 | } 29 | 30 | public void getTeachers() throws IOException{ 31 | if(courseName.length()==3 && courseName.endsWith(" ")){ 32 | courseName = "C++"; 33 | } 34 | HttpServletRequest request = ServletActionContext.getRequest(); 35 | HttpServletResponse response = ServletActionContext.getResponse(); 36 | request.setCharacterEncoding("utf-8"); 37 | response.setCharacterEncoding("utf-8"); 38 | PrintWriter out = response.getWriter(); 39 | Set teachers = courseService.getAllTeachers(courseName); 40 | StringBuffer sb = new StringBuffer(); 41 | for(Teacher t : teachers){ 42 | sb.append(t.getName()+" "); 43 | } 44 | out.print(sb.toString()); 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /src/com/andy/action/DeleteQuestionAction.java: -------------------------------------------------------------------------------- 1 | package com.andy.action; 2 | 3 | import java.io.IOException; 4 | import java.io.PrintWriter; 5 | 6 | import javax.servlet.http.HttpServletResponse; 7 | 8 | import org.apache.struts2.ServletActionContext; 9 | 10 | import com.andy.dao.QuestionDao; 11 | import com.andy.dao.QuestionDaoImpl; 12 | import com.opensymphony.xwork2.ActionSupport; 13 | 14 | public class DeleteQuestionAction extends ActionSupport{ 15 | private QuestionDao questionDao = new QuestionDaoImpl(); 16 | private String id3 ; 17 | 18 | public String getId3() { 19 | return id3; 20 | } 21 | 22 | public void setId3(String id3) { 23 | this.id3 = id3; 24 | } 25 | public void delete() throws IOException{ 26 | HttpServletResponse response = ServletActionContext.getResponse(); 27 | PrintWriter out = response.getWriter(); 28 | if(questionDao.deleteQuestion(Integer.parseInt(id3))){ 29 | out.print("yes"); 30 | }else{ 31 | out.print("no"); 32 | } 33 | //System.out.println("123"); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /src/com/andy/action/ImageReponseAction.java: -------------------------------------------------------------------------------- 1 | package com.andy.action; 2 | 3 | 4 | import java.awt.Color; 5 | import java.awt.Font; 6 | import java.awt.Graphics; 7 | import java.awt.image.BufferedImage; 8 | import java.io.ByteArrayInputStream; 9 | import java.io.ByteArrayOutputStream; 10 | import java.io.IOException; 11 | import java.io.OutputStream; 12 | import java.io.PrintWriter; 13 | import java.util.Map; 14 | import java.util.Random; 15 | 16 | import javax.imageio.ImageIO; 17 | import javax.imageio.stream.ImageOutputStream; 18 | import javax.servlet.http.HttpServletRequest; 19 | import javax.servlet.http.HttpServletResponse; 20 | 21 | import org.apache.struts2.ServletActionContext; 22 | import org.apache.struts2.interceptor.SessionAware; 23 | 24 | import com.opensymphony.xwork2.ActionSupport; 25 | 26 | public class ImageReponseAction extends ActionSupport implements SessionAware{ 27 | private Map session; 28 | private ByteArrayInputStream inputStream; 29 | private String code; 30 | 31 | public String getCode() { 32 | return code; 33 | } 34 | public void setCode(String code) { 35 | this.code = code; 36 | } 37 | public ByteArrayInputStream getInputStream() { 38 | return inputStream; 39 | } 40 | public void setInputStream(ByteArrayInputStream inputStream) { 41 | this.inputStream = inputStream; 42 | } 43 | public Map getSession() { 44 | return session; 45 | } 46 | public void setSession(Map session) { 47 | this.session = session; 48 | } 49 | public BufferedImage createImage(){ 50 | int width = 80, height = 20; 51 | // 建立指定宽、高BufferedImage对象 52 | BufferedImage image = new BufferedImage(width, height, 53 | BufferedImage.TYPE_INT_RGB); 54 | 55 | Graphics g = image.getGraphics(); 56 | 57 | // 生成随机类 58 | Random random = new Random(); 59 | 60 | g.fillRect(0, 0, width, height); 61 | // 设置字体 62 | g.setFont(new Font("Times New Roman", Font.ITALIC, 18)); 63 | String sRand = ""; 64 | for (int i = 0; i < 4; i++) { 65 | String rand = String.valueOf(random.nextInt(10)); 66 | sRand += rand; 67 | // 设置随机颜色 68 | g.setColor(new Color(20 + random.nextInt(110), 20 + random 69 | .nextInt(110), 20 + random.nextInt(110))); 70 | // 绘制 71 | g.drawString(rand, 20 * i + 6, 16); 72 | } 73 | code = sRand; 74 | // System.out.println(sRand+" "+code); 75 | g.dispose(); 76 | return image; 77 | } 78 | public ByteArrayInputStream convertImageToStream(BufferedImage image) throws IOException{ 79 | ByteArrayInputStream inputStream = null; 80 | ByteArrayOutputStream bos = new ByteArrayOutputStream(); 81 | ImageOutputStream imOut = ImageIO.createImageOutputStream(bos); 82 | ImageIO.write(image, "jpg", imOut); 83 | inputStream = new ByteArrayInputStream(bos.toByteArray()); 84 | return inputStream; 85 | 86 | } 87 | @Override 88 | public String execute() throws Exception { 89 | inputStream = convertImageToStream(createImage()); 90 | session.put("code_session", code); 91 | return SUCCESS; 92 | } 93 | } 94 | -------------------------------------------------------------------------------- /src/com/andy/action/JuageAnwserAction.java: -------------------------------------------------------------------------------- 1 | package com.andy.action; 2 | 3 | import java.io.PrintWriter; 4 | import java.util.HashSet; 5 | import java.util.List; 6 | import java.util.Set; 7 | 8 | import javax.servlet.http.HttpServletRequest; 9 | import javax.servlet.http.HttpServletResponse; 10 | 11 | import org.apache.struts2.ServletActionContext; 12 | import com.andy.entity.Course; 13 | import com.andy.entity.Question; 14 | import com.andy.entity.Score; 15 | import com.andy.entity.Student; 16 | import com.andy.entity.Teacher; 17 | import com.andy.service.CourseService; 18 | import com.andy.service.CourseServiceImpl; 19 | import com.andy.service.QuestionService; 20 | import com.andy.service.QuestionServiceImpl; 21 | import com.andy.service.ScoreService; 22 | import com.andy.service.ScoreServiceImpl; 23 | import com.andy.service.StudentService; 24 | import com.andy.service.StudentServiceImpl; 25 | import com.andy.service.TeacherService; 26 | import com.andy.service.TeacherServiceImpl; 27 | import com.opensymphony.xwork2.ActionSupport; 28 | 29 | public class JuageAnwserAction extends ActionSupport{ 30 | private String anwser; 31 | private QuestionService questionService = new QuestionServiceImpl(); 32 | private CourseService courseService = new CourseServiceImpl(); 33 | private StudentService studentService = new StudentServiceImpl(); 34 | private TeacherService teacherService = new TeacherServiceImpl(); 35 | private ScoreService scoreService = new ScoreServiceImpl(); 36 | public String getAnwser() { 37 | return anwser; 38 | } 39 | 40 | public void setAnwser(String anwser) { 41 | this.anwser = anwser; 42 | } 43 | public void juage() throws Exception { 44 | HttpServletRequest request = ServletActionContext.getRequest(); 45 | HttpServletResponse response = ServletActionContext.getResponse(); 46 | PrintWriter out = response.getWriter(); 47 | int score = 0; 48 | String[] anwser1 = anwser.split(" "); 49 | Set questions = (Set) request.getSession().getAttribute("questions"); 50 | StringBuffer anwser_db = new StringBuffer(); 51 | for(Question q:questions){ 52 | anwser_db.append(questionService.getAnwserByQuestionId(q.getId())+" "); 53 | } 54 | String[] anwser2 = anwser_db.toString().split(" "); 55 | for(int i = 0;i students = new HashSet(); 76 | students.add(student); 77 | //获取现在课程所属老师的实体 78 | Teacher teacher = teacherService.getTeacherByName(teacherName); 79 | 80 | //新建成绩实体 81 | Score s = new Score(student.getId(),studentName,teacher.getId(), 82 | teacher.getName(),course.getId(),courseName,score*20,score*20>=60?"及格":"不及格"); 83 | //Set scores = new HashSet(); 84 | //scores.add(s); 85 | //给当前课程设置 成绩,学生,老师 86 | //course.setStudents(students); 87 | //course.setScores(scores); 88 | //courseService.saveScore(course,s); 89 | if(scoreService.saveScore(s)){ 90 | out.print(score); 91 | }else{ 92 | out.print("again"); 93 | } 94 | 95 | } 96 | public static void main(String[] args) throws Exception { 97 | new JuageAnwserAction().juage(); 98 | } 99 | } 100 | -------------------------------------------------------------------------------- /src/com/andy/action/ManagerLoginAction.java: -------------------------------------------------------------------------------- 1 | package com.andy.action; 2 | 3 | import java.io.IOException; 4 | import java.io.PrintWriter; 5 | 6 | import javax.servlet.http.HttpServletRequest; 7 | import javax.servlet.http.HttpSession; 8 | 9 | import org.apache.struts2.ServletActionContext; 10 | 11 | import com.andy.entity.Manager; 12 | import com.andy.entity.Student; 13 | import com.andy.service.ManagerService; 14 | import com.andy.service.ManagerServiceImpl; 15 | import com.opensymphony.xwork2.ActionSupport; 16 | 17 | public class ManagerLoginAction extends ActionSupport{ 18 | private ManagerService managerService = new ManagerServiceImpl(); 19 | private String mid; 20 | private String mname; 21 | private String mpassword; 22 | private String mcode; 23 | public String getMid() { 24 | return mid; 25 | } 26 | public void setMid(String mid) { 27 | this.mid = mid; 28 | } 29 | public String getMname() { 30 | return mname; 31 | } 32 | public void setMname(String mname) { 33 | this.mname = mname; 34 | } 35 | public String getMpassword() { 36 | return mpassword; 37 | } 38 | public void setMpassword(String mpassword) { 39 | this.mpassword = mpassword; 40 | } 41 | public String getMcode() { 42 | return mcode; 43 | } 44 | public void setMcode(String mcode) { 45 | this.mcode = mcode; 46 | } 47 | public void login() throws IOException{ 48 | 49 | HttpServletRequest request = ServletActionContext.getRequest(); 50 | HttpSession session = request.getSession(); 51 | PrintWriter out = ServletActionContext.getResponse().getWriter(); 52 | String code_session = (String) session.getAttribute("code_session"); 53 | if(mcode.equalsIgnoreCase(code_session)){ 54 | if(managerService.login(new Manager(mid,mname,mpassword))){ 55 | session.setAttribute("mname", mname); 56 | session.setAttribute("mid", mid); 57 | out.print("yes"); 58 | }else{ 59 | out.print("no"); 60 | } 61 | }else{ 62 | out.print("codeError"); 63 | } 64 | } 65 | } 66 | -------------------------------------------------------------------------------- /src/com/andy/action/ManagerLogoutAction.java: -------------------------------------------------------------------------------- 1 | package com.andy.action; 2 | 3 | import javax.servlet.http.HttpServletRequest; 4 | 5 | import org.apache.struts2.ServletActionContext; 6 | 7 | import com.opensymphony.xwork2.ActionSupport; 8 | 9 | public class ManagerLogoutAction extends ActionSupport{ 10 | @Override 11 | public String execute() throws Exception { 12 | HttpServletRequest request = ServletActionContext.getRequest(); 13 | request.getSession().invalidate(); 14 | return "login"; 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /src/com/andy/action/PaperSetCouAndTeaAction.java: -------------------------------------------------------------------------------- 1 | package com.andy.action; 2 | 3 | import java.io.IOException; 4 | 5 | import javax.servlet.http.HttpServletRequest; 6 | import javax.servlet.http.HttpServletResponse; 7 | 8 | import org.apache.struts2.ServletActionContext; 9 | 10 | import com.opensymphony.xwork2.ActionSupport; 11 | 12 | public class PaperSetCouAndTeaAction extends ActionSupport{ 13 | private String courseName; 14 | private String teacherName; 15 | private String studentName; 16 | 17 | public String getStudentName() { 18 | return studentName; 19 | } 20 | public void setStudentName(String studentName) { 21 | this.studentName = studentName; 22 | } 23 | public String getCourseName() { 24 | return courseName; 25 | } 26 | public void setCourseName(String courseName) { 27 | this.courseName = courseName; 28 | } 29 | public String getTeacherName() { 30 | return teacherName; 31 | } 32 | public void setTeacherName(String teacherName) { 33 | this.teacherName = teacherName; 34 | } 35 | public void saveCouAndTea() throws IOException{ 36 | //System.out.println(courseName+" "+teacherName); 37 | HttpServletRequest request = ServletActionContext.getRequest(); 38 | HttpServletResponse response = ServletActionContext.getResponse(); 39 | request.getSession().setAttribute("courseName", courseName); 40 | request.getSession().setAttribute("teacherName", teacherName); 41 | request.getSession().setAttribute("studentName", studentName); 42 | String studentId =(String) request.getSession().getAttribute("studentId"); 43 | 44 | response.getWriter().print("yes"); 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /src/com/andy/action/QuestionMainAction.java: -------------------------------------------------------------------------------- 1 | package com.andy.action; 2 | 3 | import java.util.ArrayList; 4 | import java.util.HashSet; 5 | import java.util.List; 6 | import java.util.Random; 7 | import java.util.Set; 8 | 9 | import javax.servlet.http.HttpServletRequest; 10 | 11 | import org.apache.struts2.ServletActionContext; 12 | 13 | import com.andy.dao.QuestionDao; 14 | import com.andy.dao.QuestionDaoImpl; 15 | import com.andy.entity.Course; 16 | import com.andy.entity.Question; 17 | import com.andy.service.CourseService; 18 | import com.andy.service.CourseServiceImpl; 19 | import com.opensymphony.xwork2.ActionSupport; 20 | 21 | public class QuestionMainAction extends ActionSupport{ 22 | private CourseService courseService = new CourseServiceImpl(); 23 | private Set questions = new HashSet(); 24 | private int size ; 25 | 26 | public void setSize(int size) { 27 | this.size = size; 28 | } 29 | public int getSize() { 30 | return questions.size(); 31 | } 32 | public Set getQuestions() { 33 | return questions; 34 | } 35 | public void setQuestions(Set questions) { 36 | this.questions = questions; 37 | } 38 | private QuestionDao questionDao = new QuestionDaoImpl(); 39 | @Override 40 | public String execute() throws Exception { 41 | HttpServletRequest request = ServletActionContext.getRequest(); 42 | String courseName =(String) request.getSession().getAttribute("courseName"); 43 | if(courseName.length() ==3 && courseName.endsWith(" ")){ 44 | courseName = "C++"; 45 | } 46 | Course course = courseService.getCourseByName(courseName); 47 | List qs = new ArrayList(); 48 | qs = questionDao.getQuestionsByCourseId(course.getId()); 49 | if(qs.size()>=5){ 50 | for(int i = 0;i allScore = new ArrayList(); 18 | private List jigeScore = new ArrayList(); 19 | private List bujigeScore = new ArrayList(); 20 | public List getAllScore() { 21 | return allScore; 22 | } 23 | public void setAllScore(List allScore) { 24 | this.allScore = allScore; 25 | } 26 | public List getJigeScore() { 27 | return jigeScore; 28 | } 29 | public void setJigeScore(List jigeScore) { 30 | this.jigeScore = jigeScore; 31 | } 32 | public List getBujigeScore() { 33 | return bujigeScore; 34 | } 35 | public void setBujigeScore(List bujigeScore) { 36 | this.bujigeScore = bujigeScore; 37 | } 38 | @Override 39 | public String execute() throws Exception { 40 | HttpServletRequest request = ServletActionContext.getRequest(); 41 | String courseName =(String) request.getSession().getAttribute("courseName"); 42 | String teacherName = (String) request.getSession().getAttribute("teacherName"); 43 | String studentName = (String) request.getSession().getAttribute("studentName"); 44 | allScore = scoreService.getAllScore(courseName, teacherName,studentName); 45 | jigeScore = scoreService.getPassedScore(courseName, teacherName,studentName); 46 | bujigeScore = scoreService.getUnpassedScore(courseName, teacherName,studentName); 47 | return "showAllScore"; 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /src/com/andy/action/StudentAddAction.java: -------------------------------------------------------------------------------- 1 | package com.andy.action; 2 | 3 | import java.io.IOException; 4 | import java.io.PrintWriter; 5 | 6 | import javax.servlet.http.HttpServletRequest; 7 | import javax.servlet.http.HttpServletResponse; 8 | 9 | import org.apache.struts2.ServletActionContext; 10 | 11 | import com.andy.entity.Student; 12 | import com.andy.service.StudentService; 13 | import com.andy.service.StudentServiceImpl; 14 | import com.opensymphony.xwork2.ActionSupport; 15 | 16 | public class StudentAddAction extends ActionSupport{ 17 | private StudentService studentService = new StudentServiceImpl(); 18 | private String id; 19 | private String name; 20 | private String sex; 21 | private String clas; 22 | private String location; 23 | private String grade; 24 | private String password; 25 | public String getId() { 26 | return id; 27 | } 28 | public void setId(String id) { 29 | this.id = id; 30 | } 31 | public String getName() { 32 | return name; 33 | } 34 | public void setName(String name) { 35 | this.name = name; 36 | } 37 | public String getSex() { 38 | return sex; 39 | } 40 | public void setSex(String sex) { 41 | this.sex = sex; 42 | } 43 | public String getClas() { 44 | return clas; 45 | } 46 | public void setClas(String clas) { 47 | this.clas = clas; 48 | } 49 | public String getLocation() { 50 | return location; 51 | } 52 | public void setLocation(String location) { 53 | this.location = location; 54 | } 55 | public String getGrade() { 56 | return grade; 57 | } 58 | public void setGrade(String grade) { 59 | this.grade = grade; 60 | } 61 | public String getPassword() { 62 | return password; 63 | } 64 | public void setPassword(String password) { 65 | this.password = password; 66 | } 67 | public void add() throws IOException{ 68 | HttpServletRequest request = ServletActionContext.getRequest(); 69 | HttpServletResponse response = ServletActionContext.getResponse(); 70 | request.setCharacterEncoding("utf-8"); 71 | response.setCharacterEncoding("utf-8"); 72 | PrintWriter out = response.getWriter(); 73 | Student student = new Student(id,name,sex,clas,location,grade,password); 74 | if(studentService.addStudent(student)){ 75 | out.print("yes"); 76 | }else{ 77 | out.print("no"); 78 | } 79 | } 80 | } 81 | -------------------------------------------------------------------------------- /src/com/andy/action/StudentDeleteAction.java: -------------------------------------------------------------------------------- 1 | package com.andy.action; 2 | 3 | import java.io.IOException; 4 | import java.io.PrintWriter; 5 | import java.io.UnsupportedEncodingException; 6 | 7 | import javax.servlet.http.HttpServletRequest; 8 | import javax.servlet.http.HttpServletResponse; 9 | 10 | import org.apache.struts2.ServletActionContext; 11 | 12 | import com.andy.service.StudentService; 13 | import com.andy.service.StudentServiceImpl; 14 | import com.opensymphony.xwork2.ActionSupport; 15 | 16 | public class StudentDeleteAction extends ActionSupport{ 17 | private StudentService studentService = new StudentServiceImpl(); 18 | private String cid; 19 | 20 | public String getCid() { 21 | return cid; 22 | } 23 | 24 | public void setCid(String cid) { 25 | this.cid = cid; 26 | } 27 | public void delete() throws IOException{ 28 | HttpServletRequest request = ServletActionContext.getRequest(); 29 | HttpServletResponse response = ServletActionContext.getResponse(); 30 | request.setCharacterEncoding("utf-8"); 31 | response.setCharacterEncoding("utf-8"); 32 | PrintWriter out = response.getWriter(); 33 | if(studentService.deleteStudent(cid)){ 34 | out.print("deleteok"); 35 | }else{ 36 | out.print("deletefail"); 37 | } 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /src/com/andy/action/StudentGetAllNamesAction.java: -------------------------------------------------------------------------------- 1 | package com.andy.action; 2 | 3 | import java.io.PrintWriter; 4 | import java.util.List; 5 | 6 | import javax.servlet.http.HttpServletRequest; 7 | import javax.servlet.http.HttpServletResponse; 8 | 9 | import org.apache.struts2.ServletActionContext; 10 | 11 | import com.andy.service.StudentService; 12 | import com.andy.service.StudentServiceImpl; 13 | import com.opensymphony.xwork2.ActionSupport; 14 | 15 | public class StudentGetAllNamesAction extends ActionSupport{ 16 | private StudentService studentService = new StudentServiceImpl(); 17 | public void getAllNames() throws Exception { 18 | HttpServletRequest request = ServletActionContext.getRequest(); 19 | HttpServletResponse response = ServletActionContext.getResponse(); 20 | response.setCharacterEncoding("utf-8"); 21 | PrintWriter out = response.getWriter(); 22 | List names = studentService.getAllNames(); 23 | StringBuffer sb = new StringBuffer(); 24 | for(String s : names){ 25 | sb.append(s+" "); 26 | } 27 | out.print(sb.toString()); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /src/com/andy/action/StudentGetInfoByIdAction.java: -------------------------------------------------------------------------------- 1 | package com.andy.action; 2 | 3 | import javax.servlet.http.HttpServletRequest; 4 | 5 | import org.apache.struts2.ServletActionContext; 6 | 7 | import com.andy.entity.Student; 8 | import com.andy.service.StudentService; 9 | import com.andy.service.StudentServiceImpl; 10 | import com.opensymphony.xwork2.ActionSupport; 11 | 12 | public class StudentGetInfoByIdAction extends ActionSupport{ 13 | private StudentService studentService = new StudentServiceImpl(); 14 | private String sid; 15 | private Student student; 16 | 17 | public Student getStudent() { 18 | return student; 19 | } 20 | 21 | public void setStudent(Student student) { 22 | this.student = student; 23 | } 24 | 25 | public String getSid() { 26 | return sid; 27 | } 28 | 29 | public void setSid(String sid) { 30 | this.sid = sid; 31 | } 32 | @Override 33 | public String execute() throws Exception { 34 | HttpServletRequest request = ServletActionContext.getRequest(); 35 | request.getSession().setAttribute("studentId", sid); 36 | student = studentService.getStudentById(sid); 37 | return "showStudentInfo"; 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /src/com/andy/action/StudentLoginAction.java: -------------------------------------------------------------------------------- 1 | package com.andy.action; 2 | 3 | import java.io.IOException; 4 | import java.io.PrintWriter; 5 | 6 | import javax.servlet.http.HttpServletRequest; 7 | import javax.servlet.http.HttpSession; 8 | 9 | import org.apache.struts2.ServletActionContext; 10 | 11 | import com.andy.entity.Student; 12 | import com.andy.service.StudentService; 13 | import com.andy.service.StudentServiceImpl; 14 | import com.opensymphony.xwork2.ActionContext; 15 | import com.opensymphony.xwork2.ActionSupport; 16 | 17 | public class StudentLoginAction extends ActionSupport{ 18 | /** 19 | * 20 | */ 21 | private static final long serialVersionUID = 1L; 22 | private StudentService studentService = new StudentServiceImpl(); 23 | private String id; 24 | private String name; 25 | private String password; 26 | private String code; 27 | public String getId() { 28 | return id; 29 | } 30 | public void setId(String id) { 31 | this.id = id; 32 | } 33 | public String getName() { 34 | return name; 35 | } 36 | public void setName(String name) { 37 | this.name = name; 38 | } 39 | public String getPassword() { 40 | return password; 41 | } 42 | public void setPassword(String password) { 43 | this.password = password; 44 | } 45 | 46 | public String getCode() { 47 | return code; 48 | } 49 | public void setCode(String code) { 50 | this.code = code; 51 | } 52 | public void login() throws IOException{ 53 | HttpServletRequest request = ServletActionContext.getRequest(); 54 | HttpSession session = request.getSession(); 55 | PrintWriter out = ServletActionContext.getResponse().getWriter(); 56 | String code_session = (String) session.getAttribute("code_session"); 57 | if(code.equalsIgnoreCase(code_session)){ 58 | if(studentService.login(new Student(id,name,password))){ 59 | session.setAttribute("studentName", name); 60 | session.setAttribute("studentId", id); 61 | session.setAttribute("name", name); 62 | session.setAttribute("id", id); 63 | out.print("yes"); 64 | }else{ 65 | out.print("no"); 66 | } 67 | }else{ 68 | out.print("codeError"); 69 | } 70 | } 71 | } 72 | -------------------------------------------------------------------------------- /src/com/andy/action/StudentLogoutAction.java: -------------------------------------------------------------------------------- 1 | package com.andy.action; 2 | 3 | import javax.servlet.http.HttpServletRequest; 4 | 5 | import org.apache.struts2.ServletActionContext; 6 | 7 | import com.opensymphony.xwork2.ActionSupport; 8 | 9 | public class StudentLogoutAction extends ActionSupport{ 10 | @Override 11 | public String execute() throws Exception { 12 | HttpServletRequest request = ServletActionContext.getRequest(); 13 | request.getSession().invalidate(); 14 | return "login"; 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /src/com/andy/action/StudentModifyPasswordAction.java: -------------------------------------------------------------------------------- 1 | package com.andy.action; 2 | 3 | import java.io.IOException; 4 | import java.io.PrintWriter; 5 | 6 | import javax.servlet.http.HttpServletRequest; 7 | import javax.servlet.http.HttpServletResponse; 8 | 9 | import org.apache.struts2.ServletActionContext; 10 | 11 | import com.andy.dao.StudentDao; 12 | import com.andy.dao.StudentDaoImpl; 13 | import com.andy.entity.Student; 14 | import com.andy.service.StudentService; 15 | import com.andy.service.StudentServiceImpl; 16 | import com.opensymphony.xwork2.ActionSupport; 17 | 18 | public class StudentModifyPasswordAction extends ActionSupport{ 19 | private StudentService studentService = new StudentServiceImpl(); 20 | private String id; 21 | private String name; 22 | private String password1; 23 | private String password2; 24 | public String getId() { 25 | return id; 26 | } 27 | public void setId(String id) { 28 | this.id = id; 29 | } 30 | public String getName() { 31 | return name; 32 | } 33 | public void setName(String name) { 34 | this.name = name; 35 | } 36 | public String getPassword1() { 37 | return password1; 38 | } 39 | public void setPassword1(String password1) { 40 | this.password1 = password1; 41 | } 42 | public String getPassword2() { 43 | return password2; 44 | } 45 | public void setPassword2(String password2) { 46 | this.password2 = password2; 47 | } 48 | public void modify() throws IOException{ 49 | HttpServletRequest request = ServletActionContext.getRequest(); 50 | HttpServletResponse response = ServletActionContext.getResponse(); 51 | PrintWriter out = response.getWriter(); 52 | if(studentService.modifyPassword(id,password1, password2)){ 53 | out.print("yes"); 54 | }else{ 55 | out.print("no"); 56 | } 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /src/com/andy/action/StudentShowInfoAction.java: -------------------------------------------------------------------------------- 1 | package com.andy.action; 2 | 3 | import javax.servlet.http.HttpServletRequest; 4 | 5 | import org.apache.struts2.ServletActionContext; 6 | 7 | import com.andy.entity.Student; 8 | import com.andy.service.StudentService; 9 | import com.andy.service.StudentServiceImpl; 10 | import com.opensymphony.xwork2.ActionSupport; 11 | 12 | public class StudentShowInfoAction extends ActionSupport{ 13 | private Student student ; 14 | 15 | public Student getStudent() { 16 | return student; 17 | } 18 | public void setStudent(Student student) { 19 | this.student = student; 20 | } 21 | private StudentService studentService = new StudentServiceImpl(); 22 | @Override 23 | public String execute() throws Exception { 24 | HttpServletRequest request = ServletActionContext.getRequest(); 25 | String id =(String) request.getSession().getAttribute("id"); 26 | student = studentService.getStudentById(id); 27 | return "studentInfo"; 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /src/com/andy/action/StudentShowScoreAction.java: -------------------------------------------------------------------------------- 1 | package com.andy.action; 2 | 3 | import java.util.ArrayList; 4 | import java.util.List; 5 | 6 | import javax.servlet.http.HttpServletRequest; 7 | 8 | import org.apache.struts2.ServletActionContext; 9 | 10 | import com.andy.entity.Score; 11 | import com.andy.service.ScoreService; 12 | import com.andy.service.ScoreServiceImpl; 13 | import com.opensymphony.xwork2.ActionSupport; 14 | 15 | public class StudentShowScoreAction extends ActionSupport{ 16 | private ScoreService scoreService = new ScoreServiceImpl(); 17 | private List passedScore = new ArrayList(); 18 | private List unPassedScore = new ArrayList(); 19 | public List getPassedScore() { 20 | return passedScore; 21 | } 22 | 23 | public void setPassedScore(List passedScore) { 24 | this.passedScore = passedScore; 25 | } 26 | 27 | public ScoreService getScoreService() { 28 | return scoreService; 29 | } 30 | 31 | public void setScoreService(ScoreService scoreService) { 32 | this.scoreService = scoreService; 33 | } 34 | 35 | public List getUnPassedScore() { 36 | return unPassedScore; 37 | } 38 | 39 | public void setUnPassedScore(List unPassedScore) { 40 | this.unPassedScore = unPassedScore; 41 | } 42 | 43 | @Override 44 | public String execute() throws Exception { 45 | HttpServletRequest request = ServletActionContext.getRequest(); 46 | String studentId = (String) request.getSession().getAttribute("id"); 47 | passedScore = scoreService.getPassedScore(studentId); 48 | unPassedScore = scoreService.getUnPassedScore(studentId); 49 | request.setAttribute("passedScore", passedScore); 50 | request.setAttribute("unPassedScore", unPassedScore); 51 | return "showScore"; 52 | } 53 | // public static void main(String[] args) throws Exception { 54 | // new StudentShowScoreAction().execute(); 55 | // } 56 | } 57 | -------------------------------------------------------------------------------- /src/com/andy/action/StudentUpdateAction.java: -------------------------------------------------------------------------------- 1 | package com.andy.action; 2 | 3 | import java.io.IOException; 4 | import java.io.PrintWriter; 5 | 6 | import javax.servlet.http.HttpServletRequest; 7 | import javax.servlet.http.HttpServletResponse; 8 | 9 | import org.apache.struts2.ServletActionContext; 10 | 11 | import com.andy.entity.Student; 12 | import com.andy.service.StudentService; 13 | import com.andy.service.StudentServiceImpl; 14 | import com.opensymphony.xwork2.ActionSupport; 15 | 16 | public class StudentUpdateAction extends ActionSupport{ 17 | private StudentService studentService = new StudentServiceImpl(); 18 | private String id; 19 | private String name; 20 | private String sex; 21 | private String clas; 22 | private String location; 23 | private String grade; 24 | public String getId() { 25 | return id; 26 | } 27 | public void setId(String id) { 28 | this.id = id; 29 | } 30 | public String getName() { 31 | return name; 32 | } 33 | public void setName(String name) { 34 | this.name = name; 35 | } 36 | public String getSex() { 37 | return sex; 38 | } 39 | public void setSex(String sex) { 40 | this.sex = sex; 41 | } 42 | public String getClas() { 43 | return clas; 44 | } 45 | public void setClas(String clas) { 46 | this.clas = clas; 47 | } 48 | public String getLocation() { 49 | return location; 50 | } 51 | public void setLocation(String location) { 52 | this.location = location; 53 | } 54 | public String getGrade() { 55 | return grade; 56 | } 57 | public void setGrade(String grade) { 58 | this.grade = grade; 59 | } 60 | public void update() throws IOException{ 61 | HttpServletRequest request = ServletActionContext.getRequest(); 62 | HttpServletResponse response = ServletActionContext.getResponse(); 63 | request.setCharacterEncoding("utf-8"); 64 | response.setCharacterEncoding("utf-8"); 65 | PrintWriter out = response.getWriter(); 66 | id = (String)request.getSession().getAttribute("studentId"); 67 | if(studentService.updateStudent(id, new Student(name,sex,clas,location,grade))){ 68 | out.print("yes"); 69 | }else{ 70 | out.print("no"); 71 | } 72 | } 73 | } 74 | -------------------------------------------------------------------------------- /src/com/andy/action/TeacherAddAction.java: -------------------------------------------------------------------------------- 1 | package com.andy.action; 2 | 3 | import java.io.IOException; 4 | import java.io.PrintWriter; 5 | 6 | import javax.servlet.http.HttpServletRequest; 7 | import javax.servlet.http.HttpServletResponse; 8 | 9 | import org.apache.struts2.ServletActionContext; 10 | 11 | import com.andy.entity.Teacher; 12 | import com.andy.service.TeacherService; 13 | import com.andy.service.TeacherServiceImpl; 14 | import com.opensymphony.xwork2.ActionSupport; 15 | 16 | public class TeacherAddAction extends ActionSupport{ 17 | private TeacherService teacherService = new TeacherServiceImpl(); 18 | private String tid; 19 | private String tname; 20 | private String tsex; 21 | private String tlocation; 22 | private String tpassword; 23 | 24 | public String getTid() { 25 | return tid; 26 | } 27 | 28 | public void setTid(String tid) { 29 | this.tid = tid; 30 | } 31 | 32 | public String getTname() { 33 | return tname; 34 | } 35 | 36 | public void setTname(String tname) { 37 | this.tname = tname; 38 | } 39 | 40 | public String getTsex() { 41 | return tsex; 42 | } 43 | 44 | public void setTsex(String tsex) { 45 | this.tsex = tsex; 46 | } 47 | 48 | public String getTlocation() { 49 | return tlocation; 50 | } 51 | 52 | public void setTlocation(String tlocation) { 53 | this.tlocation = tlocation; 54 | } 55 | 56 | public String getTpassword() { 57 | return tpassword; 58 | } 59 | 60 | public void setTpassword(String tpassword) { 61 | this.tpassword = tpassword; 62 | } 63 | 64 | public void add() throws IOException{ 65 | HttpServletRequest request = ServletActionContext.getRequest(); 66 | HttpServletResponse response = ServletActionContext.getResponse(); 67 | request.setCharacterEncoding("utf-8"); 68 | response.setCharacterEncoding("utf-8"); 69 | PrintWriter out = response.getWriter(); 70 | request.getSession().setAttribute("teacherId", tid); 71 | Teacher t = new Teacher(tid,tname,tsex,tlocation,tpassword); 72 | if(teacherService.addTeacher(t)){ 73 | out.print("yes"); 74 | }else{ 75 | out.print("no"); 76 | } 77 | } 78 | } 79 | -------------------------------------------------------------------------------- /src/com/andy/action/TeacherDeleteAction.java: -------------------------------------------------------------------------------- 1 | package com.andy.action; 2 | 3 | import java.io.IOException; 4 | import java.io.PrintWriter; 5 | 6 | import javax.servlet.http.HttpServletRequest; 7 | import javax.servlet.http.HttpServletResponse; 8 | 9 | import org.apache.struts2.ServletActionContext; 10 | 11 | import com.andy.service.TeacherService; 12 | import com.andy.service.TeacherServiceImpl; 13 | import com.opensymphony.xwork2.ActionSupport; 14 | 15 | public class TeacherDeleteAction extends ActionSupport{ 16 | private TeacherService teacherService = new TeacherServiceImpl(); 17 | private String tcid; 18 | 19 | public String getTcid() { 20 | return tcid; 21 | } 22 | 23 | public void setTcid(String tcid) { 24 | this.tcid = tcid; 25 | } 26 | public void delete() throws IOException{ 27 | HttpServletRequest request = ServletActionContext.getRequest(); 28 | HttpServletResponse response = ServletActionContext.getResponse(); 29 | request.setCharacterEncoding("utf-8"); 30 | response.setCharacterEncoding("utf-8"); 31 | PrintWriter out = response.getWriter(); 32 | if(teacherService.deleteTeacher(tcid)){ 33 | out.print("deleteok"); 34 | }else{ 35 | out.print("deletefail"); 36 | } 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /src/com/andy/action/TeacherGetAllNamesAction.java: -------------------------------------------------------------------------------- 1 | package com.andy.action; 2 | 3 | import java.io.PrintWriter; 4 | import java.util.List; 5 | 6 | import javax.servlet.http.HttpServletResponse; 7 | 8 | import org.apache.struts2.ServletActionContext; 9 | 10 | import com.andy.entity.Teacher; 11 | import com.andy.service.TeacherService; 12 | import com.andy.service.TeacherServiceImpl; 13 | import com.opensymphony.xwork2.ActionSupport; 14 | 15 | public class TeacherGetAllNamesAction extends ActionSupport{ 16 | private TeacherService teacherService = new TeacherServiceImpl(); 17 | public void getAllNames() throws Exception { 18 | HttpServletResponse response = ServletActionContext.getResponse(); 19 | response.setCharacterEncoding("utf-8"); 20 | PrintWriter out = response.getWriter(); 21 | List teachers = teacherService.getAllTeachers(); 22 | StringBuffer sb = new StringBuffer(); 23 | for(Teacher t : teachers){ 24 | sb.append(t.getName()+" "); 25 | } 26 | out.print(sb.toString()); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /src/com/andy/action/TeacherGetInfoByIdAction.java: -------------------------------------------------------------------------------- 1 | package com.andy.action; 2 | 3 | import java.io.IOException; 4 | import java.io.PrintWriter; 5 | 6 | import javax.servlet.http.HttpServletRequest; 7 | import javax.servlet.http.HttpServletResponse; 8 | 9 | import org.apache.struts2.ServletActionContext; 10 | 11 | import com.andy.entity.Teacher; 12 | import com.andy.service.TeacherService; 13 | import com.andy.service.TeacherServiceImpl; 14 | import com.opensymphony.xwork2.ActionSupport; 15 | 16 | public class TeacherGetInfoByIdAction extends ActionSupport{ 17 | private TeacherService teacherService = new TeacherServiceImpl(); 18 | private String tsid; 19 | private Teacher teacher = null; 20 | 21 | public Teacher getTeacher() { 22 | return teacher; 23 | } 24 | 25 | public void setTeacher(Teacher teacher) { 26 | this.teacher = teacher; 27 | } 28 | 29 | public String getTsid() { 30 | return tsid; 31 | } 32 | 33 | public void setTsid(String tsid) { 34 | this.tsid = tsid; 35 | } 36 | 37 | @Override 38 | public String execute() throws Exception { 39 | HttpServletRequest request = ServletActionContext.getRequest(); 40 | request.getSession().setAttribute("teacherId", tsid); 41 | teacher = teacherService.getTeacherById(tsid); 42 | return "showTeacherInfo"; 43 | } 44 | public void juage() throws IOException{ 45 | HttpServletResponse response = ServletActionContext.getResponse(); 46 | PrintWriter out = response.getWriter(); 47 | Teacher t = teacherService.getTeacherById(tsid); 48 | if(t!=null){ 49 | out.print("alreadyExist"); 50 | }else{ 51 | out.print("noExist"); 52 | } 53 | } 54 | // public static void main(String[] args) throws IOException { 55 | // new TeacherGetInfoByIdAction().juage(); 56 | // } 57 | } 58 | -------------------------------------------------------------------------------- /src/com/andy/action/TeacherLoginAction.java: -------------------------------------------------------------------------------- 1 | package com.andy.action; 2 | 3 | import java.io.IOException; 4 | import java.io.PrintWriter; 5 | 6 | import javax.servlet.http.HttpServletRequest; 7 | import javax.servlet.http.HttpSession; 8 | 9 | import org.apache.struts2.ServletActionContext; 10 | 11 | import com.andy.entity.Student; 12 | import com.andy.entity.Teacher; 13 | import com.andy.service.TeacherService; 14 | import com.andy.service.TeacherServiceImpl; 15 | import com.opensymphony.xwork2.ActionSupport; 16 | 17 | public class TeacherLoginAction extends ActionSupport{ 18 | private TeacherService teacherService = new TeacherServiceImpl(); 19 | private String tid; 20 | private String tname; 21 | private String tpassword; 22 | private String tcode; 23 | public String getTid() { 24 | return tid; 25 | } 26 | public void setTid(String tid) { 27 | this.tid = tid; 28 | } 29 | public String getTname() { 30 | return tname; 31 | } 32 | public void setTname(String tname) { 33 | this.tname = tname; 34 | } 35 | public String getTpassword() { 36 | return tpassword; 37 | } 38 | public void setTpassword(String tpassword) { 39 | this.tpassword = tpassword; 40 | } 41 | public String getTcode() { 42 | return tcode; 43 | } 44 | public void setTcode(String tcode) { 45 | this.tcode = tcode; 46 | } 47 | public void login() throws IOException{ 48 | HttpServletRequest request = ServletActionContext.getRequest(); 49 | HttpSession session = request.getSession(); 50 | PrintWriter out = ServletActionContext.getResponse().getWriter(); 51 | String code_session = (String) session.getAttribute("code_session"); 52 | if(tcode.equalsIgnoreCase(code_session)){ 53 | if(teacherService.login(new Teacher(tid,tname,null,null,tpassword))){ 54 | session.setAttribute("name", tname); 55 | session.setAttribute("id", tid); 56 | out.print("yes"); 57 | }else{ 58 | out.print("no"); 59 | } 60 | }else{ 61 | out.print("codeError"); 62 | } 63 | } 64 | } 65 | -------------------------------------------------------------------------------- /src/com/andy/action/TeacherLogoutAction.java: -------------------------------------------------------------------------------- 1 | package com.andy.action; 2 | 3 | import javax.servlet.http.HttpServletRequest; 4 | 5 | import org.apache.struts2.ServletActionContext; 6 | 7 | import com.opensymphony.xwork2.ActionSupport; 8 | 9 | public class TeacherLogoutAction extends ActionSupport{ 10 | @Override 11 | public String execute() throws Exception { 12 | HttpServletRequest request = ServletActionContext.getRequest(); 13 | request.getSession().invalidate(); 14 | return "login"; 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /src/com/andy/action/TeacherModifyPasswordAction.java: -------------------------------------------------------------------------------- 1 | package com.andy.action; 2 | 3 | import java.io.IOException; 4 | import java.io.PrintWriter; 5 | 6 | import javax.servlet.http.HttpServletRequest; 7 | import javax.servlet.http.HttpServletResponse; 8 | 9 | import org.apache.struts2.ServletActionContext; 10 | import com.andy.entity.Student; 11 | import com.andy.service.StudentService; 12 | import com.andy.service.StudentServiceImpl; 13 | import com.andy.service.TeacherService; 14 | import com.andy.service.TeacherServiceImpl; 15 | import com.opensymphony.xwork2.ActionSupport; 16 | 17 | public class TeacherModifyPasswordAction extends ActionSupport{ 18 | private TeacherService teacherService = new TeacherServiceImpl(); 19 | private String id; 20 | private String name; 21 | private String password1; 22 | private String password2; 23 | public String getId() { 24 | return id; 25 | } 26 | public void setId(String id) { 27 | this.id = id; 28 | } 29 | public String getName() { 30 | return name; 31 | } 32 | public void setName(String name) { 33 | this.name = name; 34 | } 35 | public String getPassword1() { 36 | return password1; 37 | } 38 | public void setPassword1(String password1) { 39 | this.password1 = password1; 40 | } 41 | public String getPassword2() { 42 | return password2; 43 | } 44 | public void setPassword2(String password2) { 45 | this.password2 = password2; 46 | } 47 | public void modify() throws IOException{ 48 | HttpServletRequest request = ServletActionContext.getRequest(); 49 | HttpServletResponse response = ServletActionContext.getResponse(); 50 | PrintWriter out = response.getWriter(); 51 | if(teacherService.modifyPassword(id,password1, password2)){ 52 | out.print("yes"); 53 | }else{ 54 | out.print("no"); 55 | } 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /src/com/andy/action/TeacherShowInfoAction.java: -------------------------------------------------------------------------------- 1 | package com.andy.action; 2 | 3 | import javax.servlet.http.HttpServletRequest; 4 | 5 | import org.apache.struts2.ServletActionContext; 6 | 7 | import com.andy.entity.Student; 8 | import com.andy.entity.Teacher; 9 | import com.andy.service.StudentService; 10 | import com.andy.service.StudentServiceImpl; 11 | import com.andy.service.TeacherService; 12 | import com.andy.service.TeacherServiceImpl; 13 | import com.opensymphony.xwork2.ActionSupport; 14 | 15 | public class TeacherShowInfoAction extends ActionSupport{ 16 | private Teacher teacher ; 17 | 18 | public Teacher getTeacher() { 19 | return teacher; 20 | } 21 | public void setStudent(Teacher teacher) { 22 | this.teacher = teacher; 23 | } 24 | private TeacherService teacherService = new TeacherServiceImpl(); 25 | @Override 26 | public String execute() throws Exception { 27 | HttpServletRequest request = ServletActionContext.getRequest(); 28 | String id =(String) request.getSession().getAttribute("id"); 29 | teacher = teacherService.getTeacherById(id); 30 | return "teacherInfo"; 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /src/com/andy/action/TeacherUpdateAction.java: -------------------------------------------------------------------------------- 1 | package com.andy.action; 2 | 3 | import java.io.IOException; 4 | import java.io.PrintWriter; 5 | 6 | import javax.servlet.http.HttpServletRequest; 7 | import javax.servlet.http.HttpServletResponse; 8 | 9 | import org.apache.struts2.ServletActionContext; 10 | 11 | import com.andy.entity.Student; 12 | import com.andy.entity.Teacher; 13 | import com.andy.service.StudentService; 14 | import com.andy.service.StudentServiceImpl; 15 | import com.andy.service.TeacherService; 16 | import com.andy.service.TeacherServiceImpl; 17 | import com.opensymphony.xwork2.ActionSupport; 18 | 19 | public class TeacherUpdateAction extends ActionSupport{ 20 | private TeacherService teacherService = new TeacherServiceImpl(); 21 | private String id; 22 | private String name; 23 | private String sex; 24 | private String location; 25 | public String getId() { 26 | return id; 27 | } 28 | public void setId(String id) { 29 | this.id = id; 30 | } 31 | public String getName() { 32 | return name; 33 | } 34 | public void setName(String name) { 35 | this.name = name; 36 | } 37 | public String getSex() { 38 | return sex; 39 | } 40 | public void setSex(String sex) { 41 | this.sex = sex; 42 | } 43 | public String getLocation() { 44 | return location; 45 | } 46 | public void setLocation(String location) { 47 | this.location = location; 48 | } 49 | public void update() throws IOException{ 50 | HttpServletRequest request = ServletActionContext.getRequest(); 51 | HttpServletResponse response = ServletActionContext.getResponse(); 52 | request.setCharacterEncoding("utf-8"); 53 | response.setCharacterEncoding("utf-8"); 54 | PrintWriter out = response.getWriter(); 55 | id = (String)request.getSession().getAttribute("teacherId"); 56 | if(teacherService.updateTeacher(id, new Teacher(null,name,sex,location,null))){ 57 | out.print("yes"); 58 | }else{ 59 | out.print("no"); 60 | } 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /src/com/andy/action/UpdateQuestionAction.java: -------------------------------------------------------------------------------- 1 | package com.andy.action; 2 | 3 | import java.io.IOException; 4 | import java.io.PrintWriter; 5 | 6 | import javax.servlet.http.HttpServletResponse; 7 | 8 | import org.apache.struts2.ServletActionContext; 9 | 10 | import com.andy.dao.QuestionDao; 11 | import com.andy.dao.QuestionDaoImpl; 12 | import com.andy.entity.Question; 13 | import com.opensymphony.xwork2.ActionSupport; 14 | 15 | public class UpdateQuestionAction extends ActionSupport{ 16 | private QuestionDao questionDao = new QuestionDaoImpl(); 17 | private String id2; 18 | private String ques2; 19 | private String choose12; 20 | private String choose22; 21 | private String choose32; 22 | private String choose42; 23 | private String anwser2; 24 | public QuestionDao getQuestionDao() { 25 | return questionDao; 26 | } 27 | public void setQuestionDao(QuestionDao questionDao) { 28 | this.questionDao = questionDao; 29 | } 30 | public String getId2() { 31 | return id2; 32 | } 33 | public void setId2(String id2) { 34 | this.id2 = id2; 35 | } 36 | public String getQues2() { 37 | return ques2; 38 | } 39 | public void setQues2(String ques2) { 40 | this.ques2 = ques2; 41 | } 42 | public String getChoose12() { 43 | return choose12; 44 | } 45 | public void setChoose12(String choose12) { 46 | this.choose12 = choose12; 47 | } 48 | public String getChoose22() { 49 | return choose22; 50 | } 51 | public void setChoose22(String choose22) { 52 | this.choose22 = choose22; 53 | } 54 | public String getChoose32() { 55 | return choose32; 56 | } 57 | public void setChoose32(String choose32) { 58 | this.choose32 = choose32; 59 | } 60 | public String getChoose42() { 61 | return choose42; 62 | } 63 | public void setChoose42(String choose42) { 64 | this.choose42 = choose42; 65 | } 66 | public String getAnwser2() { 67 | return anwser2; 68 | } 69 | public void setAnwser2(String anwser2) { 70 | this.anwser2 = anwser2; 71 | } 72 | public void update() throws IOException{ 73 | Question question2 = new Question(id2,ques2,choose12,choose22,choose32,choose42,anwser2); 74 | HttpServletResponse response = ServletActionContext.getResponse(); 75 | PrintWriter out = response.getWriter(); 76 | //System.out.println(id2+ques2+choose12+choose22+choose32+choose42+anwser2); 77 | if(questionDao.updateQuestion(question2)){ 78 | out.print("yes"); 79 | }else{ 80 | out.print("no"); 81 | } 82 | 83 | } 84 | } 85 | -------------------------------------------------------------------------------- /src/com/andy/dao/CourseDao.java: -------------------------------------------------------------------------------- 1 | package com.andy.dao; 2 | 3 | import java.util.List; 4 | import java.util.Set; 5 | 6 | import com.andy.entity.Course; 7 | import com.andy.entity.Score; 8 | import com.andy.entity.Teacher; 9 | 10 | public interface CourseDao { 11 | public List getAllNames(); 12 | public Set getAllTeachers(String courseName); 13 | public Course getCourseByName(String courseName); 14 | public boolean addCourse(Course course); 15 | public boolean setTeacher(Course course,Teacher teacher); 16 | } 17 | -------------------------------------------------------------------------------- /src/com/andy/dao/CourseDaoImpl.java: -------------------------------------------------------------------------------- 1 | package com.andy.dao; 2 | 3 | import java.util.ArrayList; 4 | import java.util.List; 5 | import java.util.Set; 6 | 7 | import org.hibernate.Query; 8 | import org.hibernate.Session; 9 | import org.hibernate.Transaction; 10 | 11 | import com.andy.entity.Course; 12 | import com.andy.entity.Score; 13 | import com.andy.entity.Teacher; 14 | import com.andy.util.HibernateSessionUtil; 15 | 16 | public class CourseDaoImpl implements CourseDao{ 17 | Session session = HibernateSessionUtil.getCurrentSession(); 18 | @Override 19 | public List getAllNames() { 20 | List names = new ArrayList(); 21 | Query query = session.createQuery("from Course"); 22 | List courses = query.list(); 23 | for(Course c : courses){ 24 | names.add(c.getName()); 25 | } 26 | return names; 27 | } 28 | @Override 29 | public Set getAllTeachers(String courseName) { 30 | Query query = session.createQuery("from Course where name=?"); 31 | query.setString(0, courseName); 32 | Course course = (Course)query.list().get(0); 33 | Set teachers = course.getTeachers(); 34 | return teachers; 35 | } 36 | // public static void main(String[] args) { 37 | // new CourseDaoImpl().getAllTeachers("C语言"); 38 | // } 39 | @Override 40 | public Course getCourseByName(String courseName) { 41 | Query query = session.createQuery("from Course where name=?"); 42 | query.setString(0, courseName); 43 | Course course = (Course)query.list().get(0); 44 | return course; 45 | } 46 | @Override 47 | public boolean addCourse(Course course) { 48 | Transaction transaction = session.beginTransaction(); 49 | Course c = (Course)session.get(Course.class, course.getId()); 50 | if(c!=null){ 51 | return false; 52 | } 53 | session.save(course); 54 | transaction.commit(); 55 | return true; 56 | } 57 | 58 | public static void main(String[] args) { 59 | new CourseDaoImpl().addCourse(null); 60 | } 61 | @Override 62 | public boolean setTeacher(Course course, Teacher teacher) { 63 | Transaction transaction = session.beginTransaction(); 64 | Set teachers = course.getTeachers(); 65 | teachers.add(teacher); 66 | course.setTeachers(teachers); 67 | session.saveOrUpdate(course); 68 | transaction.commit(); 69 | return true; 70 | } 71 | } 72 | -------------------------------------------------------------------------------- /src/com/andy/dao/ManagerDao.java: -------------------------------------------------------------------------------- 1 | package com.andy.dao; 2 | 3 | import com.andy.entity.Manager; 4 | 5 | public interface ManagerDao { 6 | public Manager getManagerById(String id); 7 | public boolean modifyPassword(String id,String newPassword); 8 | } 9 | -------------------------------------------------------------------------------- /src/com/andy/dao/ManagerDaoImpl.java: -------------------------------------------------------------------------------- 1 | package com.andy.dao; 2 | 3 | import java.util.List; 4 | 5 | import org.hibernate.Query; 6 | import org.hibernate.Session; 7 | import org.hibernate.Transaction; 8 | 9 | import com.andy.entity.Manager; 10 | import com.andy.entity.Student; 11 | import com.andy.util.HibernateSessionUtil; 12 | 13 | public class ManagerDaoImpl implements ManagerDao{ 14 | private Session session = HibernateSessionUtil.getCurrentSession(); 15 | @Override 16 | public Manager getManagerById(String id) { 17 | // Query query = session.createQuery("from Manager where id = '"+id+"'"); 18 | // List students = query.list(); 19 | // System.out.println(students.size()); 20 | // return students.get(0); 21 | Manager manager = (Manager) session.load(Manager.class, id); 22 | return manager; 23 | } 24 | @Override 25 | public boolean modifyPassword(String id, String newPassword) { 26 | Manager manager = (Manager)session.load(Manager.class, id); 27 | Transaction transaction = session.beginTransaction(); 28 | manager.setPassword(newPassword); 29 | transaction.commit(); 30 | return true; 31 | } 32 | // public static void main(String[] args) { 33 | // new ManagerDaoImpl().getManagerById("2012"); 34 | // } 35 | } 36 | -------------------------------------------------------------------------------- /src/com/andy/dao/QuestionDao.java: -------------------------------------------------------------------------------- 1 | package com.andy.dao; 2 | 3 | import java.util.List; 4 | import java.util.Set; 5 | 6 | import com.andy.entity.Question; 7 | 8 | public interface QuestionDao { 9 | public List getAllQuestions(); 10 | public List getQuestionsByCourseId(String courseId); 11 | public String getAllAnwser(); 12 | public String getAnwserByQuestionId(String questionId); 13 | public boolean addQuestion(Question question); 14 | public boolean updateQuestion(Question question); 15 | public boolean deleteQuestion(int id); 16 | } 17 | -------------------------------------------------------------------------------- /src/com/andy/dao/QuestionDaoImpl.java: -------------------------------------------------------------------------------- 1 | package com.andy.dao; 2 | 3 | import java.util.List; 4 | import java.util.Set; 5 | 6 | 7 | import org.hibernate.Query; 8 | import org.hibernate.Session; 9 | import org.hibernate.Transaction; 10 | 11 | import com.andy.entity.Question; 12 | import com.andy.util.HibernateSessionUtil; 13 | 14 | public class QuestionDaoImpl implements QuestionDao{ 15 | private Session session = HibernateSessionUtil.getCurrentSession(); 16 | @Override 17 | public List getAllQuestions() { 18 | Query query = session.createQuery("from Question order by Id"); 19 | List questions = query.list(); 20 | return questions; 21 | } 22 | @Override 23 | public String getAllAnwser() { 24 | String anwser = ""; 25 | Query query = session.createQuery("from Question order by Id"); 26 | List anwsers = query.list(); 27 | for(Question q : anwsers){ 28 | anwser+=q.getAnwser()+" "; 29 | } 30 | return anwser; 31 | } 32 | @Override 33 | public boolean addQuestion(Question question) { 34 | Transaction transaction = session.beginTransaction(); 35 | try { 36 | Query query = session.createQuery("from Question where id = '"+question.getId()+"'"); 37 | if(query.list().size()>0){ 38 | return false; 39 | } 40 | session.save(question); 41 | transaction.commit(); 42 | return true; 43 | } catch (Exception e) { 44 | //e.printStackTrace(); 45 | transaction.rollback(); 46 | return false; 47 | } 48 | } 49 | @Override 50 | public boolean updateQuestion(Question question) { 51 | Transaction transaction = session.beginTransaction(); 52 | try { 53 | Query query = session.createQuery("from Question where id = '"+question.getId()+"'"); 54 | if(query.list().size()>0){ 55 | session.merge(question); 56 | transaction.commit(); 57 | return true; 58 | } 59 | } catch (Exception e) { 60 | e.printStackTrace(); 61 | transaction.rollback(); 62 | } 63 | return false; 64 | } 65 | @Override 66 | public boolean deleteQuestion(int id) { 67 | Transaction transaction = session.beginTransaction(); 68 | try { 69 | Query query = session.createQuery("from Question where id = '"+id+"'"); 70 | if(query.list().size()>0){ 71 | Question question = (Question) session.load(Question.class, id); 72 | session.delete(question); 73 | transaction.commit(); 74 | return true; 75 | } 76 | } catch (Exception e) { 77 | e.printStackTrace(); 78 | transaction.rollback(); 79 | } 80 | return false; 81 | } 82 | @Override 83 | public List getQuestionsByCourseId(String courseId) { 84 | Query query = session.createQuery("from Question where courseId=?"); 85 | query.setString(0, courseId); 86 | List questions = query.list(); 87 | return questions; 88 | } 89 | @Override 90 | public String getAnwserByQuestionId(String questionId) { 91 | Question q = (Question) session.get(Question.class, questionId); 92 | return q.getAnwser(); 93 | } 94 | public static void main(String[] args) { 95 | new QuestionDaoImpl().getQuestionsByCourseId("c003"); 96 | } 97 | } 98 | -------------------------------------------------------------------------------- /src/com/andy/dao/ScoreDao.java: -------------------------------------------------------------------------------- 1 | package com.andy.dao; 2 | 3 | import java.util.List; 4 | 5 | import com.andy.entity.Score; 6 | 7 | public interface ScoreDao { 8 | public boolean saveScore(Score score); 9 | public boolean isAnswered(Score score); 10 | public List getPassedScore(String studentId); 11 | public List getUnPassedScore(String studentId); 12 | public List getAllScore(String courseName,String teacherName,String studentName); 13 | public List getPassedScore(String courseName,String teacherName,String studentName); 14 | public List getUnpassedScore(String courseName,String teacherName,String studentName); 15 | } 16 | -------------------------------------------------------------------------------- /src/com/andy/dao/ScoreDaoImpl.java: -------------------------------------------------------------------------------- 1 | package com.andy.dao; 2 | 3 | import java.util.ArrayList; 4 | import java.util.List; 5 | 6 | import org.hibernate.Query; 7 | import org.hibernate.Session; 8 | import org.hibernate.Transaction; 9 | 10 | import com.andy.entity.Course; 11 | import com.andy.entity.Score; 12 | import com.andy.util.HibernateSessionUtil; 13 | 14 | public class ScoreDaoImpl implements ScoreDao{ 15 | Session session = HibernateSessionUtil.getCurrentSession(); 16 | @Override 17 | public boolean saveScore(Score score) { 18 | Transaction t = session.beginTransaction(); 19 | if(isAnswered(score)){ 20 | return false; 21 | } 22 | session.save(score); 23 | t.commit(); 24 | return true; 25 | } 26 | @Override 27 | public boolean isAnswered(Score score) { 28 | Query query = session.createQuery("from Score where courseId=?"); 29 | query.setString(0, score.getCourseId()); 30 | if(query.list().size()>0){ 31 | return true; 32 | } 33 | return false; 34 | } 35 | public static void main(String[] args) { 36 | //new ScoreDaoImpl().isAnswered(new Score("201207031","于明启","001","吴老师","c001","JAVA",100,"及格")); 37 | //new ScoreDaoImpl().saveScore(new Score("201207031","于明启","001","吴老师","c002","JAVA",100,"及格")); 38 | } 39 | @Override 40 | public List getPassedScore(String studentId) { 41 | List passedScore = new ArrayList(); 42 | Query query = session.createQuery("from Score where studentId=? and score>=60"); 43 | query.setString(0, studentId); 44 | passedScore = query.list(); 45 | return passedScore; 46 | } 47 | @Override 48 | public List getUnPassedScore(String studentId) { 49 | List unpassedScore = new ArrayList(); 50 | Query query = session.createQuery("from Score where studentId=? and score<60"); 51 | query.setString(0, studentId); 52 | unpassedScore = query.list(); 53 | return unpassedScore; 54 | } 55 | @Override 56 | public List getAllScore(String courseName, String teacherName,String studentName) { 57 | List allScore = new ArrayList(); 58 | Query query = null; 59 | if(studentName.equals("- - - - -")){ 60 | query = session.createQuery("from Score where courseName=? and teacherName=? order by score desc"); 61 | query.setString(0, courseName); 62 | query.setString(1, teacherName); 63 | }else{ 64 | query = session.createQuery("from Score where courseName=? and teacherName=? and studentName=? order by score desc"); 65 | query.setString(0, courseName); 66 | query.setString(1, teacherName); 67 | query.setString(2, studentName); 68 | } 69 | allScore = query.list(); 70 | return allScore; 71 | } 72 | @Override 73 | public List getUnpassedScore(String courseName, String teacherName,String studentName) { 74 | List unpassedScore = new ArrayList(); 75 | Query query = null; 76 | if(studentName.equals("- - - - -")){ 77 | query = session.createQuery("from Score where courseName=? and teacherName=? and score<60"); 78 | query.setString(0, courseName); 79 | query.setString(1, teacherName); 80 | }else{ 81 | query = session.createQuery("from Score where courseName=? and teacherName=? and studentName=? and score<60"); 82 | query.setString(0, courseName); 83 | query.setString(1, teacherName); 84 | query.setString(2, studentName); 85 | } 86 | unpassedScore = query.list(); 87 | return unpassedScore; 88 | } 89 | @Override 90 | public List getPassedScore(String courseName, String teacherName,String studentName) { 91 | List passedScore = new ArrayList(); 92 | Query query = null; 93 | if(studentName.equals("- - - - -")){ 94 | query = session.createQuery("from Score where courseName=? and teacherName=? and score>=60"); 95 | query.setString(0, courseName); 96 | query.setString(1, teacherName); 97 | }else{ 98 | query = session.createQuery("from Score where courseName=? and teacherName=? and studentName=? and score>=60"); 99 | query.setString(0, courseName); 100 | query.setString(1, teacherName); 101 | query.setString(2, studentName); 102 | } 103 | passedScore = query.list(); 104 | return passedScore; 105 | } 106 | } 107 | -------------------------------------------------------------------------------- /src/com/andy/dao/StudentDao.java: -------------------------------------------------------------------------------- 1 | package com.andy.dao; 2 | 3 | import java.util.List; 4 | 5 | import com.andy.entity.Student; 6 | 7 | public interface StudentDao { 8 | public Student getStudentById(String id); 9 | public boolean modifyPassword(String id,String newPassword); 10 | public boolean addStudent(Student student); 11 | public boolean deleteStudent(String studentId); 12 | public boolean updateStudent(String id,Student student); 13 | public List getAllNames(); 14 | } 15 | -------------------------------------------------------------------------------- /src/com/andy/dao/StudentDaoImpl.java: -------------------------------------------------------------------------------- 1 | package com.andy.dao; 2 | 3 | import java.util.ArrayList; 4 | import java.util.List; 5 | 6 | import org.apache.log4j.chainsaw.Main; 7 | import org.hibernate.Query; 8 | import org.hibernate.Session; 9 | import org.hibernate.Transaction; 10 | 11 | import com.andy.entity.Course; 12 | import com.andy.entity.Student; 13 | import com.andy.util.HibernateSessionUtil; 14 | 15 | public class StudentDaoImpl implements StudentDao{ 16 | private Session session = HibernateSessionUtil.getCurrentSession(); 17 | @Override 18 | public Student getStudentById(String id) { 19 | //Query query = session.createQuery("from Student where id = '"+id+"'"); 20 | //List students = query.list(); 21 | //return students.get(0); 22 | Student student = (Student) session.get(Student.class, id); 23 | return student; 24 | } 25 | @Override 26 | public boolean modifyPassword(String id, String newPassword) { 27 | Student student = (Student)session.load(Student.class, id); 28 | Transaction transaction = session.beginTransaction(); 29 | student.setPassword(newPassword); 30 | transaction.commit(); 31 | return true; 32 | } 33 | @Override 34 | public boolean addStudent(Student student) { 35 | Transaction transaction = session.beginTransaction(); 36 | Student s =(Student) session.get(Student.class, student.getId()); 37 | if(s != null){ 38 | return false; 39 | } 40 | session.save(student); 41 | transaction.commit(); 42 | return true; 43 | } 44 | @Override 45 | public boolean deleteStudent(String studentId) { 46 | Transaction transaction = session.beginTransaction(); 47 | Student student =(Student) session.get(Student.class, studentId); 48 | if(student==null){ 49 | return false; 50 | } 51 | session.delete(student); 52 | transaction.commit(); 53 | return true; 54 | } 55 | // public static void main(String[] args) { 56 | // new StudentDaoImpl().getStudentById("201207031"); 57 | // } 58 | @Override 59 | public boolean updateStudent(String id, Student student) { 60 | Transaction transaction = session.beginTransaction(); 61 | Student s = (Student)session.get(Student.class, id); 62 | s.setName(student.getName()); 63 | s.setSex(student.getSex()); 64 | s.setClas(student.getClas()); 65 | s.setLocation(student.getLocation()); 66 | s.setGrade(student.getGrade()); 67 | session.saveOrUpdate(s); 68 | transaction.commit(); 69 | return true; 70 | } 71 | @Override 72 | public List getAllNames() { 73 | List names = new ArrayList(); 74 | Query query = session.createQuery("from Student"); 75 | List students = query.list(); 76 | for(Student s : students){ 77 | names.add(s.getName()); 78 | } 79 | return names; 80 | } 81 | } 82 | -------------------------------------------------------------------------------- /src/com/andy/dao/TeacherDao.java: -------------------------------------------------------------------------------- 1 | package com.andy.dao; 2 | 3 | import java.util.List; 4 | 5 | import com.andy.entity.Teacher; 6 | 7 | public interface TeacherDao { 8 | public Teacher getTeacherById(String id); 9 | public boolean modifyPassword(String id,String newPassword); 10 | public Teacher getTeacherByName(String teacherName); 11 | public boolean addTeacher(Teacher teacher); 12 | public boolean deleteTeacher(String teacherId); 13 | public boolean updateTeacher(String id,Teacher teacher); 14 | public List getAllTeachers(); 15 | } 16 | -------------------------------------------------------------------------------- /src/com/andy/dao/TeacherDaoImpl.java: -------------------------------------------------------------------------------- 1 | package com.andy.dao; 2 | 3 | import java.util.List; 4 | 5 | import org.hibernate.Query; 6 | import org.hibernate.Session; 7 | import org.hibernate.Transaction; 8 | 9 | import com.andy.entity.Student; 10 | import com.andy.entity.Teacher; 11 | import com.andy.util.HibernateSessionUtil; 12 | 13 | public class TeacherDaoImpl implements TeacherDao{ 14 | private Session session = HibernateSessionUtil.getCurrentSession(); 15 | @Override 16 | public Teacher getTeacherById(String id) { 17 | //Query query = session.createQuery("from Student where id = '"+id+"'"); 18 | //List students = query.list(); 19 | //return students.get(0); 20 | Teacher teacher = (Teacher) session.get(Teacher.class, id); 21 | return teacher; 22 | } 23 | @Override 24 | public boolean modifyPassword(String id, String newPassword) { 25 | Teacher teacher = (Teacher)session.get(Teacher.class, id); 26 | Transaction transaction = session.beginTransaction(); 27 | teacher.setPassword(newPassword); 28 | transaction.commit(); 29 | return true; 30 | } 31 | @Override 32 | public Teacher getTeacherByName(String teacherName) { 33 | Query query = session.createQuery("from Teacher where name=?"); 34 | query.setString(0, teacherName); 35 | Teacher t = (Teacher) query.list().get(0); 36 | return t; 37 | } 38 | @Override 39 | public boolean addTeacher(Teacher teacher) { 40 | Transaction transaction = session.beginTransaction(); 41 | Teacher t =(Teacher) session.get(Teacher.class, teacher.getId()); 42 | if(t != null){ 43 | return false; 44 | } 45 | session.save(teacher); 46 | transaction.commit(); 47 | return true; 48 | } 49 | @Override 50 | public boolean deleteTeacher(String teacherId) { 51 | Transaction transaction = session.beginTransaction(); 52 | Teacher t = (Teacher)session.get(Teacher.class, teacherId); 53 | if(t == null){ 54 | return false; 55 | } 56 | session.delete(t); 57 | transaction.commit(); 58 | return true; 59 | } 60 | @Override 61 | public boolean updateTeacher(String id, Teacher teacher) { 62 | Transaction transaction = session.beginTransaction(); 63 | Teacher t = (Teacher)session.get(Teacher.class, id); 64 | t.setName(teacher.getName()); 65 | t.setSex(teacher.getSex()); 66 | t.setLocation(teacher.getLocation()); 67 | session.saveOrUpdate(t); 68 | transaction.commit(); 69 | return true; 70 | } 71 | // public static void main(String[] args) { 72 | // new TeacherDaoImpl().updateTeacher("001", new Teacher("吴老师","男","青岛")); 73 | // } 74 | @Override 75 | public List getAllTeachers() { 76 | Query query = session.createQuery("from Teacher"); 77 | List teachers = query.list(); 78 | return teachers; 79 | } 80 | } 81 | -------------------------------------------------------------------------------- /src/com/andy/entity/Course.hbm.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /src/com/andy/entity/Course.java: -------------------------------------------------------------------------------- 1 | package com.andy.entity; 2 | 3 | import java.util.Set; 4 | 5 | public class Course { 6 | private String id; 7 | private String name; 8 | private Set teachers; 9 | private Set students; 10 | //private Set scores; 11 | public Course(){} 12 | public String getId() { 13 | return id; 14 | } 15 | public Course(String id, String name) { 16 | super(); 17 | this.id = id; 18 | this.name = name; 19 | } 20 | public void setId(String id) { 21 | this.id = id; 22 | } 23 | public String getName() { 24 | return name; 25 | } 26 | public void setName(String name) { 27 | this.name = name; 28 | } 29 | public Set getTeachers() { 30 | return teachers; 31 | } 32 | public void setTeachers(Set teachers) { 33 | this.teachers = teachers; 34 | } 35 | public Set getStudents() { 36 | return students; 37 | } 38 | public void setStudents(Set students) { 39 | this.students = students; 40 | } 41 | // public Set getScores() { 42 | // return scores; 43 | // } 44 | // public void setScores(Set scores) { 45 | // this.scores = scores; 46 | // } 47 | 48 | } 49 | -------------------------------------------------------------------------------- /src/com/andy/entity/Manager.hbm.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /src/com/andy/entity/Manager.java: -------------------------------------------------------------------------------- 1 | package com.andy.entity; 2 | 3 | public class Manager { 4 | private String id; 5 | private String name; 6 | private String password; 7 | public Manager(){} 8 | public Manager(String id, String name, String password) { 9 | this.id = id; 10 | this.name = name; 11 | this.password = password; 12 | } 13 | public String getId() { 14 | return id; 15 | } 16 | public void setId(String id) { 17 | this.id = id; 18 | } 19 | public String getName() { 20 | return name; 21 | } 22 | public void setName(String name) { 23 | this.name = name; 24 | } 25 | public String getPassword() { 26 | return password; 27 | } 28 | public void setPassword(String password) { 29 | this.password = password; 30 | } 31 | @Override 32 | public boolean equals(Object obj) { 33 | Manager manager = (Manager)obj; 34 | return this.id.equals(manager.getId()) && this.name.equals(manager.getName()) && this.password.equals(manager.getPassword()); 35 | } 36 | @Override 37 | public int hashCode() { 38 | return this.id.hashCode()+this.name.hashCode()+this.password.hashCode(); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /src/com/andy/entity/Question.hbm.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | -------------------------------------------------------------------------------- /src/com/andy/entity/Question.java: -------------------------------------------------------------------------------- 1 | package com.andy.entity; 2 | 3 | public class Question { 4 | private String id; 5 | private String ques; 6 | private String choose1 ; 7 | private String choose2 ; 8 | private String choose3 ; 9 | private String choose4; 10 | private String anwser; 11 | private Course course; 12 | public Question(){} 13 | public Question(String id,String question,String choose1,String choose2,String choose3,String choose4,String anwser){ 14 | this.id = id; 15 | this.ques = question; 16 | this.choose1 = choose1; 17 | this.choose2 = choose2; 18 | this.choose3 = choose3; 19 | this.choose4 = choose4; 20 | this.anwser = anwser; 21 | } 22 | public String getQuestion() { 23 | return ques; 24 | } 25 | public void setQuestion(String question) { 26 | this.ques = question; 27 | } 28 | public String getChoose1() { 29 | return choose1; 30 | } 31 | public void setChoose1(String choose1) { 32 | this.choose1 = choose1; 33 | } 34 | public String getChoose2() { 35 | return choose2; 36 | } 37 | public void setChoose2(String choose2) { 38 | this.choose2 = choose2; 39 | } 40 | public String getChoose3() { 41 | return choose3; 42 | } 43 | public void setChoose3(String choose3) { 44 | this.choose3 = choose3; 45 | } 46 | public String getChoose4() { 47 | return choose4; 48 | } 49 | public void setChoose4(String choose4) { 50 | this.choose4 = choose4; 51 | } 52 | public String getId() { 53 | return id; 54 | } 55 | public void setId(String id) { 56 | this.id = id; 57 | } 58 | public String getQues() { 59 | return ques; 60 | } 61 | public void setQues(String ques) { 62 | this.ques = ques; 63 | } 64 | public String getAnwser() { 65 | return anwser; 66 | } 67 | public void setAnwser(String anwser) { 68 | this.anwser = anwser; 69 | } 70 | public Course getCourse() { 71 | return course; 72 | } 73 | public void setCourse(Course course) { 74 | this.course = course; 75 | } 76 | @Override 77 | public boolean equals(Object obj) { 78 | Question question = (Question)obj; 79 | return this.ques.equals(question.getQues()); 80 | } 81 | @Override 82 | public int hashCode() { 83 | return this.ques.hashCode(); 84 | } 85 | } 86 | -------------------------------------------------------------------------------- /src/com/andy/entity/Score.hbm.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 7 | 8 | 9 | 10 | 11 | 12 | seq_score 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | -------------------------------------------------------------------------------- /src/com/andy/entity/Score.java: -------------------------------------------------------------------------------- 1 | package com.andy.entity; 2 | 3 | public class Score { 4 | private int id; 5 | private String studentId; 6 | private String studentName; 7 | private String teacherId; 8 | private String teacherName; 9 | private String courseId; 10 | private String courseName; 11 | private double score; 12 | private String state; 13 | public Score(){} 14 | public Score(double score, String state) { 15 | this.score = score; 16 | this.state = state; 17 | } 18 | 19 | public Score(String studentId,String studentName, String teacherId, String teacherName,String courseId, 20 | String courseName,double score, String state) { 21 | super(); 22 | this.studentId = studentId; 23 | this.studentName = studentName; 24 | this.teacherId = teacherId; 25 | this.teacherName = teacherName; 26 | this.courseId = courseId; 27 | this.courseName = courseName; 28 | this.score = score; 29 | this.state = state; 30 | } 31 | 32 | public int getId() { 33 | return id; 34 | } 35 | public void setId(int id) { 36 | this.id = id; 37 | } 38 | public double getScore() { 39 | return score; 40 | } 41 | public void setScore(double score) { 42 | this.score = score; 43 | } 44 | public String getState() { 45 | return state; 46 | } 47 | public void setState(String state) { 48 | this.state = state; 49 | } 50 | 51 | public String getStudentId() { 52 | return studentId; 53 | } 54 | 55 | public void setStudentId(String studentId) { 56 | this.studentId = studentId; 57 | } 58 | 59 | public String getTeacherId() { 60 | return teacherId; 61 | } 62 | 63 | public void setTeacherId(String teacherId) { 64 | this.teacherId = teacherId; 65 | } 66 | 67 | public String getCourseId() { 68 | return courseId; 69 | } 70 | 71 | public void setCourseId(String courseId) { 72 | this.courseId = courseId; 73 | } 74 | public String getStudentName() { 75 | return studentName; 76 | } 77 | public void setStudentName(String studentName) { 78 | this.studentName = studentName; 79 | } 80 | public String getTeacherName() { 81 | return teacherName; 82 | } 83 | public void setTeacherName(String teacherName) { 84 | this.teacherName = teacherName; 85 | } 86 | public String getCourseName() { 87 | return courseName; 88 | } 89 | public void setCourseName(String courseName) { 90 | this.courseName = courseName; 91 | } 92 | 93 | } 94 | -------------------------------------------------------------------------------- /src/com/andy/entity/Student.hbm.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /src/com/andy/entity/Student.java: -------------------------------------------------------------------------------- 1 | package com.andy.entity; 2 | 3 | public class Student { 4 | private String id; 5 | private String name; 6 | private String sex; 7 | private String clas; 8 | private String location; 9 | private String grade; 10 | private String password; 11 | public Student(){} 12 | public Student(String id,String name,String password){ 13 | this.id = id; 14 | this.name = name; 15 | this.password = password; 16 | } 17 | 18 | public Student(String name, String sex, String clas, String location, 19 | String grade) { 20 | this.name = name; 21 | this.sex = sex; 22 | this.clas = clas; 23 | this.location = location; 24 | this.grade = grade; 25 | } 26 | public Student(String id, String name, String sex, String clas, 27 | String location, String password) { 28 | this.id = id; 29 | this.name = name; 30 | this.sex = sex; 31 | this.clas = clas; 32 | this.location = location; 33 | this.password = password; 34 | } 35 | 36 | public Student(String id, String name, String sex, String clas, 37 | String location, String grade, String password) { 38 | super(); 39 | this.id = id; 40 | this.name = name; 41 | this.sex = sex; 42 | this.clas = clas; 43 | this.location = location; 44 | this.grade = grade; 45 | this.password = password; 46 | } 47 | public String getId() { 48 | return id; 49 | } 50 | public void setId(String id) { 51 | this.id = id; 52 | } 53 | public String getName() { 54 | return name; 55 | } 56 | public void setName(String name) { 57 | this.name = name; 58 | } 59 | public String getPassword() { 60 | return password; 61 | } 62 | public void setPassword(String password) { 63 | this.password = password; 64 | } 65 | 66 | public String getSex() { 67 | return sex; 68 | } 69 | public void setSex(String sex) { 70 | this.sex = sex; 71 | } 72 | public String getClas() { 73 | return clas; 74 | } 75 | public void setClas(String clas) { 76 | this.clas = clas; 77 | } 78 | public String getLocation() { 79 | return location; 80 | } 81 | public void setLocation(String location) { 82 | this.location = location; 83 | } 84 | 85 | public String getGrade() { 86 | return grade; 87 | } 88 | public void setGrade(String grade) { 89 | this.grade = grade; 90 | } 91 | @Override 92 | public boolean equals(Object obj) { 93 | Student student = (Student)obj; 94 | return this.id.equals(student.getId()) && this.name.equals(student.getName()) && this.password.equals(student.getPassword()); 95 | } 96 | @Override 97 | public int hashCode() { 98 | return this.id.hashCode()+this.name.hashCode()+this.password.hashCode(); 99 | } 100 | } 101 | -------------------------------------------------------------------------------- /src/com/andy/entity/Teacher.hbm.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /src/com/andy/entity/Teacher.java: -------------------------------------------------------------------------------- 1 | package com.andy.entity; 2 | 3 | public class Teacher { 4 | private String id; 5 | private String name; 6 | private String sex; 7 | private String location; 8 | private String password; 9 | public Teacher(){} 10 | // public Teacher(String id,String name,String sex,String location,String password){ 11 | // this.id = id; 12 | // this.name = name; 13 | // this.sex = sex; 14 | // this.location = location; 15 | // } 16 | 17 | public Teacher(String id, String name, String sex, 18 | String location, String password) { 19 | super(); 20 | this.id = id; 21 | this.name = name; 22 | this.sex = sex; 23 | this.location = location; 24 | this.password = password; 25 | } 26 | public String getId() { 27 | return id; 28 | } 29 | public void setId(String id) { 30 | this.id = id; 31 | } 32 | public String getName() { 33 | return name; 34 | } 35 | public void setName(String name) { 36 | this.name = name; 37 | } 38 | public String getPassword() { 39 | return password; 40 | } 41 | public void setPassword(String password) { 42 | this.password = password; 43 | } 44 | 45 | public String getSex() { 46 | return sex; 47 | } 48 | public void setSex(String sex) { 49 | this.sex = sex; 50 | } 51 | public String getLocation() { 52 | return location; 53 | } 54 | public void setLocation(String location) { 55 | this.location = location; 56 | } 57 | @Override 58 | public boolean equals(Object obj) { 59 | Teacher teacher = (Teacher)obj; 60 | return this.id.equals(teacher.getId()) && this.name.equals(teacher.getName()) && this.password.equals(teacher.getPassword()); 61 | } 62 | @Override 63 | public int hashCode() { 64 | return this.id.hashCode()+this.name.hashCode()+this.password.hashCode(); 65 | } 66 | } 67 | -------------------------------------------------------------------------------- /src/com/andy/service/CourseService.java: -------------------------------------------------------------------------------- 1 | package com.andy.service; 2 | 3 | import java.util.List; 4 | import java.util.Set; 5 | 6 | import com.andy.entity.Course; 7 | import com.andy.entity.Score; 8 | import com.andy.entity.Teacher; 9 | 10 | public interface CourseService { 11 | public List getAllNames(); 12 | public Set getAllTeachers(String courseName); 13 | public Course getCourseByName(String courseName); 14 | public boolean addCourse(Course course); 15 | public boolean setTeacher(Course course, Teacher teacher); 16 | } 17 | -------------------------------------------------------------------------------- /src/com/andy/service/CourseServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.andy.service; 2 | 3 | import java.util.List; 4 | import java.util.Set; 5 | 6 | import com.andy.dao.CourseDao; 7 | import com.andy.dao.CourseDaoImpl; 8 | import com.andy.entity.Course; 9 | import com.andy.entity.Score; 10 | import com.andy.entity.Teacher; 11 | 12 | public class CourseServiceImpl implements CourseService{ 13 | private CourseDao courseDao = new CourseDaoImpl(); 14 | @Override 15 | public List getAllNames() { 16 | return courseDao.getAllNames(); 17 | } 18 | @Override 19 | public Set getAllTeachers(String courseName) { 20 | return courseDao.getAllTeachers(courseName); 21 | } 22 | @Override 23 | public Course getCourseByName(String courseName) { 24 | return courseDao.getCourseByName(courseName); 25 | } 26 | @Override 27 | public boolean addCourse(Course course) { 28 | return courseDao.addCourse(course); 29 | } 30 | @Override 31 | public boolean setTeacher(Course course, Teacher teacher) { 32 | return courseDao.setTeacher(course, teacher); 33 | } 34 | 35 | } 36 | -------------------------------------------------------------------------------- /src/com/andy/service/ManagerService.java: -------------------------------------------------------------------------------- 1 | package com.andy.service; 2 | 3 | import com.andy.entity.Manager; 4 | 5 | public interface ManagerService { 6 | public Manager getManagerById(String id); 7 | public boolean login(Manager manager); 8 | public boolean modifyPassword(String id,String oldPassword,String newPassword); 9 | } 10 | -------------------------------------------------------------------------------- /src/com/andy/service/ManagerServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.andy.service; 2 | 3 | import com.andy.dao.ManagerDao; 4 | import com.andy.dao.ManagerDaoImpl; 5 | import com.andy.dao.StudentDao; 6 | import com.andy.dao.StudentDaoImpl; 7 | import com.andy.entity.Manager; 8 | import com.andy.entity.Student; 9 | 10 | public class ManagerServiceImpl implements ManagerService{ 11 | private ManagerDao managerDao = new ManagerDaoImpl(); 12 | @Override 13 | public boolean login(Manager manager) { 14 | Manager manager_db = managerDao.getManagerById(manager.getId()); 15 | if(manager!=null){ 16 | if(manager.equals(manager_db)){ 17 | return true; 18 | } 19 | } 20 | return false; 21 | } 22 | @Override 23 | public boolean modifyPassword(String id,String oldPassword ,String newPassword) { 24 | Manager manager = managerDao.getManagerById(id); 25 | if(oldPassword.equals(manager.getPassword())){ 26 | return managerDao.modifyPassword(id, newPassword); 27 | }else{ 28 | return false; 29 | } 30 | 31 | } 32 | @Override 33 | public Manager getManagerById(String id) { 34 | return managerDao.getManagerById(id); 35 | } 36 | 37 | } 38 | -------------------------------------------------------------------------------- /src/com/andy/service/QuestionService.java: -------------------------------------------------------------------------------- 1 | package com.andy.service; 2 | 3 | import java.util.List; 4 | 5 | import com.andy.entity.Question; 6 | 7 | public interface QuestionService { 8 | public List getAllQuestions(); 9 | public List getQuestionsByCourseId(String courseId); 10 | public String getAllAnwser(); 11 | public String getAnwserByQuestionId(String questionId); 12 | public boolean addQuestion(Question question); 13 | public boolean updateQuestion(Question question); 14 | public boolean deleteQuestion(int id); 15 | } 16 | -------------------------------------------------------------------------------- /src/com/andy/service/QuestionServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.andy.service; 2 | 3 | import java.util.List; 4 | 5 | import com.andy.dao.QuestionDao; 6 | import com.andy.dao.QuestionDaoImpl; 7 | import com.andy.entity.Question; 8 | 9 | public class QuestionServiceImpl implements QuestionService{ 10 | private QuestionDao questionDao = new QuestionDaoImpl(); 11 | @Override 12 | public List getAllQuestions() { 13 | // TODO Auto-generated method stub 14 | return null; 15 | } 16 | 17 | @Override 18 | public String getAllAnwser() { 19 | return questionDao.getAllAnwser(); 20 | } 21 | 22 | @Override 23 | public boolean addQuestion(Question question) { 24 | // TODO Auto-generated method stub 25 | return false; 26 | } 27 | 28 | @Override 29 | public boolean updateQuestion(Question question) { 30 | // TODO Auto-generated method stub 31 | return false; 32 | } 33 | 34 | @Override 35 | public boolean deleteQuestion(int id) { 36 | // TODO Auto-generated method stub 37 | return false; 38 | } 39 | 40 | @Override 41 | public List getQuestionsByCourseId(String courseId) { 42 | // TODO Auto-generated method stub 43 | return null; 44 | } 45 | 46 | @Override 47 | public String getAnwserByQuestionId(String questionId) { 48 | return questionDao.getAnwserByQuestionId(questionId); 49 | } 50 | 51 | } 52 | -------------------------------------------------------------------------------- /src/com/andy/service/ScoreService.java: -------------------------------------------------------------------------------- 1 | package com.andy.service; 2 | 3 | import java.util.List; 4 | 5 | import com.andy.entity.Score; 6 | 7 | public interface ScoreService { 8 | public boolean saveScore(Score score); 9 | public List getPassedScore(String studentId); 10 | public List getUnPassedScore(String studentId); 11 | public List getAllScore(String courseName,String teacherName,String studentName); 12 | public List getPassedScore(String courseName,String teacherName,String studentName); 13 | public List getUnpassedScore(String courseName,String teacherName,String studentName); 14 | } 15 | -------------------------------------------------------------------------------- /src/com/andy/service/ScoreServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.andy.service; 2 | 3 | import java.util.List; 4 | 5 | import com.andy.dao.ScoreDao; 6 | import com.andy.dao.ScoreDaoImpl; 7 | import com.andy.entity.Score; 8 | 9 | public class ScoreServiceImpl implements ScoreService{ 10 | private ScoreDao scoreDao = new ScoreDaoImpl(); 11 | @Override 12 | public boolean saveScore(Score score) { 13 | return scoreDao.saveScore(score); 14 | 15 | } 16 | @Override 17 | public List getPassedScore(String studentId) { 18 | return scoreDao.getPassedScore(studentId); 19 | } 20 | @Override 21 | public List getUnPassedScore(String studentId) { 22 | return scoreDao.getUnPassedScore(studentId); 23 | } 24 | @Override 25 | public List getAllScore(String courseName, String teacherName,String studentName) { 26 | return scoreDao.getAllScore(courseName, teacherName,studentName); 27 | } 28 | @Override 29 | public List getPassedScore(String courseName, String teacherName,String studentName) { 30 | return scoreDao.getPassedScore(courseName, teacherName,studentName); 31 | } 32 | @Override 33 | public List getUnpassedScore(String courseName, String teacherName,String studentName) { 34 | return scoreDao.getUnpassedScore(courseName, teacherName,studentName); 35 | } 36 | 37 | } 38 | -------------------------------------------------------------------------------- /src/com/andy/service/StudentService.java: -------------------------------------------------------------------------------- 1 | package com.andy.service; 2 | 3 | import java.util.List; 4 | 5 | import com.andy.entity.Student; 6 | 7 | public interface StudentService { 8 | public Student getStudentById(String id); 9 | public boolean login(Student student); 10 | public boolean modifyPassword(String id,String oldPassword,String newPassword); 11 | public boolean addStudent(Student student); 12 | public boolean deleteStudent(String studentId); 13 | public boolean updateStudent(String id,Student student); 14 | public List getAllNames(); 15 | } 16 | -------------------------------------------------------------------------------- /src/com/andy/service/StudentServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.andy.service; 2 | 3 | import java.util.List; 4 | 5 | import com.andy.dao.StudentDao; 6 | import com.andy.dao.StudentDaoImpl; 7 | import com.andy.entity.Student; 8 | 9 | public class StudentServiceImpl implements StudentService{ 10 | private StudentDao studentDao = new StudentDaoImpl(); 11 | @Override 12 | public boolean login(Student student) { 13 | //System.out.println(student.getName()+" "+student.getId()+" "+student.getPassword()); 14 | Student student_db = studentDao.getStudentById(student.getId()); 15 | if(student!=null){ 16 | if(student.equals(student_db)){ 17 | return true; 18 | } 19 | } 20 | return false; 21 | } 22 | @Override 23 | public boolean modifyPassword(String id,String oldPassword ,String newPassword) { 24 | Student student = studentDao.getStudentById(id); 25 | if(oldPassword.equals(student.getPassword())){ 26 | return studentDao.modifyPassword(id, newPassword); 27 | }else{ 28 | return false; 29 | } 30 | 31 | } 32 | @Override 33 | public Student getStudentById(String id) { 34 | return studentDao.getStudentById(id); 35 | } 36 | @Override 37 | public boolean addStudent(Student student) { 38 | return studentDao.addStudent(student); 39 | } 40 | @Override 41 | public boolean deleteStudent(String studentId) { 42 | return studentDao.deleteStudent(studentId); 43 | } 44 | @Override 45 | public boolean updateStudent(String id, Student student) { 46 | return studentDao.updateStudent(id, student); 47 | } 48 | @Override 49 | public List getAllNames() { 50 | return studentDao.getAllNames(); 51 | } 52 | 53 | } 54 | -------------------------------------------------------------------------------- /src/com/andy/service/TeacherService.java: -------------------------------------------------------------------------------- 1 | package com.andy.service; 2 | 3 | import java.util.List; 4 | 5 | import com.andy.entity.Teacher; 6 | 7 | public interface TeacherService { 8 | public Teacher getTeacherById(String id); 9 | public Teacher getTeacherByName(String teacherName); 10 | public boolean login(Teacher teacher); 11 | public boolean modifyPassword(String id,String oldPassword,String newPassword); 12 | public boolean addTeacher(Teacher teacher); 13 | public boolean deleteTeacher(String teacherId); 14 | public boolean updateTeacher(String id,Teacher teacher); 15 | public List getAllTeachers(); 16 | } 17 | -------------------------------------------------------------------------------- /src/com/andy/service/TeacherServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.andy.service; 2 | 3 | import java.util.List; 4 | 5 | import com.andy.dao.TeacherDao; 6 | import com.andy.dao.TeacherDaoImpl; 7 | import com.andy.entity.Teacher; 8 | 9 | public class TeacherServiceImpl implements TeacherService{ 10 | private TeacherDao teacherDao = new TeacherDaoImpl(); 11 | @Override 12 | public boolean login(Teacher teacher) { 13 | //System.out.println(teacher.getName()+" "+teacher.getId()+" "+teacher.getPassword()); 14 | Teacher teacher_db = teacherDao.getTeacherById(teacher.getId()); 15 | if(teacher!=null){ 16 | if(teacher.equals(teacher_db)){ 17 | return true; 18 | } 19 | } 20 | return false; 21 | } 22 | @Override 23 | public boolean modifyPassword(String id,String oldPassword ,String newPassword) { 24 | Teacher teacher = teacherDao.getTeacherById(id); 25 | if(oldPassword.equals(teacher.getPassword())){ 26 | return teacherDao.modifyPassword(id, newPassword); 27 | }else{ 28 | return false; 29 | } 30 | 31 | } 32 | @Override 33 | public Teacher getTeacherById(String id) { 34 | return teacherDao.getTeacherById(id); 35 | } 36 | @Override 37 | public Teacher getTeacherByName(String teacherName) { 38 | return teacherDao.getTeacherByName(teacherName); 39 | } 40 | @Override 41 | public boolean addTeacher(Teacher teacher) { 42 | return teacherDao.addTeacher(teacher); 43 | } 44 | @Override 45 | public boolean deleteTeacher(String teacherId) { 46 | return teacherDao.deleteTeacher(teacherId); 47 | } 48 | @Override 49 | public boolean updateTeacher(String id, Teacher teacher) { 50 | return teacherDao.updateTeacher(id, teacher); 51 | } 52 | @Override 53 | public List getAllTeachers() { 54 | return teacherDao.getAllTeachers(); 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /src/com/andy/test/Test.java: -------------------------------------------------------------------------------- 1 | package com.andy.test; 2 | 3 | import java.util.HashSet; 4 | import java.util.Set; 5 | 6 | import org.hibernate.Session; 7 | import org.hibernate.Transaction; 8 | 9 | import com.andy.entity.Course; 10 | import com.andy.entity.Question; 11 | import com.andy.entity.Teacher; 12 | import com.andy.util.HibernateSessionUtil; 13 | 14 | public class Test { 15 | public static void main(String[] args) { 16 | Session session = HibernateSessionUtil.getCurrentSession(); 17 | Transaction transaction = session.beginTransaction(); 18 | // Course c = new Course(); 19 | // c.setId("c003"); 20 | // c.setName("c"); 21 | Course c =(Course) session.load(Course.class, "c001"); 22 | // Set teachers = c.getTeachers(); 23 | // Teacher t1 =(Teacher) session.load(Teacher.class, "002"); 24 | // Teacher t2 =(Teacher) session.load(Teacher.class, "001"); 25 | // teachers.add(t1); 26 | // teachers.add(t2); 27 | // c.setTeachers(teachers); 28 | // System.out.println(teachers.size()); 29 | // session.save(c); 30 | 31 | Question q = new Question(); 32 | q.setQues("1"); 33 | q.setChoose1("2"); 34 | q.setChoose2("3"); 35 | q.setChoose3("4"); 36 | q.setChoose4("5"); 37 | q.setAnwser("6"); 38 | q.setCourse(c); 39 | session.save(q); 40 | transaction.commit(); 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /src/com/andy/util/DBUtil.java: -------------------------------------------------------------------------------- 1 | package com.andy.util; 2 | 3 | import java.sql.Connection; 4 | import java.sql.DriverManager; 5 | import java.sql.ResultSet; 6 | import java.sql.SQLException; 7 | import java.sql.Statement; 8 | 9 | public class DBUtil { 10 | private static Connection conn=null; 11 | private static Statement stm=null; 12 | 13 | public static Connection getConnection(){ 14 | String url="jdbc:oracle:thin:@127.0.0.1:1521:orcl"; 15 | String userName="scott"; 16 | String password="tiger"; 17 | try { 18 | Class.forName("oracle.jdbc.driver.OracleDriver"); 19 | conn=DriverManager.getConnection(url, userName, password); 20 | stm=conn.createStatement(); 21 | } catch (Exception e1) { 22 | e1.printStackTrace(); 23 | } 24 | return conn; 25 | } 26 | public static ResultSet executeQuery(String sql){ 27 | ResultSet rs=null; 28 | try { 29 | rs=stm.executeQuery(sql); 30 | } catch (SQLException e) { 31 | e.printStackTrace(); 32 | } 33 | return rs; 34 | } 35 | public static int executeUpdate(String sql){ 36 | int count=0; 37 | try { 38 | count=stm.executeUpdate(sql); 39 | } catch (SQLException e) { 40 | count=0; 41 | e.printStackTrace(); 42 | } 43 | return count; 44 | 45 | } 46 | public static void commit(){ 47 | try { 48 | conn.commit(); 49 | } catch (SQLException e) { 50 | e.printStackTrace(); 51 | } 52 | } 53 | public static void close(){ 54 | try { 55 | if(stm!=null){ 56 | stm.close(); 57 | stm=null; 58 | } 59 | if(conn!=null){ 60 | conn.close(); 61 | conn=null; 62 | } 63 | } catch (SQLException e) { 64 | e.printStackTrace(); 65 | } 66 | } 67 | 68 | } 69 | -------------------------------------------------------------------------------- /src/com/andy/util/HibernateSessionUtil.java: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andybing/OnlineExamination/1d949e6c2c6aa54e799e831cb89fbbf3e24666c4/src/com/andy/util/HibernateSessionUtil.java -------------------------------------------------------------------------------- /src/hibernate.cfg.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | org.hibernate.dialect.Oracle9Dialect 12 | 13 | 14 | jdbc:oracle:thin:@127.0.0.1:1521:orcl 15 | 16 | scott 17 | tiger 18 | 19 | oracle.jdbc.driver.OracleDriver 20 | 21 | 22 | oracle.jdbc.driver.OracleDriver 23 | 24 | true 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /src/struts.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | main.jsp 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | image/jpeg 23 | inputStream 24 | 2048 25 | 26 | 27 | 28 | 29 | 31 | 32 | 33 | 34 | login.jsp 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | student/showInfo.jsp 43 | 44 | 45 | 46 | student/showScore.jsp 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | manager/showStudentInfo.jsp 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | login.jsp 69 | 70 | 71 | 72 | teacher/showInfo.jsp 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | manager/showTeacherInfo.jsp 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | teacher/showAllScore.jsp 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | login.jsp 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | -------------------------------------------------------------------------------- /学生在线考试系统资料/course.sql: -------------------------------------------------------------------------------- 1 | create table course (id varchar2(20) primary key,name varchar2(20)); 2 | 3 | -------------------------------------------------------------------------------- /学生在线考试系统资料/course_score.sql: -------------------------------------------------------------------------------- 1 | create table course_score(id varchar2(20),sid varchar2(20)); 2 | -------------------------------------------------------------------------------- /学生在线考试系统资料/course_student.sql: -------------------------------------------------------------------------------- 1 | create table course_student(id varchar2(20),sid varchar2(20)); 2 | -------------------------------------------------------------------------------- /学生在线考试系统资料/course_teacher.sql: -------------------------------------------------------------------------------- 1 | create table course_teacher (id varchar(20),tid varchar2(20)); 2 | 3 | -------------------------------------------------------------------------------- /学生在线考试系统资料/manager.sql: -------------------------------------------------------------------------------- 1 | create table manager (id varchar2(20) primary key,name varchar2(20),password varchar2(20)); 2 | -------------------------------------------------------------------------------- /学生在线考试系统资料/score.sql: -------------------------------------------------------------------------------- 1 | create table score(id int primary key,score number,state varchar2(20)); 2 | 3 | create sequence seq_score start with 1 increment by 1; 4 | -------------------------------------------------------------------------------- /学生在线考试系统资料/teacher.sql: -------------------------------------------------------------------------------- 1 | create table teacher(id varchar2(20),name varchar2(20),sex varchar2(2),location varchar2(20),password varchar2(20)); 2 | -------------------------------------------------------------------------------- /学生在线考试系统资料/学生在线考试系统资料.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andybing/OnlineExamination/1d949e6c2c6aa54e799e831cb89fbbf3e24666c4/学生在线考试系统资料/学生在线考试系统资料.zip -------------------------------------------------------------------------------- /学生在线考试系统资料/学生在线考试系统需求分析设计.doc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andybing/OnlineExamination/1d949e6c2c6aa54e799e831cb89fbbf3e24666c4/学生在线考试系统资料/学生在线考试系统需求分析设计.doc -------------------------------------------------------------------------------- /学生在线考试系统资料/截屏/QQ截图20160103152834.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andybing/OnlineExamination/1d949e6c2c6aa54e799e831cb89fbbf3e24666c4/学生在线考试系统资料/截屏/QQ截图20160103152834.png -------------------------------------------------------------------------------- /学生在线考试系统资料/截屏/QQ截图20160103152848.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andybing/OnlineExamination/1d949e6c2c6aa54e799e831cb89fbbf3e24666c4/学生在线考试系统资料/截屏/QQ截图20160103152848.png -------------------------------------------------------------------------------- /学生在线考试系统资料/截屏/QQ截图20160103152905.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andybing/OnlineExamination/1d949e6c2c6aa54e799e831cb89fbbf3e24666c4/学生在线考试系统资料/截屏/QQ截图20160103152905.png -------------------------------------------------------------------------------- /学生在线考试系统资料/截屏/QQ截图20160103152914.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andybing/OnlineExamination/1d949e6c2c6aa54e799e831cb89fbbf3e24666c4/学生在线考试系统资料/截屏/QQ截图20160103152914.png -------------------------------------------------------------------------------- /学生在线考试系统资料/截屏/QQ截图20160103152920.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andybing/OnlineExamination/1d949e6c2c6aa54e799e831cb89fbbf3e24666c4/学生在线考试系统资料/截屏/QQ截图20160103152920.png -------------------------------------------------------------------------------- /学生在线考试系统资料/截屏/QQ截图20160103152934.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andybing/OnlineExamination/1d949e6c2c6aa54e799e831cb89fbbf3e24666c4/学生在线考试系统资料/截屏/QQ截图20160103152934.png -------------------------------------------------------------------------------- /学生在线考试系统资料/截屏/QQ截图20160103152945.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andybing/OnlineExamination/1d949e6c2c6aa54e799e831cb89fbbf3e24666c4/学生在线考试系统资料/截屏/QQ截图20160103152945.png -------------------------------------------------------------------------------- /学生在线考试系统资料/截屏/QQ截图20160103153009.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andybing/OnlineExamination/1d949e6c2c6aa54e799e831cb89fbbf3e24666c4/学生在线考试系统资料/截屏/QQ截图20160103153009.png -------------------------------------------------------------------------------- /学生在线考试系统资料/截屏/QQ截图20160103153021.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andybing/OnlineExamination/1d949e6c2c6aa54e799e831cb89fbbf3e24666c4/学生在线考试系统资料/截屏/QQ截图20160103153021.png -------------------------------------------------------------------------------- /学生在线考试系统资料/截屏/QQ截图20160103153028.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andybing/OnlineExamination/1d949e6c2c6aa54e799e831cb89fbbf3e24666c4/学生在线考试系统资料/截屏/QQ截图20160103153028.png -------------------------------------------------------------------------------- /学生在线考试系统资料/截屏/QQ截图20160103153103.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andybing/OnlineExamination/1d949e6c2c6aa54e799e831cb89fbbf3e24666c4/学生在线考试系统资料/截屏/QQ截图20160103153103.png -------------------------------------------------------------------------------- /学生在线考试系统资料/截屏/QQ截图20160103153110.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andybing/OnlineExamination/1d949e6c2c6aa54e799e831cb89fbbf3e24666c4/学生在线考试系统资料/截屏/QQ截图20160103153110.png -------------------------------------------------------------------------------- /学生在线考试系统资料/截屏/QQ截图20160103153116.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andybing/OnlineExamination/1d949e6c2c6aa54e799e831cb89fbbf3e24666c4/学生在线考试系统资料/截屏/QQ截图20160103153116.png -------------------------------------------------------------------------------- /学生在线考试系统资料/截屏/QQ截图20160103153131.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andybing/OnlineExamination/1d949e6c2c6aa54e799e831cb89fbbf3e24666c4/学生在线考试系统资料/截屏/QQ截图20160103153131.png -------------------------------------------------------------------------------- /学生在线考试系统资料/截屏/QQ截图20160103153137.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andybing/OnlineExamination/1d949e6c2c6aa54e799e831cb89fbbf3e24666c4/学生在线考试系统资料/截屏/QQ截图20160103153137.png -------------------------------------------------------------------------------- /学生在线考试系统资料/截屏/QQ截图20160103153155.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andybing/OnlineExamination/1d949e6c2c6aa54e799e831cb89fbbf3e24666c4/学生在线考试系统资料/截屏/QQ截图20160103153155.png -------------------------------------------------------------------------------- /学生在线考试系统资料/截屏/QQ截图20160103153215.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andybing/OnlineExamination/1d949e6c2c6aa54e799e831cb89fbbf3e24666c4/学生在线考试系统资料/截屏/QQ截图20160103153215.png -------------------------------------------------------------------------------- /学生在线考试系统资料/截屏/QQ截图20160103153222.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andybing/OnlineExamination/1d949e6c2c6aa54e799e831cb89fbbf3e24666c4/学生在线考试系统资料/截屏/QQ截图20160103153222.png -------------------------------------------------------------------------------- /学生在线考试系统资料/截屏/QQ截图20160103153250.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andybing/OnlineExamination/1d949e6c2c6aa54e799e831cb89fbbf3e24666c4/学生在线考试系统资料/截屏/QQ截图20160103153250.png -------------------------------------------------------------------------------- /学生在线考试系统资料/截屏/QQ截图20160103153330.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andybing/OnlineExamination/1d949e6c2c6aa54e799e831cb89fbbf3e24666c4/学生在线考试系统资料/截屏/QQ截图20160103153330.png -------------------------------------------------------------------------------- /学生在线考试系统资料/截屏/QQ截图20160103153343.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andybing/OnlineExamination/1d949e6c2c6aa54e799e831cb89fbbf3e24666c4/学生在线考试系统资料/截屏/QQ截图20160103153343.png -------------------------------------------------------------------------------- /学生在线考试系统资料/截屏/QQ截图20160103153351.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andybing/OnlineExamination/1d949e6c2c6aa54e799e831cb89fbbf3e24666c4/学生在线考试系统资料/截屏/QQ截图20160103153351.png -------------------------------------------------------------------------------- /学生在线考试系统资料/截屏/登陆-学生.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andybing/OnlineExamination/1d949e6c2c6aa54e799e831cb89fbbf3e24666c4/学生在线考试系统资料/截屏/登陆-学生.png -------------------------------------------------------------------------------- /学生在线考试系统资料/截屏/登陆-管理员.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andybing/OnlineExamination/1d949e6c2c6aa54e799e831cb89fbbf3e24666c4/学生在线考试系统资料/截屏/登陆-管理员.png -------------------------------------------------------------------------------- /学生在线考试系统资料/截屏/登陆-老师.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andybing/OnlineExamination/1d949e6c2c6aa54e799e831cb89fbbf3e24666c4/学生在线考试系统资料/截屏/登陆-老师.png -------------------------------------------------------------------------------- /学生在线考试系统资料/报告范本.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andybing/OnlineExamination/1d949e6c2c6aa54e799e831cb89fbbf3e24666c4/学生在线考试系统资料/报告范本.pdf -------------------------------------------------------------------------------- /学生在线考试系统资料/计算机科学与技术专业12级《综合课程设计》报告-学生在线考试系统.doc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andybing/OnlineExamination/1d949e6c2c6aa54e799e831cb89fbbf3e24666c4/学生在线考试系统资料/计算机科学与技术专业12级《综合课程设计》报告-学生在线考试系统.doc --------------------------------------------------------------------------------