代码拉取完成,页面将自动刷新
<<<<<<< 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>
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。