教务管理系统之teacher层
browseHomework.html
<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
<meta charset="UTF-8">
<title>作业浏览</title>
<link type="text/css" rel="stylesheet" href="/css/add.css">
<link type="text/css" rel="stylesheet" href="/css/browseHomework.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.3/css/all.min.css">
<script src="http://code.jquery.com/jquery-3.5.1.min.js"></script>
<script src="/js/browseHomework.js"></script>
</head>
<body>
<label id="addlab">
<span class="plus" id="addVideo">添加作业+</span>
</label>
<div id="overlay" class="overlay"></div>
<div id="popup" class="popup">
<button id="closebtn">×</button>
<form action="/teacher/addHomework" id="myForm" method="post" enctype="multipart/form-data">
<label>
作业要求
<input type="text" name="homeworkrequest" required="required">
</label>
<label>
作业图片
<input type="file" name="homework" id="homework" required="required" style="border: none">
</label>
<label>
开始时间
<input type="date" name="startline" required="required">
</label>
<label>
结束时间
<input type="date" name="endline" required="required">
</label>
<input type="submit" value="添加">
</form>
</div>
<label id="homeworkLab2">
<span id="sp1"><input type="radio" value="0" name="kind">全部</span>
<span id="sp2"><input type="radio" value="1" name="kind">已过期</span>
<span id="sp3"><input type="radio" value="2" name="kind">未过期</span>
</label>
<div class="homework-container">
<div class="homework-item" th:each="i,index : ${homeworkList}">
<a th:href="@{/teacher/homeworkDetail(homeworkid=${i.getHomeworkid()},index=${index.index})}" target="_blank" class="a">
<span th:text="第+${index.index}+次作业"></span>
<br/>
开始时间:<span style="font-size: 18px" th:text="${i.getStartline()}"></span>
<br/>
结束时间:<span style="font-size: 18px" th:text="${i.getEndline()}"></span>
<br/>
已完成人数:<span style="font-size: 18px" th:text="${solveNum.get(i.getHomeworkid())}"></span>
<br/>
总人数:<span style="font-size: 18px" th:text="${allNum}"></span>
<br/>
</a>
<a th:href="@{/teacher/deleteHomework(homeworkid=${i.getHomeworkid()})}">
<button class="delete-button">
<i class="fas fa-trash"></i>
</button>
</a>
</div>
</div>
</body>
</html>
browseVideo.html
<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
<meta charset="UTF-8">
<title>教学视频</title>
<link type="text/css" rel="stylesheet" href="/css/add.css">
<link type="text/css" rel="stylesheet" href="/css/browseVideo.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.3/css/all.min.css">
<script src="http://code.jquery.com/jquery-3.5.1.min.js"></script>
<script src="/js/browseVideo.js"></script>
</head>
<body>
<label id="addlab">
<span class="plus" id="addVideo">添加视频+</span>
</label>
<label id="lab">
<span>关键字搜索</span><input type="text" name="condition" id="condition"><button id="find">搜索</button>
</label>
<div id="overlay" class="overlay"></div>
<div id="popup" class="popup">
<button id="closebtn">×</button>
<form action="/teacher/addVideo" id="myForm" method="post" enctype="multipart/form-data">
<label>
视频标题
<input type="text" name="videoname" required="required">
</label>
<label>
视频简介
<textarea name="videointroducation" required="required">
</textarea>
</label>
<label>
视频封面
<input type="file" name="cover" id="cover" required="required" style="border: none">
</label>
<label>
视频
<input type="file" name="file" id="videos" required="required" style="border: none">
</label>
<input type="submit" value="添加">
</form>
</div>
<div class="video-container">
<div class="video-item" th:each="i : ${videoList}">
<a th:href="@{/teacher/videoDetail(videoid=${i.getVideoid()})}" target="_blank" class="a">
<img th:src="@{${videoImg.get(i.getVideoid())}}">
<p th:text="${i.getVideoid()}+': '+${i.getVideoname()}"></p>
<span th:text="${i.getVideotime()}"></span>
</a>
<a th:href="@{/teacher/deleteVideo(videoid=${i.getVideoid()})}">
<button class="delete-button">
<i class="fas fa-trash"></i>
</button>
</a>
</div>
</div>
</body>
</html>
changePwd.html
<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
<meta charset="UTF-8">
<title>修改密码</title>
<script src="http://code.jquery.com/jquery-3.5.1.min.js"></script>
<script type="text/javascript" src="/js/changeTeacherPwd.js"></script>
<link type="text/css" rel="stylesheet" href="/css/changePwd.css">
</head>
<body>
<form action="/teachcer/changePwd" id="myForm" method="post">
<label>
旧密码
<input type="password" name="oldpwd" id="oldpwd">
</label>
<label>
新密码
<input type="password" name="newpwd1" id="newpwd1">
确认新密码
<input type="password" name="newpwd2" id="newpwd2">
</label>
<input type="submit" value="修改">
</form>
</body>
</html>
homeworkDetail.html
<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
<meta charset="UTF-8">
<title>作业详情</title>
<link rel="stylesheet" type="text/css" href="/css/homeworkDetail.css">
</head>
<body>
<div class="homework">
<h1 th:text="第+${index}+次作业"></h1>
<p th:text="'作业要求: '+${homework.getHomeworkrequest()}"></p>
<img th:src="@{${homeworkImg}}">
<br/>
<span th:text="'开始时间: '+${homework.getStartline()}"></span>
<br/>
<span th:text="'结束时间: '+${homework.getEndline()}"></span>
</div>
<div class="answer-container">
<h1>学生答案</h1>
<div class="answer-item" th:each="i : ${studentList}">
<img th:if="${stuImg.get(i.getStuid())}!=null" th:src="@{${stuImg.get(i.getStuid())}}" class="avatar">
<img th:if="${stuImg.get(i.getStuid())}==null" src="/img/default.png" class="avatar">
<span th:text="${i.getStuclass()}">班级</span>
<span th:text="${i.getStuname()}">姓名</span>
<p th:if="${i.getMyAnswer()!=null}" th:text="'提交时间: '+${i.getMyAnswer().getSubmittime()}">提交时间</p>
<img th:if="${i.getMyAnswer()!=null}" th:src="@{${answerImg.get(i.getStuid())}}" class="stuAnswer">
<p th:unless="${i.getMyAnswer()!=null}">该同学尚未提交</p>
<span th:if="${i.getMyAnswer()!=null and i.getMyAnswer().getScore()>0}" th:text="${i.getMyAnswer().getScore()}"></span>
<form th:action="@{/teacher/updateHScore(stuid=${i.getStuid()},homeworkid=${homework.getHomeworkid()})}" method="post" class="an_score">
<input type="text" placeholder="暂无分数" name="score">
<input type="submit" value="判分">
</form>
</div>
</div>
</body>
</html>
myCourse.html
<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
<meta charset="UTF-8">
<title>课程浏览</title>
<link type="text/css" rel="stylesheet" href="/css/browse.css">
</head>
<body>
<table>
<tr>
<th>课程编号</th>
<th>课程名称</th>
<th>已选课人数</th>
<th>课程限选人数</th>
<th>课程时间</th>
<th>课程教室</th>
<th>课程种类</th>
<th>操作</th>
</tr>
<tr th:each="i : ${courseList}">
<td th:text="${i.getCourseid()}"></td>
<td th:text="${i.getCoursename()}"></td>
<td th:text="${i.getCoursenumber()}"></td>
<td th:text="${i.getCourselimit()}"></td>
<td th:text="${i.getCourseday()+' '+i.getCoursetime()}"></td>
<td th:text="${i.getCourseroom()}"></td>
<td th:text="${i.getCoursekind()}"></td>
<td>
<a th:href="@{/teacher/myStudent(courseid=${i.getCourseid()})}" class="button myStudent" target="_blank">已选学生列表</a>
<a th:href="@{/teacher/browseHomework(courseid=${i.getCourseid()})}" class="button myHomework" target="_blank">课程作业</a>
<a th:href="@{/teacher/browseVideo(courseid=${i.getCourseid()})}" class="button myVideo" target="_blank">课程视频</a>
</td>
</tr>
</table>
</body>
</html>
myStudent.html
<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
<meta charset="UTF-8">
<title>浏览学生</title>
<script src="http://code.jquery.com/jquery-3.5.1.min.js"></script>
<link type="text/css" rel="stylesheet" href="/css/browse.css">
</head>
<body>
<table>
<tr>
<th>用户名</th>
<th>头像</th>
<th>姓名</th>
<th>性别</th>
<th>账号是否激活</th>
<th>成绩</th>
</tr>
<tr th:each="i: ${stuList}">
<td><a th:text="${i.getStuid()}" th:href="@{/manger/studentDetail(stuid=${i.getStuid()})}" target="_blank" class="Id"></a></td>
<td th:if="${stuImg.get(i.getStuid())}==null"><img src="/img/default.png"></td>
<td th:unless="${stuImg.get(i.getStuid())}==null"><img th:src="@{${stuImg.get(i.getStuid())}}"></td>
<td th:text="${i.getStuname()}"></td>
<td th:text="${i.getStusex()}"></td>
<td th:if="${i.getStustate()}">
<label class="switch">
<input type="checkbox" checked="checked" disabled>
<span class="slider"></span>
</label>
</td>
<td th:unless="${i.getStustate()}">
<label class="switch">
<input type="checkbox" disabled>
<span class="slider"></span>
</label>
</td>
<td th:if="${score.get(i.getStuid())}==null" >
<form th:action="@{/teacher/updateScore(stuid=${i.getStuid()},courseid=${courseid})}" method="post">
<input type="number" placeholder="暂无成绩" min="0" max="100" name="coursescore">
<button class="addTea" id="addTea" type="submit">点击登分</button>
</form>
</td>
<td th:unless="${score.get(i.getStuid())}==null" th:text="${score.get(i.getStuid())}"></td>
</tr>
</table>
</body>
</html>
teacherDetail.html
<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
<meta charset="UTF-8">
<title>个人信息</title>
<link type="text/css" rel="stylesheet" href="/css/detail.css">
</head>
<body>
<header>
<h1>老师信息</h1>
</header>
<table>
<tr>
<th>用户名</th>
<td th:text="${tea.getTeaid()}">张三</td>
</tr>
<tr>
<th>头像</th>
<td th:if="${Img}!=null"><img th:src="@{${Img}}" alt="头像" width="100" height="100"></td>
<td th:unless="${Img}!=null"><img src="/img/default.png" alt="头像" width="100" height="100"></td>
</tr>
<tr>
<th>姓名</th>
<td th:text="${tea.getTeaname()}">张三</td>
</tr>
<tr>
<th>性别</th>
<td th:text="${tea.getTeasex()}">男</td>
</tr>
<tr>
<th>民族</th>
<td th:text="${tea.getTearace()}">汉族</td>
</tr>
<tr>
<th>籍贯</th>
<td th:text="${tea.getTeaorigin()}">北京市</td>
</tr>
<tr>
<th>学院</th>
<td th:text="${tea.getTeacollege()}">信息科学与技术学院</td>
</tr>
<tr>
<th>职位</th>
<td th:text="${tea.getTeapost()}">教授</td>
</tr>
<tr>
<th>毕业学校</th>
<td th:text="${tea.getTeagraduation()}">清华大学</td>
</tr>
<tr>
<th>学历</th>
<td th:text="${tea.getTeadegree()}">博士</td>
</tr>
<tr>
<th>电话号码</th>
<td th:text="${tea.getTeaphone()}">1234567890</td>
</tr>
<tr>
<th>账号是否被激活</th>
<td class="active" th:if="${tea.getTeastate()}">是</td>
<td class="inactive" th:unless="${tea.getTeastate()}">否</td>
</tr>
</table>
</body>
</html>
teacherFunction.html
<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
<meta charset="UTF-8">
<title>教师功能</title>
<script src="http://code.jquery.com/jquery-3.5.1.min.js"></script>
<script type="text/javascript" src="/js/teacherFunction.js"></script>
<link type="text/css" rel="stylesheet" href="/css/function.css">
</head>
<body>
<div class="user-info">
<img th:if="${session.TeacherPersonImg==null}" src="/img/default.png" alt="头像">
<img th:unless="${session.TeacherPersonImg==null}" th:src="@{${session.TeacherPersonImg}}" alt="头像">
<span class="user-name" th:text="${session.TeacherPerson.getTeaid()}">张三</span>
</div>
<header style="text-align: center">
<h1>老师功能页面</h1>
</header>
<aside>
<span style="font-size:30px; cursor:pointer" id="openbtn">☰ 主菜单</span>
<div id="mySidenav" class="sidenav">
<a href="javascript:void(0)" id="closebtn">×</a>
<a href="#" id="a1">修改密码</a>
<a href="#" id="a2">个人信息</a>
<a href="#" id="a3">所授课程</a>
<a href="#" id="a4">退出系统</a>
</div>
</aside>
<section style="text-align: center">
<iframe id="content" src="/weclome"></iframe>
</section>
</body>
</html>
teacherRegister.html
<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
<meta charset="UTF-8">
<title>老师注册页面</title>
<script src="http://code.jquery.com/jquery-3.5.1.min.js"></script>
<script src="/js/teaRegister.js"></script>
<link type="text/css" rel="stylesheet" href="/css/register.css"/>
</head>
<body>
<form action="/teacher/register" method="post" id="myForm" enctype="multipart/form-data">
<label>
用户名
<input type="text" name="teaid">
</label>
<label>
密码
<input type="password" name="teapwd">
</label>
<label>
姓名
<input type="text" name="teaname">
</label>
<label>
性别
<input type="radio" name="teasex" value="男">男
<input type="radio" name="teasex" value="女">女
</label>
<label>
民族
<input type="text" name="tearace">
</label>
<label>
籍贯
<input type="text" name="teaorigin">
</label>
<label>
学院
<select name="teacollege">
<option value="无">学院</option>
<option value="信息科学与技术学院">信息科学与技术学院</option>
<option value="机械工程学院">机械工程学院</option>
</select>
</label>
<label>
职位
<select name="teapost">
<option value="无">职位</option>
<option value="院长">院长</option>
<option value="副院长">副院长</option>
<option value="教授">教授</option>
<option value="副教授">副教授</option>
<option value="讲师">讲师</option>
<option value="助教">助教</option>
</select>
</label>
<label>
毕业学校
<input type="text" name="teagraduation">
</label>
<label>
学历
<select name="teadegree">
<option value="无">学历</option>
<option value="博士后">博士后</option>
<option value="博士">博士</option>
<option value="研究生">研究生</option>
<option value="本科">本科</option>
</select>
</label>
<label>
电话号码
<input type="text" name="teaphone" id="phone">
</label>
<label>
验证码
<input type="text" id="flag" required="required">
</label>
<input type="button" id="getflag" value="点击获取验证码" style="background-color: #00f7ff;width: 50%">
<label>
上传头像
<input type="file" name="photo" id="teaphoto" style="border: none">
</label>
<input type="submit" value="注册">
</form>
</body>
</html>
videoDetail.html
<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
<meta charset="UTF-8">
<title>教学视频</title>
<script src="http://code.jquery.com/jquery-3.5.1.min.js"></script>
<link type="text/css" rel="stylesheet" href="/css/videodetail.css">
</head>
<body>
<header><h1 th:text="${video.getVideoname()}">视频标题</h1></header>
<section>
<div>
<span th:text="${video.getVideotime()}" id="span">时间</span>
<p th:text="${video.getVideointroducation()}">视频简介</p>
</div>
</section>
</body>
</html>
<script>
$(document).ready(function () {
$("#v").insertBefore($("#span"))
})
</script>