squirrelworks

A semi-functional javascript program that presents quiz questions in a popup window.








<button id="startButton">Start</button>
<pre id="log"></pre>


<script> 
//Create constants to store elements for button and text field
const startButton = document.querySelector("#startButton");
const log = document.querySelector("#log");

startButton.addEventListener("click", () => {

		//initialize score variable to 0
		var score = 0;

		//create a for loop using a counter from 0 to 5 to cover the array positions of each array
		for (i=0; i<5; i++){
		score = score + triviaQuiz(i);
		}

        log.innerText="Your score is " + score;
		
});
</script>



//create an array of at least 3 trivia questions
var triviaArray = ['tcp port for SSH','tcp port for telnet','tcp port for SMTP','tcp port for  DNS','tcp port for HTTP '];
//create an array with answers to the trivia questions
var answerArray = ['22','23','25','53','80'];


//create quiz function that accepts one parameter which is the array position counter

function triviaQuiz(i){

//set points and guesses to 3 each time the function is called
var points=3;
var guesses=3;

	while (guesses > 0){
		ans = prompt("what is " + triviaArray[i]);
		//ask question i and store result in ans
		//note i comes in as arg from a loop external to the function 

		//compare ans to corresponding position in answer array
		if(ans==answerArray[i])
			{
			alert("correct");
			//guesses=0;
			return points;
			//if correct, exit the function now and return points
			}//endif
		else{
			alert("incorrect");
			guesses = guesses-1;
			points = points-1;	
		//if incorrect, subtract 1 each from guesses and points
		}//endelse

	}//end while
return 0; //if no correct answers given during while loop, return 0
}//end function











Accessibility
 --overview

Agile
 --DevOps overview
 --Principles

API
 --REST best practices
 --REST demo
 --REST vs RPC
 --Wikipedia API

Blockchain
 --overview

Cloud
 --AWS overview

CSS/HTML
 --Bootstrap carousel
 --Grid demo
 --markdown demo

Electricity
 --fundamentals

Encoding
 --Overview

Ergonomics
 --Desk configuration
 --Device fleet
 --Input device array
 --keystroke mechanics
 --Phones & RSI

ERP
 --Anthology overview
 --Ellucian Banner
 --Higher Ed ERP Simulation Lab
 --PeopleSoft Campus Solutions
 --PESC standards
 --Slate data model

Git
 --syntax overview
 --troubleshooting libcrypto

Hardware
 --Device fleet
 --Homelab diagram

Java
 --Fundamentals

Javascript
 --Advanced Interaction: jQuery & UI Frameworks
 --input prompt demo
 --misc demo
 --Time and Date functions
 --Vue demo

Linux
 --grep demo
 --HCI and Proxmox
 --Proxmox install
 --xammp ftp server

Mail flow
 --DKIM, SPF, DMARC
 --MAPI

Microsoft
 --AZ-800: Administering Windows Server Hybrid Core Infrastructure
 --BAT scripting
 --Group Policy
 --IIS
 --robocopy
 --Server 2022 setup - Virtualbox

Misc
 --Applications
 --regex
 --Resources
 --Sustainable Computing
 --Terminology
 --Tribute to Computer Scientists

Networks
 --BGP Peering & Security Hardening Lab
 --CCNA Lammle Study Guide
 --Cisco 1921/K9 router
 --routing protocols
 --throughput calculations

PHP/SQL
 --Cookies
 --database interaction
 --demo, OSI Layers quiz
 --Foreign key constraint demo
 --fundamentals
 --MySQL and PHPmyAdmin setup
 --pagination
 --security
 --session variables
 --SQL fundamentals
 --structures
 --Tables display

Python
 --fundamentals

Security
 --Overview- GRC (Governance, Risk, and Compliance)
 --Security Blog
 --SSH fundamentals

Serialization
 --JSON demo
 --YAML demo