本文仅限内部人员使用,无实际参考价值。
【电脑分辨率1080,浏览器用微软自带Microsoft edge进行测试】
一、搭配环境
1.采用AppServ:Apache + PHP + MySQL集成环境进行编程,下载地址:
2.下载完之后,双击进行安装,端口号那里记一下,我的设置为81(默认80),然后是MySQL的登录密码,这里设置Lzy942056,一直next,完成安装。
3.下面测试是否搭建成功:在浏览器中输入:
4.下面将我给你的MicroCourseware文件夹(需解压)放入你安装的Appserv目录下的www文件夹下,我的界面是这样:
二、运行
5.下面运行软件
在浏览器中输入地址:
http://localhost:81/MicroCourseware/index.html
显示界面如下:
6.由于没有数据库的.sql文件,无法学生登录或者教师登录,现在打开浏览器地址:
进入集成环境的Mysql界面,账号是root,密码是Lzy942056
进入之后,先在左侧新建一个数据库,名字为mydb,排序规则为utf8_general_ci,创建之后,点击菜单栏的导入,将我给你的.sql.zip导入即可
导入之后,左侧导航栏会有下面信息:
一共8张表
7.现在大功告成,我们开始玩耍
先注意几个问题:
1)学生可以注册也可以登录
2)管理员和教师只能后台登录,也就是不可以注册,账号和密码在数据库里已经分配好了
还是第5步的界面,先来测试学生登录和注册功能,我已经注册了我自己的账号,你们也可以直接登录,账号和密码信息在数据库mysql的student表里:
user_id和user_password就是账号和密码,这里都是143401010310,你们自己注册也可以
教师和管理员的账号也可以打开teacher和admin表,看账号和密码,你们自己也可以修改和插入等等
8.其他的功能就自己看论文,注意上传的视频不要太大,是微视频,我记得后台虽然没设置上传上限,但视频大了之后,加载会变慢,就这样啦
【补充】
bug修复日志:
——2019-4-16-22:55
学生登录之后:
1.收藏的视频删除不了
2.观看视频界面无法评论和无法做笔记
解决办法:修改 /MicroCourseware/Controllers 里的CommentNote.class.php的部分代码更替为下面:
$courseid = $_POST['commentsubmit']; //提交评论
if($courseid != NULL){
$userid = $_COOKIE['userid'];
//$comment = request.getParameter("comment");
$comment = $_POST['comment'];
$a1 = new CommentNote();
$a1->Comment($userid,$courseid,$comment);
}
$course_id = $_POST['notesubmit']; //添加笔记
if($course_id != NUll){
$identity = $_POST['identity'];
$userid = $_COOKIE['userid'];
//$note_content = request.getParameter("note_content");
$note_content = $_POST['note_content'];
$a2 = new CommentNote();
$a2->Note($userid,$course_id,$note_content,$identity);
}
$identity = $_GET['identity']; //依据“全部可见”和“只有我见”查找笔记
if($identity){
$course_id = $_GET['courseid'];
$a3 = new CommentNote();
$a3->SeeNote($course_id,$identity);
}
$course_name = $_GET['course_name']; //收藏视频
if($course_name){
$course_id = $_GET['course_id'];
$a4 = new CommentNote();
$a4->Collect($course_id,$course_name);
}
$id = $_GET['id']; //删除收藏
if($id != NULL){
$a5 = new CommentNote();
$a5->DeleteCollect($id);
}
$time = $_GET['time']; //按时间前后搜索笔记
if($time){
$a6 = new CommentNote();
$a6->SearchNote($time);
}
$type = $_GET['type'];
if($type == "1"){ //删除笔记
$note_time = $_GET['notetime'];
$a7 = new CommentNote();
$a7->DeleteNote($type,$note_time);
}
else if($type == "2"){ //编辑笔记
$note_time = $_GET['note_time'];
$a8 = new CommentNote();
$a8->EditNote($note_time);
}
$score = $_POST['scoresubmit'];
if($score){
$course_id = $_GET['course_id'];
$a9 = new CommentNote();
$a9->Score($score,$course_id);
}
$comment_time = $_GET['comment_time'];
if($comment_time){
$course_id = $_GET['course_id'];
$a10 = new CommentNote();
$a10->DeleteComment($comment_time,$course_id);
}
$time = $_POST['editnote'];
if($time){ //确定修改笔记
$notecontent = $_POST['notecontent'];
$a11 = new CommentNote();
$a11->ReviseNote($time,$notecontent);
}
2019-4-16-23:05
(1)修复评论和笔记之后头像不显示问题
(2)修复评论中的删除无法显示(一个小垃圾桶标志)
解决办法:将数据库的comment和note表的user_id字段长度改为12(原来是11),导致无法访问到学号获取头像。
2019-4-17-11:50
修复学生登录学号必须12位的限制:
解决办法:将/MicroCourseware/Models/UserModel.class.php中的代码修改如下:
也就是那个if语句注释或删除即可。
<?php
error_reporting(E_ALL^E_NOTICE^E_WARNING); //去除警告提示
class UserModel{
function Login($userid,$password){
// if(strlen($userid) < 12){
// echo "<script>alert('学号长度少于12位!'); history.go(-1);</script>";
// }
if(!is_numeric($userid)) {
echo "<script>alert('学号必须为纯数字!'); history.go(-1);</script>";
}
if($userid == ""||$userid=='学号') //判断学号
{
//若学号为空,则弹出对话框,确定后返回当前页的上一页
echo "<script>alert('学号不能为空!'); history.go(-1);</script>";
}
.....