20190320 文本查重系统(二)
(一)展示了html页面,(二)给出html页面代码,用的是jinjia语言
代码总体框架为
commit.html
<html>
<head>
<title>提交页面</title>
</head>
<body>
<div style="margin:100px auto;width:1200px">
<form action="/regcommit/", method="post">
<h>Guten Tag, {{current_user.username}}, Wie geht's ihrn?</h><br>
<h>
{% if (msg|length) > 0 %}
<b>
<font color="#FF0000">{{msg}}</font>
</b>
{% else %}
<b>欢迎登录查重系统</b>
{% endif %}
</h><br>
<h>本系统只支持编码UTF-8</h><br>
<h>请只上传文档的文字部分,拒绝图表&&公式</h><br>
<h><span style="color:royalblue"><b>如果您上传word文档,请尽可能上传以.docx结尾的word文档</b></span></h><br>
<h>标题</h><br>
<!--<input type="text"name="title" style="width:1000px; height:40px" placeholder="请输入文章标题:"><br>-->
<textarea name="title" rows="2" cols="140" placeholder="请输入文章标题:"></textarea><br>
<h>摘要</h><br>
<!--<input type='text' name="abstract"style="width:1000px; height:100px"placeholder="请输入文章摘要:"><br>-->
<textarea name="abstract" rows="10" cols="140" placeholder="请输入文章摘要:"></textarea><br>
<h>正文</h><br>
<!--<input type="text"name="contents"style="width:1000px; height:500px"placeholder="请输入文章内容:"><br>-->
<textarea name="contents" rows="30" cols="140" placeholder="请输入文章内容:"></textarea><br>
<input type="submit"value="提交">
</form>
<form action="/logout/"><input type="submit"value="退出登录"></form>
<form action="/upload/"><input type="submit"value="上传文件"></form>
</div>
</body>
</html>
detect.html
<html>
<head><title>查重结果</title>
</head>
<body>
{%set countindex = 1 %}
<div id="c" style="float: left">
<div id="a" style="float:left;height:50px;width:900px">
<form>
<h><b><span style="color: lightslategrey">Title : {{node.title2}}</span></b></h><br>
<h><b><span style="color: darkslategray ">Student : {{node.username2}}</span></b></h><br>
{%for j in range(content2_np|length)%}
{% if j in content_np2%}
<h><b><span style="color: red">{{content2_np[j]}}</span></b></h>
{% else %}
<h>{{content2_np[j]}}</h>
{%endif%}
{% endfor %}
</form>
</div>
<div id="b" style="float:left;height:50px;width:900px">
<form>
<h><b><span style="color: lightslategrey">Title : {{node.title1}}</span></b></h><br>
<h><b><span style="color: darkslategray">Student : {{node.username1}}</span></b></h><br>
{%for i in range(content1_np|length)%}
{% if i in content_np1%}
<b><span style="color: red">{{content1_np[i]}}</span></b>
{% else %}
{{content1_np[i]}}
{%endif%}
{% endfor %}
<h><b>{{node.title1}}与{{node.title2}}的相似度为<span style="color:palevioletred">{{node.id}}</span>,大于设置的阈值 </b></h>
</form>
</div>
<div style="clear:both"></div>
<form action="/logout/"><input type="submit"value="退出登录"></form>
</div>
</body>
</html>
index.html
<html>
<head>
<title>查重首页</title>
</head>
<body>
<div style="margin:300px auto;width:300px">
<h><b><span style="color:deepskyblue">Gute Abend. Ich bin Studentin</span> </b></h>
<form action="/login/"><input type="submit"value="学生登录"></form>
<form action="/login/"><input type="submit"value="教师登录"></form>
<form action="/text/page/1"><input type="submit"value="text"></form>
</div>
</body>
</html>
login.html
<!DOCTYPE html >
<html>
<head>
<title>查重登陆系统</title>
</head>
<body>
<div style="margin:300px auto;width:300px">
<!--action = "/commit"里面是要访问登陆页面的链接-->
<form action="/reglogin/", method="post">
<h>
{% if (msg|length) > 0 %}
<b>
<font color="#FF0000">{{msg}}</font>
</b>
{% else %}
<b>欢迎登录查重系统</b>
{% endif %}
</h><br>
<h>用户名</h><br>
<input type="text"name="username"placeholder="请输入用户名"><br>
<h>密码</h><br>
<input type="password"name="password"placeholder="请输入密码"><br>
<input type="submit"value="登陆">
</form>
<form action="/reset/"><input type="submit"value="忘记密码"></form>
</div>
</body>
</html>
profile.html
<html>
<head>
<title>个人主页</title>
</head>
<body>
<div style="margin:300px auto;width:300px">
<h>username : {{user.username}}</h><br>
<h>head_url : {{user.head_url}}</h><br>
<h>text_url : {{text.url}}</h><br>
<h>created_date : {{text.created_date}}</h>
</div>
</body>
</html>
reset.html(这个暂时没用,是用来重置密码的)
result.html
<html>
<head>
<title>
查重结果
</title>
</head>
<body>
<div style="margin:300px auto;width:600px">
<form>
{% if status == 0 %}
<h><span style="color:green">所有学生的作业均交齐</span></h><br>
{% else %}
<h><b>以下是未交作业学生名单:</b></h><br>
{% for name in rest_names %}
<h><b>学生<span style="color:red">{{name}}</span></b></h>
{% endfor %}
{% endif %}<br>
<h><b><span style="color:blue">查重结果如下:</span></b></h><br>
<h>
{% for node in nodes %}
{%if index<0 %}
<h><b><span style="color:green">所有学生作业均通过查重检测</span></b></h>
{% else %}
<h><b>学生<span style="color:red">{{node.username1}}</span>的作业<span style="color:darkblue">{{node.title1}}</span>与学生<span style="color:red">{{node.username2}}</span>的作业<span style="color:darkblue">{{node.title2}}</span>作业重复</b></h>
<a href="/detect/{{node.id}}" class="avatar">
<h><span style="color:cadetblue">查看详情</span> </h><br>
</a>
{% endif %}
{% endfor %}
</h>
</form>
<form action="/logout/"><input type="submit"value="退出登录"></form>
</div>
</body>
</html>
sucess.html
<html>
<head><title>查重结果</title></head>
<body>
<div style="margin:300px auto;width:300px">
<form>
<h><b>作业提交成功, 您已经完成本课程的60%</b></h>
<h><b><span style="color:darkred">{{title_1}}</span></b>的查重结果如下: </h><br>
{% if boolean_value == 0 %}
<h><span style="color:green">没有查出重复的作业</span> </h>
{% else %}
<h>与作业库中<span style="color:red">{{title_2}}</span>的相似率最高:<span style="color:red">{{sim_cos}}</span> </h>
{% endif %}
</form>
<form action="/logout/"><input type="submit"value="退出登录"></form>
</div>
</body>
</html>
upload.html
<html>
<head>
<title>上传系统</title>
</head>
<body>
<div style="margin:300px auto;width:300px">
<form method="post" action="/reupload/" enctype="multipart/form-data">
<h>Guten Tag, {{current_user.username}}, Wie geht's ihrn?</h><br>
<h>
{% if (msg|length) > 0 %}
<b>
<font color="#FF0000">{{msg}}</font>
</b>
{% else %}
<b>欢迎登录查重系统</b>
{% endif %}
</h><br>
<h><span style="color:royalblue"><b>如果您上传word文档,请尽可能上传以.docx结尾的word文档</b></span></h><br>
<input type="file" name="file">
<input type="submit" value="上传文件">
</form>
</div>
</body>
</html>
最近很忙,不定期更新ing。。。。。。