xjc 2 years ago
parent
commit
8579659f7c
6 changed files with 751 additions and 664 deletions
  1. 76 0
      fail.html
  2. 3 3
      index.html
  3. 0 282
      js/game - .js
  4. 411 0
      js/game - 副本.js
  5. 246 326
      js/game.js
  6. 15 53
      question.json

+ 76 - 0
fail.html

@@ -0,0 +1,76 @@
+<!DOCTYPE html>
+<html>
+	<head>
+		<meta charset="utf-8">
+		<title></title>
+		<style>
+			html,
+			body,
+			h1,
+			h2,
+			h3,
+			h4,
+			h5,
+			h6,
+			p,
+			ul,
+			li,
+			div,
+			section {
+				padding: 0;
+				margin: 0;
+			}
+			
+			html,
+			body {
+				width: 100%;
+				height: 100%;
+				font-family: "微软雅黑";
+			}
+			
+			.full {
+				position: fixed;
+				top: 0;
+				left: 0;
+				bottom: 0;
+				right: 0;
+			}
+			
+			.end-box {
+				background: rgba(0, 0, 0, 0.8);
+			}
+			
+			.end-box:before {
+				content: "";
+				position: absolute;
+				top: 20vh;
+				left: 10vw;
+				width: 80vw;
+				height: 5vh;
+				background: url(../img/qus-top.png) no-repeat center top;
+				background-size: auto 5vh;
+			}
+			
+			.end {
+				margin: 25vh auto 0;
+				background-color: #fede82;
+				height: 60vw;
+				width: 80vw;
+				border-radius: 5vw;
+				box-sizing: border-box;
+				padding: 20vw 5px;
+				line-height: 10vw;
+				font-size: 6vw;
+				text-align: center;
+				color: #FF5216;
+				font-weight: bold;
+			}
+			
+		</style>
+	</head>
+	<body>
+		<section class="end-box full" id="endBox">
+			<div class="end" id="fail">很遗憾<br/>你的答题之旅结束了!!!</div>
+		</section>
+	</body>
+</html>

+ 3 - 3
index.html

@@ -35,7 +35,7 @@
 			</section>
 			<section class="full" id="go">
 				<!-- 倒计时 -->
-				<section class="time"><span id="countDown">15</span></section>
+				<section class="time"><span id="countDown">30</span></section>
 				<!-- 问题框 -->
 				<section class="question-box">
 					<div class="question" id="ques"></div>
@@ -44,8 +44,8 @@
 				<!-- 答题框 -->
 				<section class="answer-box" id="ansBox">
 					<div class="ans ans-1" data-id="0">A</div>
-					<div class="ans ans-2" data-id="1">B</div>
-					<div class="ans ans-3" data-id="2">C</div>
+					<!-- <div class="ans ans-2" data-id="1">B</div> -->
+					<div class="ans ans-3" data-id="2">B</div>
 				</section>
 			</section>
 			<!-- <section class="ren-box" id="renBox">

+ 0 - 282
js/game - .js

@@ -1,282 +0,0 @@
-let $box = $("#figureBox"),
-	people = 0;
-let me = {
-	$id: null,
-	row: Math.floor(Math.random() * 3),
-	col: Math.floor(Math.random() * 15),
-	num: 0,
-
-}
-var arr = [
-	[],
-	[],
-	[]
-];
-var ans = [10, 200, 100];
-// 开始答题
-let $go = $("#go"),
-	$countDown = $("#countDown"),
-	$ques = $("#ques"),
-	$trap = $("#trapID"),
-	$num = $("#num"),
-	$renBox = $("#renBox");
-let quesData, quesLen, quesFlag = 0,
-	quesHtml, quesTimer, quesInter, quesCount = 2;
-$.get("./question.json", function(res) {
-	quesData = res.ques;
-	quesLen = quesData.length;
-});
-
-// 答题
-var $fail = $("#fail"),
-	$success = $("#success"),
-	$endBox = $("#endBox");
-
-var nowAns = -1;
-var baseUrl="http://47.108.130.28:9000";
-var ansPostUrl=baseUrl+"/api/quepass/ansPost";
-var wsCountUrl=baseUrl+"/ws/quepass/onlinecounter";
-function init() {
-	for (var i = 0; i < 3; i++) {
-		figureInit(ans[i], i);
-	}
-	me.$id=$("#ren"+me.num);
-	let timer = setTimeout(function() {
-		clearTimeout(timer);
-		for (let i = 0; i < 3; i++) {
-			var l = arr[i].length;
-			for (let j = 0; j < l; j++) {
-				var delay = arr[i][j].col * 100 + "ms";
-				getIn(arr[i][j], delay);
-			}
-		}
-	}, 100);
-
-	setTimeout(startQues, 3000);
-}
-
-function getIn(obj, delay) {
-	if (obj.$id) {
-		var $ren = obj.$id;
-	} else {
-		var $ren = $("#ren" + obj.num);
-		obj.$id = $ren;
-	}
-
-	$ren[0].className = obj.figure + " d" + obj.row + "-" + obj.col;
-	$ren.attr("style", "");
-	if (delay) {
-		$ren.css("transition-delay", delay);
-	}
-}
-
-function figureInit(num, flag) {
-	let html = "",
-		figure = "";
-	if (num > 36) num = 36;
-	for (let i = 0; i < num; i++) {
-		var left = Math.floor(Math.random() * 140) - 20 + "vw";
-		figure = "figure f" + Math.floor(Math.random() * 20 + 1);
-		html += `<div class="${figure}" id="ren${people+i}" style="left:${left}"></div>`;
-		arr[flag].push({
-			row: flag,
-			col: i,
-			figure,
-			num: people + i
-		});
-		if (flag == me.row && i == me.col) {
-			me.figure = figure + ` me`;
-			me.num = people + i;
-			arr[flag][i].figure+=" me";
-		}
-	}
-	people += num;
-	$box.append(html);
-}
-
-/* function answer(a1, a2, a3) {
-	if(a1>36) a1=36;
-	if(a2>36) a2=36;
-	a3=a3>36?36:a3;
-	arr[1] = Array(a1);
-	arr[2] = Array(a2);
-	arr[3]= Array(a3);
-	getAnswer(a1, arr[1], 0);
-	getAnswer(a2, arr[2], 1);
-	getAnswer(a3, arr[3], 2);
-	peopleArr = peopleArr.concat(arr[1], arr[2], arr[3]);
-}
-
-function getAnswer(num, arr, flag) {
-	var rand = 0,
-		$f, delay;
-	for (var i = 0; i < num; i++) {
-		if (flag == me.row && i == me.col) {
-			console.log(flag, i);
-			continue;
-		}
-		rand = Math.floor(Math.random() * peopleArr.length);
-		arr[i] = peopleArr.splice(rand, 1)[0];
-		$f = arr[i].$ren;
-		$f[0].className = arr[i].className + " row"+flag+" d" + flag + "-" + i;
-		delay = Math.floor(Math.random() * 3000) + "ms";
-		$f.css("transition-delay", delay)
-	}
-	if (flag == me.row) {
-		arr.splice(me.col, 1);
-	}
-} */
-
-$("#ansBox").on("click", ".ans", function() {
-	if (quesCount >= 0 && quesCount <= 15) {
-		var $this = $(this);
-		var dataId = $this.attr("data-id");
-		if (dataId != nowAns) {
-			$this.addClass("active").siblings().removeClass("active");
-			choiseAnswer(Number(dataId),nowAns);
-			nowAns = dataId;
-		}
-	}
-});
-
-function choiseAnswer(flag,prevAns) {
-	/* $.post(ansPostUrl,JSON.stringify({
-		qno:(quesFlag+1),
-		ans:flag,
-		iscorrect:quesData[quesFlag].right==ansArr[flag]
-	})); */
-	var rand = Math.floor(Math.random() * 15);
-	 rand=arr[flag].length>36?rand:arr[flag].length-1;
-	var prevR = me.row,
-		prevC = me.col;
-		console.log(prevR,prevC);
-		console.log(flag,rand);
-	var len = Math.floor((arr[flag].length - rand) / 3)+1;
-	for (var i = len - 1; i >= 0; i--) {
-		var col = rand + 3 * i;
-		if (i == 0) {
-			getTemp(arr[flag][col], me);
-			me={};
-			$.extend(true,me,arr[flag][col]);
-			console.log(me);
-		} 
-		if (i == len - 1) {
-			if(arr[prevAns].length>36){
-				getTemp(arr[prevR][prevC], arr[flag][col]);
-			}
-		} 
-		if(i>0 && i<len - 1){
-			getTemp(arr[flag][col], arr[flag][col - 3]);
-		}
-			
-	
-	}
-
-}
-
-function getTemp(obj1, obj2) {
-	obj1.$id = obj2.$id;
-	obj1.figure = obj2.figure;
-	obj1.num = obj2.num;
-	getIn(obj1);
-}
-
-function resetGame() {
-	nowAns = me.row;
-	quesCount = 2;
-	$countDown.html(quesCount);
-	$trap.html("").hide();
-	ansArr = ["A", "B", "C"];
-}
-
-function startQues() {
-	if (me.$id.hasClass("err")) {
-		fail();
-		return false;
-	}
-	resetGame();
-	if (quesLen != 0 && quesFlag < quesLen) {
-		$num.html(quesFlag + 1);
-		var ques = quesData[quesFlag];
-		quesHtml = ques.text;
-		if (ques.img) {
-			quesHtml += `<br/><img src="img/${ques.img}"/>`;
-		}
-		$ques.html(quesHtml);
-		$go.fadeIn(function() {
-			$renBox.fadeIn();
-		});
-
-		quesInter = setInterval(function() {
-			if (quesCount == 1) {
-				clearInterval(quesInter);
-				$go.fadeOut();
-				quesFlag++;
-				$renBox.fadeOut();
-				var tt = setTimeout(function() {
-					nextGame(ques);
-					clearTimeout(tt);
-				}, 2000);
-			}
-			quesCount--;
-			$countDown.html(quesCount);
-		}, 10000000);
-	} else {
-		clearTimeout(quesTimer);
-		success();
-	}
-}
-
-function fail() {
-	$endBox.remove($success).fadeIn(function() {
-		$fail.show();
-	})
-}
-
-function success() {
-	$endBox.remove($fail).fadeIn(function() {
-		$success.show();
-	})
-}
-
-function nextGame(ques) {
-	var trapHtml = "";
-	for (var i in ansArr) {
-		if (ansArr[i] == ques.right) {
-			peopleArr = arr[i];
-		} else {
-			var rand = Math.floor(Math.random() * 4) + 1;
-			trapHtml += `<div class="trap trap${rand} r${i}"></div>`;
-			$(".row" + i).attr("style", "").addClass("err");
-		}
-	}
-	$trap.html(trapHtml).show();
-	quesTimer = setTimeout(startQues, 2000);
-}
-function getAnswer(){
-	// var peopleArr=
-}
-// ws
-/* var ws = new WebSocket("ws://47.108.130.28:9000/ws/quepass/onlinewaiting");
-ws.onopen = function() {
-	console.log("open");
-}
-ws.onmessage = function(e) {
-	console.log(JSON.parse(e.data));
-}
-ws.onclose = function(e) {
-	console.log(e);
-}
-var ws1 = new WebSocket("ws://47.108.130.28:9000/ws/quepass/onlinecounter");
-ws1.onopen = function() {
-	console.log("open1");
-}
-ws1.onmessage = function(e) {
-	console.log(JSON.parse(e.data));
-}
-ws1.onclose = function(e) {
-	console.log(e);
-} */
-
-
-init();

+ 411 - 0
js/game - 副本.js

@@ -0,0 +1,411 @@
+var baseUrl = "47.108.130.28:9000";
+var registUrl="http://"+baseUrl+"/api/quepass/regist";
+var ansPostUrl = "http://"+baseUrl + "/api/quepass/anspost";
+var wsCountUrl = "ws://"+baseUrl + "/ws/quepass/onlinecounter";
+var wsWaitUrl="ws://"+baseUrl+"/ws/quepass/onlinewaiting";
+let $box = $("#figureBox"),
+	people = 0;
+let me = {
+	row: 1,
+	col: 1
+};
+var arr = [
+	new Array(36),
+	new Array(36),
+	new Array(36)
+];
+var ans = [100,100,100];
+// 开始答题
+let $go = $("#go"),
+	$countDown = $("#countDown"),
+	$ques = $("#ques"),
+	$trap = $("#trapID"),
+	$num = $("#num"),
+	// $renBox = $("#renBox"),
+	$rens = [$("#people1"), $("#people2"), $("#people3")];
+let quesData, quesLen=0, quesFlag = 0,
+	quesHtml, quesTimer, quesInter, quesCount = quesEnd =30,isQuesEnd=false;
+
+$.getJSON("question.json", function(res) {
+	quesData = res.ques;
+	quesLen = quesData.length;
+	$("#allQues").html(quesLen);
+});
+
+// 答题
+var $fail = $("#fail"),
+	$success = $("#success"),
+	$endBox = $("#endBox");
+
+var nowAns = -1;
+
+var peopleArr = [];
+//?? peopleArr一直都是全部的ren 删减#ren时才改变
+function init() {
+	figureInit(36, 1);
+	me.$id = $("#ren" + me.num);
+	let timer = setTimeout(function() {
+		clearTimeout(timer);
+			for (let j = 0; j < 36; j++) {
+				if (arr[1][j]) {
+					var delay = j * 100 + "ms";
+					getIn(arr[1][j], 1, j, delay);
+				}
+			}
+	}, 100);
+	setTimeout(function(){
+		startQues();
+		getCounter();
+	}, 5000);
+}
+
+function getIn(str, i, j, delay) {
+	var $ren = $(str);
+	$ren.addClass("d" + i + "-" + j);
+	if (str == me.id) {
+		$ren.addClass("me");
+	}
+	$ren.removeAttr("style");
+	if (delay) {
+		$ren.css("transition-delay", delay);
+	}
+}
+
+function figureInit(num, flag) {
+	let html = "",
+		figure = "";
+	if (num > 36) num = 36;
+	for (let i = 0; i < num; i++) {
+		var left = Math.floor(Math.random() * 40)+20 + "vw";
+		figure = "figure f" + Math.floor(Math.random() * 20 + 1);
+		html += `<div class="${figure}" id="ren${people+i}" style="left:${left}"></div>`;
+		arr[flag][i] = "#ren" + (people + i);
+		peopleArr.push(arr[flag][i]);
+		if (flag == me.row && i == me.col) {
+			me.id = arr[flag][i];
+			peopleArr.pop();
+		}
+	}
+	people += num;
+	$box.append(html);
+}
+
+$("#ansBox").on("click", ".ans", function() {
+	if (quesCount >= 0 && quesCount <= quesEnd) {
+		var $this = $(this);
+		var dataId = $this.attr("data-id");
+		$this.addClass("active").siblings().removeClass("active");
+		if (dataId != nowAns) {
+			// $this.addClass("active").siblings().removeClass("active");
+			choiseAnswer(Number(dataId));
+			nowAns = dataId;
+		}
+	}
+});
+
+function choiseAnswer(flag) {
+	$.post(ansPostUrl, JSON.stringify({
+		uid,
+		uname,
+		qno: (quesFlag + 1),
+		ans: flag,
+		iscorrect: quesData[quesFlag].right == ansArr[flag]
+	}));
+	var rand = 1;
+	var prevR = me.row,
+		prevC = me.col;
+	arr[prevR][prevC] = null;
+	
+	// 当旧位置多于36个时,需要添加新元素
+	if (ans[prevR] > 36) {
+		people++;
+		var left = 10 + 30 * prevR + "vw";
+		figure = "figure f" + Math.floor(Math.random() * 20 + 1);
+		var html = `<div class="${figure}" id="ren${people}" style="left:${left}"></div>`;
+		$box.append(html);
+		arr[prevR][prevC] = "#ren" + people;
+		peopleArr.push(arr[prevR][prevC]);
+		var timer = setTimeout(function() {
+			$(arr[prevR][prevC]).removeAttr("style").addClass("d" + prevR + "-" + prevC);
+		}, 100);
+
+	}
+
+	arr[flag][rand] = me.id;
+	removePos($(me.id)).removeAttr("style").addClass("d" + flag + "-" + rand);
+	me.row = flag;
+	me.col = rand;
+}
+
+function removePos($obj) {
+	let match = $obj.attr("class").match(/d\d\-\d{0,2}/);
+	if (match) {
+		return $obj.removeClass(function() {
+			return match[0];
+		})
+	} else {
+		return $obj
+	}
+
+}
+
+function getTemp(obj1, obj2) {
+	obj1.$id = obj2.$id;
+	obj1.figure = obj2.figure;
+	obj1.num = obj2.num;
+	getIn(obj1);
+}
+
+function resetGame() {
+	nowAns = me.row;
+	quesCount = quesEnd;
+	$countDown.html(quesCount);
+	$trap.html("").hide();
+	ansArr = ["A", "B", "C"];
+	$(".figure").removeAttr("data-err");
+}
+
+function startQues() {
+	if ($(me.id).attr("data-err")) {
+		fail();
+		isQuesEnd=true;
+		return false;
+	}
+	resetGame();
+	if (quesLen != 0 && quesFlag < quesLen && !isQuesEnd) {
+		$num.html(quesFlag + 1);
+		var ques = quesData[quesFlag];
+		quesHtml = ques.text;
+		if (ques.img) {
+			quesHtml += `<br/><img src="img/${ques.img}"/>`;
+		}
+		$ques.html(quesHtml);
+		$go.fadeIn();
+		// 需要删除
+		/* ans = [10, 50, 10];
+		getAnswer(); */
+		quesInter = setInterval(function() {
+			if (quesCount == 1) {
+				clearInterval(quesInter);
+				$go.fadeOut();
+				quesFlag++;
+				var tt = setTimeout(function() {
+					nextGame(ques);
+					clearTimeout(tt);
+				}, 2000);
+			}
+			quesCount--;
+			$countDown.html(quesCount);
+		}, 1000);
+	} else {
+		isQuesEnd=true;
+		clearTimeout(quesTimer);
+		success();
+	}
+}
+
+function fail() {
+	$endBox.remove($success).fadeIn(function() {
+		$fail.show();
+	})
+}
+
+function success() {
+	$endBox.remove($fail).fadeIn(function() {
+		$success.show();
+	})
+}
+
+function nextGame(ques) {
+	var trapHtml = "";
+	var rightNum = ansArr.indexOf(ques.right);
+	for (var i in ansArr) {
+		// 回答错误
+		if (ansArr[i] != ques.right) {
+			var rand = Math.floor(Math.random() * 4) + 1;
+			trapHtml += `<div class="trap trap${rand} r${i}"></div>`;
+			if(arr[i].length>0){
+			for (var k in arr[i]) {
+				if(arr[i][k]){
+				var $k = $(arr[i][k]);
+				$k.removeAttr("style").attr("data-err", 1).transition({
+					y: "-100vh"
+				}, 2000, "linear", function() {
+					removePos($k).css("left", rightNum * 30 + 10 + "vw");
+				})
+				}
+			}}
+		}
+	}
+	$trap.html(trapHtml).show();
+		quesTimer = setTimeout(startQues, 3000);
+	
+}
+function getTempPeople(){
+	var tempArr=[];
+	for(var i=0;i<3;i++){
+		for(var j=0;j<36;j++){
+			if(arr[i][j]){
+				tempArr.push(arr[i][j]);
+			}
+		}
+	}
+	return tempArr;
+}
+function getAnswer(res) {
+	var tempPeople = peopleArr.concat();
+	if(ans[0].length<36 && ans[1].length<36 && ans[2].length<36){
+		tempPeople=getTempPeople();
+	}
+	var temp = [new Array(36), new Array(36), new Array(36)];
+	temp[me.row][me.col]=me.id;
+	for (var i = 0; i < 3; i++) {
+		var a = ans[i] > 36 ? 36 : ans[i];
+		if(i==me.row){
+			a=a>=36?36:a-1;
+		}
+		$rens[i].html(ans[i]);
+		for (var j = 0; j < a; j++) {
+			if (i == me.row && j == me.col) {
+				temp[i][j] = me.id;
+				continue;
+			}
+			var rand = Math.floor(Math.random() * tempPeople.length);
+			temp[i][j] = tempPeople.splice(rand, 1)[0];
+			if (temp[i][j]) {
+				$temp = $(temp[i][j]);
+				removePos($temp).removeAttr("style").addClass("d" + i + "-" + j);
+			} else {
+				console.log(temp[i][j]);
+			}
+		}
+	}
+	var len = tempPeople.length;
+	for (var i = 0; i < len; i++) {
+		removePos($(tempPeople[i])).removeAttr("style");
+	}
+	arr = temp.concat();
+}
+// ws
+
+// function getCounter(){
+// 	var ws1 = new WebSocket(wsCountUrl);
+// 	var tempAns=new Array(3);
+// 	var isSame=true;
+// 	var $ren=$("#ren");
+// 	var rens=0;
+//     ws1.onopen = function(e){
+//         ws1.send("getcounter")     
+//     }
+// 	ws1.onmessage = function(e) {
+// 		var res = JSON.parse(e.data);
+//         console.log(res,4444444444444)
+// 		rens=0;
+// 		for (var i = 0; i < res.length; i++) {
+// 			var len=res[i].data.length;
+// 			switch (res[i].ans) {
+// 				case 0:
+// 					tempAns[0] = len;
+// 					break;
+// 				case 1:
+// 					tempAns[1] = len;
+// 					break;
+// 				case 2:
+// 					tempAns[2] = len;
+// 					break;
+// 			}
+// 			rens+=len;
+// 		}
+// 		for(var i=0;i<3;i++){
+// 			if(tempAns[i]!=ans[i]){
+// 				isSame=false;
+// 				break;
+// 			}
+// 		}
+// 		if(!isSame){
+// 			$ren.html(rens);
+// 			ans=tempAns.concat();
+// 			ans=[0,30,0];
+// 			getAnswer();
+// 		}
+		
+// 	}
+// }
+
+
+
+var $load=$("#load"),images=new Array();
+function preload(imgs, callback) {
+	var iCur = 0,
+		i = 0;
+	for (i = 0; i < imgs.length; i++) {
+		images[i] = new Image();
+		images[i].src = "img/"+imgs[i];
+		images[i].onload = function() {
+			iCur++;
+			if (iCur == imgs.length) {
+				console.log("加载完成");
+				callback();				
+			}
+		}
+	}
+}
+var isWait=true;
+var uid=getQueryString('uid');
+var uname=getQueryString('uname');
+
+function waiting(callback){
+	var ws = new WebSocket(wsWaitUrl);
+	var timer = null
+	ws.onopen = function() {
+		console.log("正在等待");
+		console.log("open success");
+		localStorage.removeItem("lockReconnect");
+		//定时发送 
+		timer = window.setInterval(function () {
+			ws.send(uid+"_"+uname)
+		}, 1000)
+	}
+	ws.onmessage = function(e) {
+		var res=JSON.parse(e.data);
+		if(res.status==1 && isWait){
+			isWait=false;
+			callback();
+		}
+		if(res.status==2 && !isWait){
+			isQuesEnd=true;
+			clearTimeout(quesTimer);
+			success();
+		}
+	}
+	ws.onclose = function () {
+		console.log("closed...")
+		window.clearInterval(timer)
+		//这里仿照page.html添加上重连机制
+	}
+	ws.onerror = function (err) {
+		window.clearInterval(timer)
+	};
+}
+
+function getQueryString(name) {
+    var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");
+    var r = window.location.search.substr(1).match(reg);
+    if (r != null) return unescape(r[2]); return null;
+}
+var uid=getQueryString('uid');
+var uname=getQueryString('uname');
+if(!uid || !uname){
+	// window.location.href="https://www.100t.com/gjnh/2022.php";
+}else{
+	// $.post(registUrl,JSON.stringify({uid,uname}),function(res){
+		preload(["bg.png","figure.png","img1.png","img2.png","img3.png","line.png","qus-top.png","text-bg.png","time-box.png","trap1.png","trap2.png","trap3.png","trap4.png"],function(){
+			// waiting(function(){
+				$load.fadeOut(function(){
+					$(this).remove();
+					init();
+				});
+			// })
+		})
+	// })
+}

+ 246 - 326
js/game.js

@@ -1,199 +1,138 @@
-var baseUrl = "47.108.130.28:9000";
-var registUrl="http://"+baseUrl+"/api/quepass/regist";
-var ansPostUrl = "http://"+baseUrl + "/api/quepass/anspost";
-var wsCountUrl = "ws://"+baseUrl + "/ws/quepass/onlinecounter";
-var wsWaitUrl="ws://"+baseUrl+"/ws/quepass/onlinewaiting";
-let $box = $("#figureBox"),
+var baseUrl = "gj.100t.com/";
+var registUrl = "http://" + baseUrl + "/api/quepass/regist";
+var ansPostUrl = "http://" + baseUrl + "/api/quepass/anspost";
+var wsCountUrl = "ws://" + baseUrl + "/ws/quepass/onlinecounter";
+var wsWaitUrl = "ws://" + baseUrl + "/ws/quepass/onlinewaiting";
+var $box = $("#figureBox"),
 	people = 0;
-let me = {
-	row: Math.floor(Math.random() * 3),
-	col: Math.floor(Math.random() * 15)
+var me = {
+	row: 1,
+	col: 1
 };
-var arr = [
-	new Array(36),
-	new Array(36),
-	new Array(36)
-];
-var ans = [100,100,100];
-// 开始答题
-let $go = $("#go"),
+var $go = $("#go"),
 	$countDown = $("#countDown"),
 	$ques = $("#ques"),
 	$trap = $("#trapID"),
 	$num = $("#num"),
-	// $renBox = $("#renBox"),
-	$rens = [$("#people1"), $("#people2"), $("#people3")];
-let quesData, quesLen=0, quesFlag = 0,
-	quesHtml, quesTimer, quesInter, quesCount = quesEnd =30,isQuesEnd=false;
+	$fail = $("#fail"),
+	$success = $("#success"),
+	$endBox = $("#endBox"),
+	$ren=$("#ren");
+var quesData, quesLen = 0,
+	quesFlag = 0,
+	quesHtml, quesTimer, quesInter, quesCount = quesEnd = 30,
+	isQuesEnd = false;
 
+var peopleArr = [];
 $.getJSON("question.json", function(res) {
 	quesData = res.ques;
 	quesLen = quesData.length;
 	$("#allQues").html(quesLen);
 });
+var ansArr = ["A", -1, "B"]
+// 预加载
+var $load = $("#load"),
+	images = new Array();
 
-// 答题
-var $fail = $("#fail"),
-	$success = $("#success"),
-	$endBox = $("#endBox");
+function preload(imgs, callback) {
+	var iCur = 0,
+		i = 0;
+	for (i = 0; i < imgs.length; i++) {
+		images[i] = new Image();
+		images[i].src = "img/" + imgs[i];
+		images[i].onload = function() {
+			iCur++;
+			if (iCur == imgs.length) {
+				console.log("加载完成");
+				callback();
+			}
+		}
+	}
+}
 
-var nowAns = -1;
+function getQueryString(name) {
+	var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");
+	var r = window.location.search.substr(1).match(reg);
+	if (r != null) return unescape(r[2]);
+	return null;
+}
+var uid = getQueryString('uid');
+var uname = getQueryString('uname');
+var round_id = getQueryString('round_id');
+if (!uid || !uname) {
+	window.location.href = "https://www.100t.com/gjnh/2022.php";
+} else {
+	$.post(registUrl, JSON.stringify({
+		uid,
+		uname
+	}), function(res) {
+		if (res.status == 0 && res.game_status == 0) {
+			preload(["bg.png", "figure.png", "img1.png", "img2.png", "img3.png", "line.png", "qus-top.png",
+				"text-bg.png",
+				"time-box.png", "trap1.png", "trap2.png", "trap3.png", "trap4.png"
+			], function() {
+				waiting(function() {
+					$load.fadeOut(function() {
+						$(this).remove();
+						init();
+						$ren.html(res.data.length);
+					});
+				})
+			})
+		}
+	})
+}
 
-var peopleArr = [];
-//?? peopleArr一直都是全部的ren 删减#ren时才改变
+// 初始化
 function init() {
-	for (var i = 0; i < 3; i++) {
-		figureInit(ans[i], i);
+	var html = "",
+		figure = "";
+	for (var i = 0; i < 108; i++) {
+		var left = Math.floor(Math.random() * 30) + 35 + "vw";
+		figure = 'figure f' + Math.floor(Math.random() * 20 + 1);
+		html += "<div class='" + figure + " row1' id='ren" + i + "' style='left:" + left + "'></div>";
+		if (i == 1) {
+			continue;
+		}
+		peopleArr.push("#ren" + i);
 	}
-	me.$id = $("#ren" + me.num);
-	let timer = setTimeout(function() {
-		clearTimeout(timer);
-		for (let i = 0; i < 3; i++) {
-			for (let j = 0; j < 36; j++) {
-				if (arr[i][j]) {
-					var delay = j * 100 + "ms";
-					getIn(arr[i][j], i, j, delay);
-				}
+	$box.append(html);
+	me.$id = $("#ren1");
+	var timer = setTimeout(function() {
+		for (var j = 0; j < 36; j++) {
+			if (peopleArr[j]) {
+				var delay = j * 10 + "ms";
+				me.$id.addClass("me");
+				getIn(peopleArr[j], 1, j, delay);
 			}
 		}
+
+		getIn(me.$id, 1, 1, "20ms");
+		console.log(peopleArr);
+		clearTimeout(timer);
 	}, 100);
-	setTimeout(function(){
+	
+	setTimeout(function() {
 		startQues();
-		getCounter();
-	}, 5000);
+		// getCounter();
+	}, 1000);
 }
 
 function getIn(str, i, j, delay) {
 	var $ren = $(str);
-	$ren.addClass("d" + i + "-" + j);
-	if (str == me.id) {
-		$ren.addClass("me");
-	}
+	removePos($ren).addClass("d" + i + "-" + j).addClass("row" + i);
 	$ren.removeAttr("style");
 	if (delay) {
 		$ren.css("transition-delay", delay);
 	}
 }
 
-function figureInit(num, flag) {
-	let html = "",
-		figure = "";
-	if (num > 36) num = 36;
-	for (let i = 0; i < num; i++) {
-		var left = Math.floor(Math.random() * 140) - 20 + "vw";
-		figure = "figure f" + Math.floor(Math.random() * 20 + 1);
-		html += `<div class="${figure}" id="ren${people+i}" style="left:${left}"></div>`;
-		arr[flag][i] = "#ren" + (people + i);
-		peopleArr.push(arr[flag][i]);
-		if (flag == me.row && i == me.col) {
-			me.id = arr[flag][i];
-			peopleArr.pop();
-		}
-	}
-	people += num;
-	$box.append(html);
-}
-
-$("#ansBox").on("click", ".ans", function() {
-	if (quesCount >= 0 && quesCount <= quesEnd) {
-		var $this = $(this);
-		var dataId = $this.attr("data-id");
-		$this.addClass("active").siblings().removeClass("active");
-		if (dataId != nowAns) {
-			// $this.addClass("active").siblings().removeClass("active");
-			choiseAnswer(Number(dataId));
-			nowAns = dataId;
-		}
-	}
-});
-
-function choiseAnswer(flag) {
-	$.post(ansPostUrl, JSON.stringify({
-		uid,
-		uname,
-		qno: (quesFlag + 1),
-		ans: flag,
-		iscorrect: quesData[quesFlag].right == ansArr[flag]
-	}));
-	var rand = Math.floor(Math.random() * 15);
-	rand = arr[flag].length > 15 ? rand : arr[flag].length - 1;
-	var prevR = me.row,
-		prevC = me.col;
-	arr[prevR][prevC] = null;
-	// 当新位置有值时
-	if (arr[flag][rand]) {
-		var id = arr[flag][rand];
-		var $id = $(id);
-		// 当前行选择多于等于36时,需要将当前位置的元素移除
-		if (ans[flag] >= 36) {
-			$id.css("z-index", 11).transition({
-				y: "-100vh"
-			}, 1000, function() {
-				$id.remove();
-				var num = peopleArr.indexOf(id);
-				if (num >= 0) {
-					peopleArr.splice(num, 1);
-				}
-			})
-		} else {
-			// 当前行选择少于36时,将元素放到最后一个位置上
-			arr[flag][ans[flag]] = id;
-			removePos($id).addClass("d" + flag + "-" + ans[flag]);
-		}
-	}
-	// 当旧位置多于36个时,需要添加新元素
-	if (ans[prevR] > 36) {
-		people++;
-		var left = 10 + 30 * prevR + "vw";
-		figure = "figure f" + Math.floor(Math.random() * 20 + 1);
-		var html = `<div class="${figure}" id="ren${people}" style="left:${left}"></div>`;
-		$box.append(html);
-		arr[prevR][prevC] = "#ren" + people;
-		peopleArr.push(arr[prevR][prevC]);
-		var timer = setTimeout(function() {
-			$(arr[prevR][prevC]).removeAttr("style").addClass("d" + prevR + "-" + prevC);
-		}, 100);
-
-	}
-
-	arr[flag][rand] = me.id;
-	removePos($(me.id)).removeAttr("style").addClass("d" + flag + "-" + rand);
-	me.row = flag;
-	me.col = rand;
-}
-
-function removePos($obj) {
-	let match = $obj.attr("class").match(/d\d\-\d{0,2}/);
-	if (match) {
-		return $obj.removeClass(function() {
-			return match[0];
-		})
-	} else {
-		return $obj
-	}
-
-}
-
-function getTemp(obj1, obj2) {
-	obj1.$id = obj2.$id;
-	obj1.figure = obj2.figure;
-	obj1.num = obj2.num;
-	getIn(obj1);
-}
-
-function resetGame() {
-	nowAns = me.row;
-	quesCount = quesEnd;
-	$countDown.html(quesCount);
-	$trap.html("").hide();
-	ansArr = ["A", "B", "C"];
-	$(".figure").removeAttr("data-err");
-}
-
 function startQues() {
-	if ($(me.id).attr("data-err")) {
+	if (!me.$id.hasClass('row1')) {
+		postAns(-1,0,30);
+		console.log("失败");
 		fail();
-		isQuesEnd=true;
+		isQuesEnd = true;
 		return false;
 	}
 	resetGame();
@@ -201,14 +140,9 @@ function startQues() {
 		$num.html(quesFlag + 1);
 		var ques = quesData[quesFlag];
 		quesHtml = ques.text;
-		if (ques.img) {
-			quesHtml += `<br/><img src="img/${ques.img}"/>`;
-		}
 		$ques.html(quesHtml);
 		$go.fadeIn();
-		// 需要删除
-		/* ans = [10, 50, 10];
-		getAnswer(); */
+		getRandAns();
 		quesInter = setInterval(function() {
 			if (quesCount == 1) {
 				clearInterval(quesInter);
@@ -221,216 +155,202 @@ function startQues() {
 			}
 			quesCount--;
 			$countDown.html(quesCount);
-		}, 1000);
+		}, 100);
 	} else {
-		isQuesEnd=true;
+		isQuesEnd = true;
 		clearTimeout(quesTimer);
 		success();
 	}
-}
 
-function fail() {
-	$endBox.remove($success).fadeIn(function() {
-		$fail.show();
-	})
-}
-
-function success() {
-	$endBox.remove($fail).fadeIn(function() {
-		$success.show();
-	})
 }
 
 function nextGame(ques) {
 	var trapHtml = "";
-	var rightNum = ansArr.indexOf(ques.right);
-	for (var i in ansArr) {
-		// 回答错误
-		if (ansArr[i] != ques.right) {
-			var rand = Math.floor(Math.random() * 4) + 1;
-			trapHtml += `<div class="trap trap${rand} r${i}"></div>`;
-			if(arr[i].length>0){
-			for (var k in arr[i]) {
-				if(arr[i][k]){
-				var $k = $(arr[i][k]);
-				$k.removeAttr("style").attr("data-err", 1).transition({
-					y: "-100vh"
-				}, 2000, "linear", function() {
-					removePos($k).css("left", rightNum * 30 + 10 + "vw");
-				})
-				}
-			}}
-		}
+	trapHtml += emptyRow(1);
+	$(".row1").removeClass("row1");
+	if (ques.right == "A") {
+		trapHtml += emptyRow(2);
+		$(".row2").removeClass("row2");
+		$(".row0").removeClass("row0").addClass("row1");
+	} else {
+		trapHtml += emptyRow(0);
+		$(".row0").removeClass("row0");
+		$(".row2").removeClass("row2").addClass("row1");
 	}
+	console.log(trapHtml);
 	$trap.html(trapHtml).show();
-		quesTimer = setTimeout(startQues, 3000);
-	
-}
-function getTempPeople(){
-	var tempArr=[];
-	for(var i=0;i<3;i++){
-		for(var j=0;j<36;j++){
-			if(arr[i][j]){
-				tempArr.push(arr[i][j]);
-			}
+	setTimeout(function() {
+		var $rows = $(".row1"),
+			rowsLen = $rows.length;
+		for (var i = 0; i < rowsLen; i++) {
+			var $k = $rows.eq(i);
+			removePos($k).removeAttr("style").addClass("d1-" + i).addClass("row1");
 		}
-	}
-	return tempArr;
+	}, 2000);
+	quesTimer = setTimeout(startQues, 3000);
+
+}
+
+function emptyRow(i) {
+	$(".row" + i).removeAttr("style").transition({
+		y: "-100vh"
+	}, 2000, "linear", function() {
+		removePos($(this)).css("left", 40 + "vw");
+	})
+	var rand = Math.floor(Math.random() * 4) + 1;
+	return '<div class="trap trap' + rand + ' r' + i + '"></div>';
+}
+
+function resetGame() {
+	isAns = false;
+	quesCount = quesEnd;
+	$countDown.html(quesCount);
+	$trap.html("").hide();
+	$("#ansBox .ans").removeClass("active");
 }
-function getAnswer(res) {
+
+function fail() {
+	window.location.href = "fail.html";
+}
+
+function success() {
+	$fail.remove();
+	$endBox.fadeIn(function() {
+		$success.show();
+	})
+}
+// 获取随机答案
+function getRandAns() {
 	var tempPeople = peopleArr.concat();
-	if(ans[0].length<36 && ans[1].length<36 && ans[2].length<36){
-		tempPeople=getTempPeople();
-	}
-	var temp = [new Array(36), new Array(36), new Array(36)];
-	temp[me.row][me.col]=me.id;
 	for (var i = 0; i < 3; i++) {
-		var a = ans[i] > 36 ? 36 : ans[i];
-		if(i==me.row){
-			a=a>=36?36:a-1;
-		}
-		$rens[i].html(ans[i]);
-		for (var j = 0; j < a; j++) {
-			if (i == me.row && j == me.col) {
-				temp[i][j] = me.id;
+		for (var j = 0; j < 36; j++) {
+			if (j == 1) {
 				continue;
 			}
 			var rand = Math.floor(Math.random() * tempPeople.length);
-			temp[i][j] = tempPeople.splice(rand, 1)[0];
-			if (temp[i][j]) {
-				$temp = $(temp[i][j]);
-				removePos($temp).removeAttr("style").addClass("d" + i + "-" + j);
+			console.log(rand, tempPeople[rand]);
+			var id = tempPeople.splice(rand, 1)[0];
+			delay = Math.floor(Math.random() * 3000) + "ms";
+			if (id) {
+				getIn(id, i, j, delay);
 			} else {
-				console.log(temp[i][j]);
+				console.log(id);
 			}
+
 		}
 	}
-	var len = tempPeople.length;
-	for (var i = 0; i < len; i++) {
-		removePos($(tempPeople[i])).removeAttr("style");
-	}
-	arr = temp.concat();
+
 }
-// ws
 
-function getCounter(){
-	var ws1 = new WebSocket(wsCountUrl);
-	var tempAns=new Array(3);
-	var isSame=true;
-	var $ren=$("#ren");
-	var rens=0;
-    ws1.onopen = function(e){
-        ws1.send("getcounter")     
-    }
-	ws1.onmessage = function(e) {
-		var res = JSON.parse(e.data);
-        console.log(res,4444444444444)
-		rens=0;
-		for (var i = 0; i < res.length; i++) {
-			var len=res[i].data.length;
-			switch (res[i].ans) {
-				case 0:
-					tempAns[0] = len;
-					break;
-				case 1:
-					tempAns[1] = len;
-					break;
-				case 2:
-					tempAns[2] = len;
-					break;
-			}
-			rens+=len;
-		}
-		for(var i=0;i<3;i++){
-			if(tempAns[i]!=ans[i]){
-				isSame=false;
-				break;
-			}
+// 清除原来位置
+function removePos($obj) {
+	if ($obj) {
+		var c = $obj.attr("class");
+		var match = c.match(/d\d\-\d{0,2}/);
+		var m2 = c.match(/row\d{1}/);
+		if (match) {
+			$obj.removeClass(function() {
+				return match[0];
+			})
 		}
-		if(!isSame){
-			$ren.html(rens);
-			ans=tempAns.concat();
-			ans=[0,30,0];
-			getAnswer();
+		if (m2) {
+			$obj.removeClass(function() {
+				return m2[0];
+			})
 		}
-		
+		return $obj;
 	}
+
 }
+// 选择答案
+var isAns = false;
+$("#ansBox").on("click", ".ans", function() {
+	if (quesCount >= 0 && quesCount <= quesEnd) {
+		if (!isAns) {
+			var $this = $(this);
+			var dataId = $this.attr("data-id");
+			isAns = true;
+			$this.addClass("active").siblings().removeClass("active");
+			removePos(me.$id).removeAttr("style").addClass("d" + dataId + "-" + 1).addClass("row" + dataId);
+			me.row = dataId;
+			var iscorrect = -1,time=quesEnd-quesCount;
+			if (quesData[quesFlag].right == "A") {
+				iscorrect = dataId == 0 ? 1 : 0;
+			} else if (quesData[quesFlag].right == "A") {
+				iscorrect = dataId == 2 ? 0 : 1;
+			}
+			postAns(ans,iscorrect,time);
+		}
+	}
+});
 
+function postAns(ans, iscorrect,time) {
+	$.post(ansPostUrl, JSON.stringify({
+		round_id,
+		uid,
+		uname,
+		qno: (quesFlag + 1),
+		ans,
+		iscorrect,
+		time
+	}));
+}
 
+// 重连
+var limitConnect = 5; // 断线重连次数
+var timeConnect = 0;
 
-var $load=$("#load"),images=new Array();
-function preload(imgs, callback) {
-	var iCur = 0,
-		i = 0;
-	for (i = 0; i < imgs.length; i++) {
-		images[i] = new Image();
-		images[i].src = "img/"+imgs[i];
-		images[i].onload = function() {
-			iCur++;
-			if (iCur == imgs.length) {
-				console.log("加载完成");
-				callback();				
-			}
+function reconnect(service) {
+	// lockReconnect加锁,防止onclose、onerror两次重连
+	if (limitConnect > 0) {
+		if (localStorage.getItem('lockReconnect') != true) {
+			localStorage.setItem("lockReconnect", 1);
+			limitConnect--;
+			timeConnect++;
+			console.log("第" + timeConnect + "次重连");
+			// 进行重连
+			setTimeout(function() {
+				webSocketInit(service);
+				localStorage.removeItem("lockReconnect");
+			}, 2000);
 		}
+	} else {
+		console.log("TCP连接已超时");
 	}
 }
-var isWait=true;
-var uid=getQueryString('uid');
-var uname=getQueryString('uname');
+var isWait = true;
 
-function waiting(callback){
+function waiting(callback) {
 	var ws = new WebSocket(wsWaitUrl);
 	var timer = null
 	ws.onopen = function() {
-		console.log("正在等待");
 		console.log("open success");
 		localStorage.removeItem("lockReconnect");
 		//定时发送 
-		timer = window.setInterval(function () {
-			ws.send(uid+"_"+uname)
+		timer = window.setInterval(function() {
+			ws.send(uid + "_" + uname)
 		}, 1000)
 	}
 	ws.onmessage = function(e) {
-		var res=JSON.parse(e.data);
-		if(res.status==1 && isWait){
-			isWait=false;
+		var res = JSON.parse(e.data);
+		if (res.status == 1 && isWait) {
+			isWait = false;
 			callback();
 		}
-		if(res.status==2 && !isWait){
-			isQuesEnd=true;
+		if (res.status == 2 && !isWait && game_status != 1) {
+			isQuesEnd = true;
 			clearTimeout(quesTimer);
 			success();
 		}
+		$ren.html(res.data.length);
 	}
-	ws.onclose = function () {
+	ws.onclose = function() {
 		console.log("closed...")
 		window.clearInterval(timer)
 		//这里仿照page.html添加上重连机制
+		reconnect(wsWaitUrl)
 	}
-	ws.onerror = function (err) {
+	ws.onerror = function(err) {
 		window.clearInterval(timer)
 	};
-}
-
-function getQueryString(name) {
-    var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");
-    var r = window.location.search.substr(1).match(reg);
-    if (r != null) return unescape(r[2]); return null;
-}
-var uid=getQueryString('uid');
-var uname=getQueryString('uname');
-if(!uid || !uname){
-	window.location.href="https://www.100t.com/gjnh/2022.php";
-}else{
-	$.post(registUrl,JSON.stringify({uid,uname}),function(res){
-		preload(["bg.png","figure.png","img1.png","img2.png","img3.png","line.png","qus-top.png","text-bg.png","time-box.png","trap1.png","trap2.png","trap3.png","trap4.png"],function(){
-			waiting(function(){
-				$load.fadeOut(function(){
-					$(this).remove();
-					init();
-				});
-			})
-		})
-	})
-}
+}

+ 15 - 53
question.json

@@ -1,57 +1,19 @@
 {
 	"ques":[
-		{
-			"text":"法学院的女生比男生多,在下学期的数学期末考试中,法学院不及格的学生超过了一半。由此可见:<br/>A. 女生不及格的比男生不及格的多<br/>B. 女生不及格的比男生及格的多<br/>C. 女生及格的比男生不及格的多",
-			"img":"",
-			"right":"B"
-		},{
-			"text":"下面两个立方体是同一个骰子,请问ABC哪个是它的展开图?",
-			"img":"img3.png",
-			"right":"C"
-		},{
-			"text":"一口井7米深,有只蜗牛从井底往上爬,白天爬3米,晚上往下坠2米。问蜗牛几天能从井里爬出来?<br/>A. 3<br/>B. 4<br/>C. 5",
-			"img":"",
-			"right":"C"
-		},
-		{
-			"text":"发行人申请首次公开发行股票并在创业板上市,应当按照()制定的信息披露规则,编制并披露招股说明书,保证相关信息真实、准确、完整。 <br/>A . 国务院金融监督管理机构 <br/>B . 中国证券业协会 <br/>C . 中国证监会 ",
-			"img":"",
-			"right":"C"
-		},
-		{
-			"text":"如果惊喜是“。。。。。!”,那么忐忑是( )?<br/>A. !。!。!。<br/>B. !。。。。。<br/>C. !!!!!! ",
-			"img":"",
-			"right":"A"
-		},
-		{
-			"text":"法学院的女生比男生多,在下学期的数学期末考试中,法学院不及格的学生超过了一半。由此可见:<br/>A. 女生不及格的比男生不及格的多<br/>B. 女生不及格的比男生及格的多<br/>C. 女生及格的比男生不及格的多 ",
-			"img":"",
-			"right":"B"
-		},
-		{
-			"text":"股份公司的下列资料中,优先股股东可以查阅的有()。 Ⅰ.股东名册 Ⅱ.股东大会会议记录 Ⅲ.董事会会议记录 Ⅳ.监事会会议决议 <br/>A . Ⅰ、Ⅱ、Ⅲ、Ⅳ <br/>B . Ⅱ、Ⅲ、Ⅳ <br/>C . Ⅱ、Ⅲ、Ⅳ  ",
-			"img":"",
-			"right":"B"
-		},
-		{
-			"text":"根据《上市公司非公开发行股票实施细则》,下列符合上市公司非公开发行股票的认购 邀请书发送对象要求的是()。 <br/>A . 4家保险机构投资者 <br/>B . 15家证券投资基金管理公司 <br/>C . 12家证券公司  ",
-			"img":"",
-			"right":"C"
-		},
-			{
-			"text":"下列行为中,视同销售货物缴纳增值税的是()。 <br/>A . 将购进的货物用于集体福利 <br/>B . 将购进的货物用于个人消费 <br/>C . 将购进的货物用于对外投资 ",
-			"img":"",
-			"right":"C"
-		},
-			{
-			"text":"下列行为中,视同销售货物缴纳增值税的是()。 <br/>A . 将购进的货物用于集体福利 <br/>B . 将购进的货物用于个人消费 <br/>C . 将购进的货物用于对外投资 ",
-			"img":"",
-			"right":"C"
-		},
-		{
-			"text":"下列关于网上、网下投资者要求的说法中,正确的是()。<br/>A . 首次公开发行股票的网下发行应和网上发行同时进行,网下和网上投资者在申购时需缴 付申购资金 <br/>B . 投资者应当自行选择参与网下或网上发行,不得同时参与 <br/>C . 网上投资者连续12个月内累计出现3次中签后未足额缴款的情形时,3个月内不得参与新股申购 ",
-			"img":"",
-			"right":"B"
-		}
+			{"text":"1、本届冬奥会中国代表团共获得9枚金牌<br>A.正确<br>B.错误","right":"A"},
+	{"text":"2、本届冬奥会中国代表团获奖牌榜季军<br>A.正确<br>B.错误","right":"A"},
+	{"text":"3、青霉素属于一种抗生素。<br>A.正确<br>B.错误","right":"A"},
+	{"text":"4、卡拉ok是日本人发明的。<br>A.正确<br>B.错误","right":"A"},
+	{"text":"5、人不惑之年是指50岁。<br>A.正确<br>B.错误","right":"B"},
+	{"text":"6、五粮液数浓香型白酒。<br>A.正确<br>B.错误","right":"A"},
+	{"text":"7、2012年伦敦奥运会中国是金牌榜第一名。<br>A.正确<br>B.错误","right":"B"},
+	{"text":"8、按照《中国人民银行法》规定,中央银行可以对企业直接发放贷款。<br>A.正确<br>B.错误","right":"B"},
+	{"text":"9、金融机构是指特意从事货币、信用活动的中介组织。<br>A.正确<br>B.错误","right":"A"},
+	{"text":"10、政策性银行经营时以盈利为目的。<br>A.正确<br>B.错误","right":"B"},
+	{"text":"11、上市公司董事会成员中应当有1/3以上的独立董事。<br>A.正确<br>B.错误","right":"A"},
+	{"text":"12、欧洲债券是国际债券的一种<br>A.正确<br>B.错误","right":"A"},
+	{"text":"13、将廉洁从业、合规执业、诚信执业和()等情况纳入绩效考核与人员管理体系,加强正向引导激励和反向惩戒约束作用<br>A.培训宣导<br>B.践行企业文化","right":"B"},
+	{"text":"14、以下哪个平台是公司打造的专业风险管理平台<br>A.风险*说<br>B.金规指","right":"A"},
+	{"text":"15、下列业务中,哪项业务风险是以信用风险为主?<br>A.财富管理业务<br>B.融资类业务","right":"B"}
 	]
 }