软件项目设计报告
实验报告管理系统
所在班级 小组成员 学院名称 专业名称 指导教师 起止日期
12计卓
20120511218 江灵瞳 20120506143 印海平 20120506144 钱晨晨
信电工程学院 计算机科学与技术
胡局新
2014.12.16-2015.1.15
2015年
1月 15日
37
目 录
1 绪论 ...................................................................................................................................... 1 1.1开发背景 ............................................................................................................................ 1 实验教学是学生技能培养的重要环节之一,学生实验报告的质量在一定程度上反映了实验教学的质量,实验报告管理水平也反映了实验教学管理水平。目前,大部分学校所提交的实验报告大多还停留在以纸为介质的方式上,这将严重制约着实验教学的开展。首先,很多课程的实验结果在纸质实验报告中不能表现或不能完全表现,其次纸质实验报告的批改和分析也是实验授课老师的一个很重负担,如何提高学生实验报告的表象能力,提高教师批改实验报告的效率并及时发现和纠正实验报告中存在的问题是许多课程实验授课教师所面对的一个难题。 ..................................................................................... 1
1.2 本次设计完成的工作....................................................................................................... 1 1.3 任务分工 ........................................................................................................................... 1 1.4 任务 .................................................................................................................................... 1 2 系统分析 .................................................................................................................................. 2 2.1需求分析 ............................................................................................................................ 2 2.2可行性分析 ........................................................................................................................ 2 2.3 用例图................................................................................................................................ 2 3 系统设计与实现 ..................................................................................................................... 4 3.1系统目标 ............................................................................................................................ 4 3.2系统功能结构 .................................................................................................................... 4 3.3功能流程及工作流程 ........................................................................................................ 4 3.4系统流程图 ........................................................................................................................ 5 3.5构建开发环境 .................................................................................................................... 5 3.7文件夹组织结构 ................................................................................................................ 6 3.8 学生模块的实现 ............................................................................................................... 6 3.9 老师模块的实现 ............................................................................................................. 19
37
.......................................................................................................................................................... 20
.......................................................................................................................................................... 20
.......................................................................................................................................................... 20
37
.......................................................................................................................................................... 21
package com.xzit.entity; ......................................................................................................... 22 public class Upfile { ................................................................................................................. 22 private String fileName; //文件名称 ............................................................................. 22 private String fileStuClass;//课程班级 .................................................................................. 22 private String fileCourDate;//学年 ......................................................................................... 22 private String fileCourName;//课程名称 .............................................................................. 22 private String fileExperName;//实验名称 ............................................................................. 22 public String getFileName() { .................................................................................................. 22 return fileName; ...................................................................................................................... 22 } ................................................................................................................................................ 22 public void setFileName(String fileName) { ........................................................................... 22 this.fileName = fileName; ....................................................................................................... 22 } ................................................................................................................................................ 22 public String getFileStuClass() { .............................................................................................. 22 return fileStuClass; .................................................................................................................. 22 } ................................................................................................................................................ 23 public void setFileStuClass(String fileStuClass) { ................................................................... 23 this.fileStuClass = fileStuClass; ............................................................................................... 23 } ................................................................................................................................................ 23 public String getFileCourDate() { ............................................................................................ 23 return fileCourDate; ................................................................................................................ 23 } ................................................................................................................................................ 23 public void setFileCourDate(String fileCourDate) { ............................................................... 23
37
this.fileCourDate = fileCourDate; ........................................................................................... 23 } ................................................................................................................................................ 23 public String getFileCourName() { .......................................................................................... 23 return fileCourName; .............................................................................................................. 23 } ................................................................................................................................................ 23 public void setFileCourName(String fileCourName) { ........................................................... 23 this.fileCourName = fileCourName; ....................................................................................... 23 } ................................................................................................................................................ 23 public String getFileExperName() { ........................................................................................ 23 return fileExperName; ............................................................................................................ 23 } ................................................................................................................................................ 23 public void setFileExperName(String fileExperName) { ........................................................ 23 this.fileExperName = fileExperName; .................................................................................... 23 } ................................................................................................................................................ 23 } ................................................................................................................................................ 23 package com.xzit.dao.impl; .................................................................................................... 23 import java.sql.Connection; .................................................................................................... 23 import java.sql.PreparedStatement; ...................................................................................... 23 import java.sql.ResultSet; ....................................................................................................... 23 import java.text.SimpleDateFormat; ...................................................................................... 23 import java.util.Date; .............................................................................................................. 23 import org.apache.struts2.ServletActionContext; ................................................................ 23 import com.xzit.dao.IUpfileDao; ............................................................................................ 24 import com.xzit.entity.Upfile; ................................................................................................. 24 import com.xzit.util.DBConnection; ....................................................................................... 24 public class UpfileDao extends BaseDao 37 strat=conn.prepareStatement(sql); ........................................................................................ 24 ResultSet rs=strat.executeQuery(); ........................................................................................ 24 Upfile content=null; ................................................................................................................ 24 while(rs.next()){ ....................................................................................................................... 24 content=new Upfile(); ............................................................................................................. 24 content.setFileCourDate(rs.getString(\"CourseTime\"));......................................................... 24 content.setFileCourName(rs.getString(\"CourseName\")); ..................................................... 24 content.setFileStuClass(rs.getString(\"ClassName\")); ............................................................ 24 } ................................................................................................................................................ 24 return content; ........................................................................................................................ 24 } ................................................................................................................................................ 24 public String SaveFileRoad(String experid,String path,String upfilename) throws Exception {......................................................................................................................................................... 24 // TODO Auto-generated method stub .................................................................................. 25 SimpleDateFormat df = new SimpleDateFormat(\"yyyy-MM-dd\");//设置日期格式 ........... 25 String datetime = df.format(new Date());// new Date()为获取当前系统时间................... 25 String sql = \"update expertablesubmit where set FileRoad='\"+path+\"',Status='是 and ',UpfileDate='\"+datetime ................................................................................................................ 25 +\"',FileName='\"+upfilename+\"' ExperimentID='\"+experid+\"' StudentID='\"+ServletActionContext.getRequest().getSession().getAttribute(\"userId\")+\"'\"; ....... 25 strat=conn.prepareStatement(sql); ........................................................................................ 25 int n = strat.executeUpdate(); ................................................................................................ 25 if(n>0){ ..................................................................................................................................... 25 return \"success\"; ..................................................................................................................... 25 } ................................................................................................................................................ 25 return \"false\"; .......................................................................................................................... 25 } ................................................................................................................................................ 25 public String teaSaveFileRoad(String experid, String path, String courid) ........................... 25 throws Exception { .................................................................................................................. 25 // TODO Auto-generated method stub .................................................................................. 25 String sql = \"update expercontenttable set Templetfile='\"+path+\"' where ExperimentID='\"+experid+\"' and CourseID='\"+courid+\"'\"; ............................................................ 25 strat=conn.prepareStatement(sql); ........................................................................................ 25 37 int n = strat.executeUpdate(); ................................................................................................ 25 if(n>0){ ..................................................................................................................................... 25 return \"success\"; ..................................................................................................................... 25 } ................................................................................................................................................ 25 return \"false\"; .......................................................................................................................... 25 } ................................................................................................................................................ 25 } ................................................................................................................................................ 25 package com.xzit.entity; ......................................................................................................... 25 public class Experclass { .......................................................................................................... 26 private int Eid; ......................................................................................................................... 26 private String courseID; .......................................................................................................... 26 private String courseName; .................................................................................................... 26 private String courseTime; .................................................................................................. 26 private String coursePeriod;//课程学时 ................................................................................ 26 private int experimentNum; ................................................................................................... 26 private String teacherName; .................................................................................................. 26 private String className; ....................................................................................................... 26 public Experclass() { ................................................................................................................ 26 super(); .................................................................................................................................... 26 } ................................................................................................................................................ 26 public Experclass(int eid, String courseID, String courseName, ............................................ 26 String courseTime, int experimentNum, String teacherName, ............................................ 26 String className) { ................................................................................................................. 26 super(); .................................................................................................................................... 26 Eid = eid; .................................................................................................................................. 26 this.courseID = courseID; ........................................................................................................ 26 this.courseName = courseName; ........................................................................................... 26 this.courseTime = courseTime; .............................................................................................. 26 this.experimentNum = experimentNum; ............................................................................... 26 this.teacherName = teacherName; ........................................................................................ 26 this.className = className; .................................................................................................. 26 } ................................................................................................................................................ 26 public Experclass(int eid, String courseID, String courseName, ............................................ 26 37 String courseTime, String coursePeriod, int experimentNum, ............................................. 26 String teacherName, String className) { .............................................................................. 26 super(); .................................................................................................................................... 26 Eid = eid; .................................................................................................................................. 26 this.courseID = courseID; ........................................................................................................ 27 this.courseName = courseName; ........................................................................................... 27 this.courseTime = courseTime; .............................................................................................. 27 this.coursePeriod = coursePeriod; .......................................................................................... 27 this.experimentNum = experimentNum; ............................................................................... 27 this.teacherName = teacherName; ........................................................................................ 27 this.className = className; .................................................................................................. 27 } ................................................................................................................................................ 27 public String getCoursePeriod() { ........................................................................................... 27 return coursePeriod; ............................................................................................................... 27 } ................................................................................................................................................ 27 public void setCoursePeriod(String coursePeriod) { .............................................................. 27 this.coursePeriod = coursePeriod; .......................................................................................... 27 } ................................................................................................................................................ 27 public String getCourseID() { ................................................................................................... 27 return courseID; ...................................................................................................................... 27 } ................................................................................................................................................ 27 public void setCourseID(String courseID) { ............................................................................ 27 this.courseID = courseID; ........................................................................................................ 27 } ................................................................................................................................................ 27 public String getCourseName() { ............................................................................................ 27 return courseName; ................................................................................................................ 27 } ................................................................................................................................................ 27 public void setCourseName(String courseName) { ............................................................... 27 this.courseName = courseName; ........................................................................................... 27 } ................................................................................................................................................ 27 public String getCourseTime() { .............................................................................................. 27 return courseTime; ................................................................................................................. 27 } ................................................................................................................................................ 27 public void setCourseTime(String courseTime) { ................................................................... 27 37 this.courseTime = courseTime; .............................................................................................. 27 } ................................................................................................................................................ 27 public int getExperimentNum() { ............................................................................................ 28 return experimentNum; .......................................................................................................... 28 } ................................................................................................................................................ 28 public void setExperimentNum(int experimentNum) { ......................................................... 28 this.experimentNum = experimentNum; ............................................................................... 28 } ................................................................................................................................................ 28 public String getTeacherName() { ........................................................................................... 28 return teacherName; .............................................................................................................. 28 } ................................................................................................................................................ 28 public void setTeacherName(String teacherName) { ............................................................ 28 this.teacherName = teacherName; ........................................................................................ 28 } ................................................................................................................................................ 28 public String getClassName() { ............................................................................................... 28 return className; ................................................................................................................... 28 } ................................................................................................................................................ 28 public void setClassName(String className) { ...................................................................... 28 this.className = className; .................................................................................................. 28 } ................................................................................................................................................ 28 } ................................................................................................................................................ 28 package com.xzit.dao.impl; .................................................................................................... 28 import java.sql.Connection; .................................................................................................... 28 import java.sql.PreparedStatement; ...................................................................................... 28 import java.sql.ResultSet; ....................................................................................................... 28 import java.util.ArrayList; ........................................................................................................ 28 import java.util.HashMap; ...................................................................................................... 28 import java.util.List; ................................................................................................................ 28 import java.util.Map; .............................................................................................................. 28 import org.apache.struts2.ServletActionContext; ................................................................ 29 import com.xzit.dao.ExperclassDao; ...................................................................................... 29 import com.xzit.entity.ExperContent; .................................................................................... 29 import com.xzit.entity.Experclass; ......................................................................................... 29 import com.xzit.util.DBConnection; ....................................................................................... 29 37 import com.xzit.util.DataGrid; ................................................................................................ 29 public class ExperclassDaoimpl extends BaseDao private String CourseTime; ..................................................................................................... 29 public ExperclassDaoimpl() throws Exception { ..................................................................... 29 // TODO Auto-generated constructor stub ............................................................................ 29 } ................................................................................................................................................ 29 private Connection conn=new DBConnection().getConn(); ................................................. 29 private PreparedStatement strat=null; .................................................................................. 29 public DataGrid
因篇幅问题不能全部显示,请点此查看更多更全内容