1 Star 0 Fork 0

SOTS技术/学校题库二维码

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
subjects.html 16.92 KB
一键复制 编辑 原始数据 按行查看 历史
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664
<<<<<<< HEAD
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0,user-scalable=no"/>
<title>
学习二十大,奋进新征程
</title>
<link rel="stylesheet" href="./css/subject1.css">
<link rel="stylesheet" href="./css/subject2.css">
<script src="./lib/jquery-1.10.2.js"></script>
<script src="./dist/dialog.js?skin=blue"></script>
<script src="./js/function.js"></script>
<script src="./dist/template-web.js"></script>
<script>
function set_div_choices(){
$(".subject_choices").on("click",function(){
//切换颜色特效
if($(this).children("input").is(':checked')){
$(this).css("background-color","rgba(255, 255, 255, 0.3)")
$(this).children("input").prop('checked', false)
}else{
$(this).css("background-color","#AE33CC")
$(this).children("input").prop('checked', true)
}
});
}
</script>
</head>
<body id="body">
<div class="logo">
<img src="./image/logo.png" alt="">
</div>
<div class="module">
<div class="module_top">
<div class="theme_2">
<img src="./image/z.png" alt="">
</div>
<div class="progress">
<div class="ring">
<canvas id="tutorial" width="100%" height="100%"></canvas>
</div>
</div>
</div>
<!----------模板------------------>
<div id="tmp_div"></div>
<!----------模板------------------>
<div class="button" id="answer">
<p><a id="answer_text">开始作答</a></p>
</div>
<div class="button_restart" id="button_histroy">
<a>历史记录</a>
</div>
</div>
<div class="bottom">
<img src="./image/z5.png" alt="">
</div>
<!--模板-->
<script type="text/html" id="tmp_subject">
<div class="modal" id="s_{{sid}}" value={{sid}}>
<div class="group_1">
<span class="subject">{{content}}</span>
</div>
<div class="group_2" >
{{each choices choice index}}
<div class="subject_choices">
<input type="checkbox" value="{{choice.cid}}" id="s_{{sid}}_{{choice.cid}}"">
<label for="s_{{sid}}_{{choice.cid}}""><span>{{choice.ccontent}}</span></label>
</div>
{{/each}}
</div>
</div>
</script>
<script>
//加载数据模板
/*
*/
let sid=getCookie("sid1");
let subject1={
sid:1,
content:"1.题目已隐藏,请点击开始作答以查看。",
type:1
}
let subject2={
content:"2.题目已隐藏,请点击开始作答以查看。",
sid:2,
type:1
}
let module=$("#tmp_div");
let a=template("tmp_subject",subject1)
let b=template("tmp_subject",subject2)
module.html(a+b)
//隐藏
$(".group_2").css("display","none")
//收集答案函数,传递class
var canvas = document.getElementById('tutorial');
var ctx = canvas.getContext('2d');
set_progress_bar(ctx,100, canvas.width, canvas.height,{
color:"#1890ff",
text:"30s",
is_clear:true
});
//维持持久会话
let tan_id = parseInt(getCookie("tan_id"));
if(isNaN(tan_id)){
tan_id=parseInt(GetQueryString("tan_id"))
}
let e = document.getElementById("body");
set_background(e, parseInt(tan_id));
if (GetQueryString("tan_id") == "") {
window.location.href = "./subjects.html" + "?tan_id=" + tan_id;
}
var subs=null;
//缓存加载题目
//post请求
let data={
tanhao:tan_id
}
//加载题目
ajax_subject_get(data,function(res){
//写入题目
if(res.state==200){
subs=res;
//缓存答案
setCookie("a1",subs["date"]["1"]["daan"],7)
setCookie("a2",subs["date"]["2"]["daan"],7)
}
if(res.state==201){
setCookie("sid1","sots",7)
$("#button_histroy").css("display","flex")
$("#button_histroy").on("click",function(){
window.location.href="./histroy.html?tan_id="+tan_id
})
}
})
//绑定按钮事件
$("#answer").on("click", function() {
if(subs==null){
if(sid && sid!="" && sid!="null"){
dialog({
title: '消息',
content: '检测到你好像已经答过题目,现在你可以点击查看历史答题记录',
okValue: '查看历史记录',
ok: function() {
window.location.href="./histroy.html?tan_id"+tan_id
},
cancelValue: '取消',
cancel: function() {
}
}).show()
}else{
dlog("提示","题目缓存失败或你已经答过本题,请刷新下!")
}
}else{
if($("#answer_text").text()=="开始作答"){
var d = dialog({
title: '消息',
content: '1.点击"确定"将显示题目并进行30s倒数计时,你需要在30s内回答完这些题目<br>2.答题过程中不要离开本界面,切换后台后计时依然存在<br>3.超过答题时间会自动提交答案<br>4.遇到任何问题可以联系工作人员<br>5.SOTS团队祝各位答题顺利',
okValue: '确 定',
ok: function() {
$("#answer_text").text("提交答案");
//显示题目
$(".group_2").css("display","flex");
//绑定题目数据
subject1.sid=subs["date"]["1"]["id"]
subject1.content="1."+subs["date"]["1"]["wenti"]
//
subject1.choices=[]
subject2.choices=[]
if(subs["date"]["1"]["aq"] && subs["date"]["1"]["aq"]!="null"){
subject1.choices.push({cid:"a",ccontent:"A."+subs["date"]["1"]["aq"]});
}
if(subs["date"]["1"]["bq"] && subs["date"]["1"]["bq"]!="null"){
subject1.choices.push({cid:"b",ccontent:"B."+subs["date"]["1"]["bq"]});
}
if(subs["date"]["1"]["cq"] && subs["date"]["1"]["cq"]!="null"){
subject1.choices.push({cid:"c",ccontent:"C."+subs["date"]["1"]["cq"]});
}
if(subs["date"]["1"]["dq"] && subs["date"]["1"]["dq"]!="null"){
subject1.choices.push({cid:"d",ccontent:"D."+subs["date"]["1"]["dq"]});
}
subject2.sid=subs["date"]["2"]["id"]
subject2.content="2."+subs["date"]["2"]["wenti"]
subject2.choices=[]
if(subs["date"]["2"]["aq"] && subs["date"]["2"]["aq"]!="null"){
subject2.choices.push({cid:"a",ccontent:"A."+subs["date"]["2"]["aq"]});
}
if(subs["date"]["2"]["bq"] && subs["date"]["2"]["bq"]!="null"){
subject2.choices.push({cid:"b",ccontent:"B."+subs["date"]["2"]["bq"]});
}
if(subs["date"]["2"]["cq"] && subs["date"]["2"]["cq"]!="null"){
subject2.choices.push({cid:"c",ccontent:"C."+subs["date"]["2"]["cq"]});
}
if(subs["date"]["2"]["dq"] && subs["date"]["2"]["dq"]!="null"){
subject2.choices.push({cid:"d",ccontent:"D."+subs["date"]["2"]["dq"]});
}
a=template("tmp_subject",subject1)
b=template("tmp_subject",subject2)
module.html(a+b)
//设置监听事件
set_div_choices()
//启动定时
//每隔1s更新时间
let t=100;
var run=function(){
t=t-1;
set_progress_bar(ctx, t, canvas.width, canvas.height,{
color:"#1890ff",
text:Math.ceil(t*0.3)+"s",
is_clear:true,
});
}
var end=function(){
set_progress_bar(ctx, parseInt(t/300), canvas.width, canvas.height,{
color:"red",
text:"结束",
text_color:"red",
is_clear:true,
});
//弹出提示
dlog("提示","时间到,已自动提交答案!")
//提交答案
$("#answer_text").text("开始作答");
submit_answer(tan_id)
}
timer(31*1000,300,run,end)
},
cancelValue: '取消',
cancel: function() {}
});
d.show();
}else{
var d = dialog({
title: '消息',
content: '你希望现在就提交答案吗?',
okValue: '确 定',
ok: function() {
//提交答案
submit_answer(tan_id)
},
cancelValue: '取消',
cancel: function() {}
});
d.show();
}
}
});
</script>
</body>
=======
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0,user-scalable=no"/>
<title>
学习二十大,奋进新征程
</title>
<link rel="stylesheet" href="./css/subject1.css">
<link rel="stylesheet" href="./css/subject2.css">
<script src="./lib/jquery-1.10.2.js"></script>
<script src="./dist/dialog.js?skin=blue"></script>
<script src="./js/function.js"></script>
<script src="./dist/template-web.js"></script>
<script>
function set_div_choices(){
$(".subject_choices").on("click",function(){
//切换颜色特效
if($(this).children("input").is(':checked')){
$(this).css("background-color","rgba(255, 255, 255, 0.3)")
$(this).children("input").prop('checked', false)
}else{
$(this).css("background-color","#AE33CC")
$(this).children("input").prop('checked', true)
}
});
}
</script>
</head>
<body id="body">
<div class="logo">
<img src="./image/logo.png" alt="">
</div>
<div class="module">
<div class="module_top">
<div class="theme_2">
<img src="./image/z.png" alt="">
</div>
<div class="progress">
<div class="ring">
<canvas id="tutorial" width="100%" height="100%"></canvas>
</div>
</div>
</div>
<!----------模板------------------>
<div id="tmp_div"></div>
<!----------模板------------------>
<div class="button" id="answer">
<p><a id="answer_text">开始作答</a></p>
</div>
<div class="button_restart" id="button_histroy">
<a>历史记录</a>
</div>
</div>
<div class="bottom">
<img src="./image/z5.png" alt="">
</div>
<!--模板-->
<script type="text/html" id="tmp_subject">
<div class="modal" id="s_{{sid}}" value={{sid}}>
<div class="group_1">
<span class="subject">{{content}}</span>
</div>
<div class="group_2" >
{{each choices choice index}}
<div class="subject_choices">
<input type="checkbox" value="{{choice.cid}}" id="s_{{sid}}_{{choice.cid}}"">
<label for="s_{{sid}}_{{choice.cid}}""><span>{{choice.ccontent}}</span></label>
</div>
{{/each}}
</div>
</div>
</script>
<script>
//加载数据模板
/*
*/
let sid=getCookie("sid1");
let subject1={
sid:1,
content:"1.题目已隐藏,请点击开始作答以查看。",
type:1
}
let subject2={
content:"2.题目已隐藏,请点击开始作答以查看。",
sid:2,
type:1
}
let module=$("#tmp_div");
let a=template("tmp_subject",subject1)
let b=template("tmp_subject",subject2)
module.html(a+b)
//隐藏
$(".group_2").css("display","none")
//收集答案函数,传递class
var canvas = document.getElementById('tutorial');
var ctx = canvas.getContext('2d');
set_progress_bar(ctx,100, canvas.width, canvas.height,{
color:"#1890ff",
text:"30s",
is_clear:true
});
//维持持久会话
let tan_id = parseInt(getCookie("tan_id"));
if(isNaN(tan_id)){
tan_id=parseInt(GetQueryString("tan_id"))
}
let e = document.getElementById("body");
set_background(e, parseInt(tan_id));
if (GetQueryString("tan_id") == "") {
window.location.href = "./subjects.html" + "?tan_id=" + tan_id;
}
var subs=null;
//缓存加载题目
//post请求
let data={
tanhao:tan_id
}
//加载题目
ajax_subject_get(data,function(res){
//写入题目
if(res.state==200){
subs=res;
//缓存答案
setCookie("a1",subs["date"]["1"]["daan"],7)
setCookie("a2",subs["date"]["2"]["daan"],7)
}
if(res.state==201){
setCookie("sid1","sots",7)
$("#button_histroy").css("display","flex")
$("#button_histroy").on("click",function(){
window.location.href="./histroy.html?tan_id="+tan_id
})
}
})
//绑定按钮事件
$("#answer").on("click", function() {
if(subs==null){
if(sid && sid!="" && sid!="null"){
dialog({
title: '消息',
content: '检测到你好像已经答过题目,现在你可以点击查看历史答题记录',
okValue: '查看历史记录',
ok: function() {
window.location.href="./histroy.html?tan_id"+tan_id
},
cancelValue: '取消',
cancel: function() {
}
}).show()
}else{
dlog("提示","题目缓存失败或你已经答过本题,请刷新下!")
}
}else{
if($("#answer_text").text()=="开始作答"){
var d = dialog({
title: '消息',
content: '1.点击"确定"将显示题目并进行30s倒数计时,你需要在30s内回答完这些题目<br>2.答题过程中不要离开本界面,切换后台后计时依然存在<br>3.超过答题时间会自动提交答案<br>4.遇到任何问题可以联系工作人员<br>5.SOTS团队祝各位答题顺利',
okValue: '确 定',
ok: function() {
$("#answer_text").text("提交答案");
//显示题目
$(".group_2").css("display","flex");
//绑定题目数据
subject1.sid=subs["date"]["1"]["id"]
subject1.content="1."+subs["date"]["1"]["wenti"]
//
subject1.choices=[]
subject2.choices=[]
if(subs["date"]["1"]["aq"] && subs["date"]["1"]["aq"]!="null"){
subject1.choices.push({cid:"a",ccontent:"A."+subs["date"]["1"]["aq"]});
}
if(subs["date"]["1"]["bq"] && subs["date"]["1"]["bq"]!="null"){
subject1.choices.push({cid:"b",ccontent:"B."+subs["date"]["1"]["bq"]});
}
if(subs["date"]["1"]["cq"] && subs["date"]["1"]["cq"]!="null"){
subject1.choices.push({cid:"c",ccontent:"C."+subs["date"]["1"]["cq"]});
}
if(subs["date"]["1"]["dq"] && subs["date"]["1"]["dq"]!="null"){
subject1.choices.push({cid:"d",ccontent:"D."+subs["date"]["1"]["dq"]});
}
subject2.sid=subs["date"]["2"]["id"]
subject2.content="2."+subs["date"]["2"]["wenti"]
subject2.choices=[]
if(subs["date"]["2"]["aq"] && subs["date"]["2"]["aq"]!="null"){
subject2.choices.push({cid:"a",ccontent:"A."+subs["date"]["2"]["aq"]});
}
if(subs["date"]["2"]["bq"] && subs["date"]["2"]["bq"]!="null"){
subject2.choices.push({cid:"b",ccontent:"B."+subs["date"]["2"]["bq"]});
}
if(subs["date"]["2"]["cq"] && subs["date"]["2"]["cq"]!="null"){
subject2.choices.push({cid:"c",ccontent:"C."+subs["date"]["2"]["cq"]});
}
if(subs["date"]["2"]["dq"] && subs["date"]["2"]["dq"]!="null"){
subject2.choices.push({cid:"d",ccontent:"D."+subs["date"]["2"]["dq"]});
}
a=template("tmp_subject",subject1)
b=template("tmp_subject",subject2)
module.html(a+b)
//设置监听事件
set_div_choices()
//启动定时
//每隔1s更新时间
let t=100;
var run=function(){
t=t-1;
set_progress_bar(ctx, t, canvas.width, canvas.height,{
color:"#1890ff",
text:Math.ceil(t*0.3)+"s",
is_clear:true,
});
}
var end=function(){
set_progress_bar(ctx, parseInt(t/300), canvas.width, canvas.height,{
color:"red",
text:"结束",
text_color:"red",
is_clear:true,
});
//弹出提示
dlog("提示","时间到,已自动提交答案!")
//提交答案
$("#answer_text").text("开始作答");
submit_answer(tan_id)
}
timer(31*1000,300,run,end)
},
cancelValue: '取消',
cancel: function() {}
});
d.show();
}else{
var d = dialog({
title: '消息',
content: '你希望现在就提交答案吗?',
okValue: '确 定',
ok: function() {
//提交答案
submit_answer(tan_id)
},
cancelValue: '取消',
cancel: function() {}
});
d.show();
}
}
});
</script>
</body>
>>>>>>> d2ef1be (初始化仓库)
</html>
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/sots-technology/school-question-bank-qr-code.git
git@gitee.com:sots-technology/school-question-bank-qr-code.git
sots-technology
school-question-bank-qr-code
学校题库二维码
master

搜索帮助