In a single directory, I? have multiple folders containing packages of .js and .htm files, all with the same filenames and folder structure. I need an app that will modify two specific (hard-coded) files in each of these packages. The exact changes needed are specified in the detailed description.
## Deliverables
The attached file contains two folders. Each of these folders is one of the packages of the type that will need to be modified. Please use them for reference and testing.
First, the program will require two pieces of input from the user:
1. The directory where the packages are located
2. A? "Time"? variable? (integer representing? the number of seconds)
Then, it will modify two files in each package.
/js/dynapi/src/[login to view URL]
**1. Replace these lines:
**
? ? ? ? onload = function() { [login to view URL](); }
? ? ? ? onunload = function() { [login to view URL](); }
? ? ? ? **With these:**
? ? ? ? onload = function() { [login to view URL](); WindowLoad();}
? ? ? ? onunload = function() { [login to view URL](); WindowLoad();}
/html/assessments/[login to view URL]
**1. Add the following <script> items. NOTE: In the last function call, the text "TIME" should be replaced with the Time variable collected above.**
<script type="text/javascript">
var _countDowncontainer=0;
var _currentSeconds=0;
function ActivateCountDown(strContainerID, initialValue) {
? _countDowncontainer = [login to view URL](strContainerID);
?
? if (!_countDowncontainer) {
? ? alert("count down error: container does not exist: "+strContainerID+
? ? ? "\nmake sure html element with this ID exists");
? ? return;
? }
?
? SetCountdownText(initialValue);
? [login to view URL]("CountDownTick()", 1000);
}
function CountDownTick() {
? if (_currentSeconds <= 0) {
? ? alert("Your time to complete this assessment has expired. Your exam will now be scored.");
? ? submitJudgeAssessment('scoreButton');promp_check_001143D70F3F13F809A312060003C6E1 =? true;
? ? return;
? }
?
? SetCountdownText(_currentSeconds-1);
? [login to view URL]("CountDownTick()", 1000);
}
function SetCountdownText(seconds) {
? //store:
? _currentSeconds = seconds;
?
? //get minutes:
? var minutes=parseInt(seconds/60);
?
? //shrink:
? seconds = (seconds%60);
?
? //get hours:
? var hours=parseInt(minutes/60);
?
? //shrink:
? minutes = (minutes%60);
?
? //build text:
? var strText = AddZero(hours) + ":" + AddZero(minutes) + ":" + AddZero(seconds);
?
? //apply:
? [login to view URL] = strText;
}
function AddZero(num) {
? return ((num >= 0)&&(num < 10))?"0"+num:num+"";
}
</script>
<script type="text/javascript">
window.onload=WindowLoad;
function WindowLoad(event) {
? ActivateCountDown("CountDownPanel", **TIME**);
}
</script>
**2. After the tag? <input name="seqAction" type="hidden" value=""/>:**
- Delete the </td>
- After the </form>, place the following code:?
<br><span style="color:#322804; font-family:arial; font-size:14px;">Time Left: <span id='CountDownPanel'></span></span>
That's it. If you have any questions at all, please don't hesitate to ask. Thanks for bidding!