forked from jmcmilla/Net-Price-Calculator
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
477 lines (468 loc) · 21.1 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Net Price Calculator</title>
</head>
<body>
<h1>Net Price Calculator</h1>
<p>
The Net Price Calculator project stems from a government mandate that all universities provide a web accessible calculator that not only
defines the tuition of the university but other associated costs as well (ie: Books, Transportation, Room & Board)
<h2>License</h2>
This Net Price Calculator is dual licensed under the <a href="http://en.wikipedia.org/wiki/MIT_License">MIT</a> or <a href="http://en.wikipedia.org/wiki/GNU_General_Public_License">GPL Version 2 licenses</a>
<h2>Terms</h2>
<kbd>
Copyright © 2011 by Kettering University
<p>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
</p>
<p>
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
</p>
<p>
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
</p>
</kbd>
<h2>Accessibility</h2>
<p>Kettering University does its best to provide web solutions that comply with W3C Web Content Accessibility Guidelines (http://www.w3.org/TR/WCAG10/). In particular, this applications makes the following considerations:</p>
<ol>
<li>Provide equivalent alternatives to auditory and visual content.
<ol>
<li>This plugin is completely text based without graphics, hyperlink tags have title attributes. </li>
</ol>
</li>
<li>Don't rely on color alone.
<ol>
<li>The based design uses a high contrast in color and will render with our without the stylesheet
heading tags and body text tags are a minimum of 10pt Arial font </li>
</ol>
</li>
<li>Use markup and style sheets and do so properly.
<ol>
<li>All formatting rules have been placed in the default stylesheet </li>
</ol>
</li>
<li>Clarify natural language usage
<ol>
<li>Text has been reviewed by our financial aid department and is written in the most basic language possible. </li>
</ol>
</li>
<li>Create tables that transform gracefully.
<ol>
<li>The template is div based only using tables when necessary. </li>
<li>No nested tables are used in this design. </li>
</ol>
</li>
<li>Ensure that pages featuring new technologies transform gracefully.
<ol>
<li>This application uses the jQuery framework for initiation, display, content transition </li>
<li>There is a method provided through github to track bugs and enhancement features </li>
</ol>
</li>
<li>Ensure user control of time-sensitive content changes.
<ol>
<li>There are no automatic transitions in this application. </li>
<li>Ensure direct accessibility of embedded user interfaces. </li>
<li>Navigation uses standard browser compatibility for input devices </li>
</ol>
</li>
<li>Design for device-independence.
<ol>
<li>There are no known device restrictions </li>
</ol>
</li>
<li>Use interim solutions.
<ol>
<li>There are no popups </li>
<li>Tables are laid out in in parallel, word-wrapped columns </li>
<li>Links are seperated by a non-link, printable character </li>
</ol>
</li>
<li>Use W3C technologies and guidelines.
<ol>
<li>W3C technologies are used when they are available and appropriate </li>
</ol>
</li>
<li>Provide context and orientation information.
<ol>
<li>Frames are not used </li>
<li>Uses fieldset and Legend where appropriate </li>
</ol>
</li>
<li>Provide clear navigation mechanisms.
<ol>
<li>The navigation bar is clearly identified and uses standard button design </li>
</ol>
</li>
<li>Ensure that documents are clear and simple.
<ol>
<li>The text within the application is written in the simplest and clearest language </li>
<li>The theme of the page is consistent throughout the wizard. </li>
</ol>
</li>
</ol>
<h2>Demonstration</h2>
A <a href="demo.html">Demonstration</a> page has been set up using the requirements of Kettering University.
<h2>Download</h2>
This project is available for <a href="https://github.com/jmcmilla/Net-Price-Calculator">download</a> at github.com
<h2>Audience</h2>
<p>
This plugin requires a sound understanding of javascript arrays and objects as well as a working knowledge of the <a href="jquery.com">jQuery</a> Javascript Framework. The only file that should need to be customized is the template file which is used
to format the user interface as well as define the Profiles, Awards, and Costs associated with attending a college or university.</p>
<p>
To learn about javascript arrays and objects please refer to the resources below:
<ul>
<li><a href="http://www.w3schools.com/JS/js_obj_array.asp">The Javascript Array Object</a></li>
<li><a href="http://www.w3schools.com/js/js_objects.asp">Javascript Create your own Objects</a></li>
</ul>
<h2>Files:</h2>
<strong>jquery.js</strong> - This plugin uses the jQuery framework version 1.3.1<br />
<strong>netprice.js</strong> - The actual plugin logic<br />
<strong>netprice.css</strong> - The Stylesheet for formatting the calculator<br />
<strong>template.txt</strong> - The Template used by the plugin to pull in customized values and the User Interface<br />
<strong>demo.html</strong> - The demonstration application for this plugin
<h2>Initialization:</h2>
<p>
The plugin has one default option, the location of the template file. The default value for this option is the template.txt file that is
included in the package.
</p>
<h3>Using Default Template:</h3>
<pre>
$("#calculator").netPrice();
</pre>
<p>
<h3>Using a custom template file</h3>
<p>
<pre>
$("#calculator").netPrice(
{
templateURL:[path to template]
}
);
</pre>
</p>
<h3>Restrictions:</h3>
<p>
In order for the calculator to work correctly the Allow-Control-Orgin [template domain] must be enabled on the remote server if a template file from a different domain is used.
See <a href="https://developer.mozilla.org/en/HTTP_access_control" target="_blank">HTTP Access Control</a> for more information.
</p>
<p>
The template must have at least 1 element with the netprice_slide class. This is what is used for the navigational buttons.
</p>
<h2>template.txt Important Notes:</h2>
<p>
The formatting is standard html with the exception of a few custom tags that have special meaning to the calculator:
</p>
<blockquote>
<EFCFIELD/> - This will be the location where the EFC Input box will appear<hr/>
<EFCVALUE/> - This will display the value currently entered in the EFC Field<hr/>
<PROFILE></PROFILE> - This tag set will contain the Profile Selection options. These options can be customized
to your organization using an Array of profile objects.<br/>
<strong>Profile Array Example:</strong> <br/>
<pre>
profile[0]={name:"Profile 1"
,number:1
,gpa:{min:4.00,max:4.00}
,sat:{min:1360,max:1600}
,act:{min:31,max:36}
,checked:true
};
</pre>
<strong>Object Definition:</strong><br/>
<strong>name (string)</strong> - Name of the profile to be displayed in the legend of the fieldset<br/>
<strong>number (int)</strong> - Used to identify the profile number, currently unused but may be necessary in future releases<br/>
<strong>gpa (object)</strong> - The GPA Object identifies the values to display for the minimum and maximum values of the Grade Point Average for the profile<br/>
<blockquote>
min (float)<br/>
max (float)<br/>
</blockquote>
<strong>sat (object)</strong> - The SAT Object identifies the values to display for the minimum and maximum values of the SAT Test Scores for the profile<br/>
<blockquote>
min (float)<br/>
max (float)<br/>
</blockquote>
<strong>act (Object)</strong> - The ACT Object identifies the values to display for the minimum and maximum values of the ACT Test Scores for the profile<br/>
<blockquote>
min (float)<br/>
max (float)<br/>
</blockquote>
<strong>checked (boolean)</strong> - if true then the radio button for this profile will be checked, if false it will not be checked.<br/>
</blockquote>
<hr/>
<PROFILELABEL/> - This tag will contain the name value of the profile currently selected.<hr/>
<RESIDENCY></RESIDENCY> - This tag set will contain an array of residency options. These optins can be customized
to your organization using an Array of Residency Objects.<br/>
<blockquote>
<strong>Residency Array Example:</strong><br/>
<pre>
residency[0] = {
name:'residency'
,id:'instate'
,value:'UNGRA1'
,label:'Residing in the state of Michigan'
,checked:true
};
</pre>
<strong>Residency Object Description</strong><br/>
<strong>name (string)</strong> - The name of the radio button element used to select the option<br/>
<strong>id (string}</strong> - The ID of the radio button, for future development<br/>
<strong>value (string)</strong> - The value of the radio button element. This serves as the link to the cost object described below.<br/>
<strong>label (string)</strong> - The text that will be displayed next to the radio button in the user interface<br/>
<strong>checked (boolean)</strong> - If true then the radio button will be checked by default.<br/>
</blockquote>
<hr/>
<RESIDENCYLABEL/> - This tag will display the label value of the current residency object selected.<hr/>
<p><COSTS></COSTS> - This tag set is used to define the costs associated with the net price of a university. You can customize this
using an array of cost objects.
</p>
<p><strong>costs array example:</strong><br />
<pre>
costs = [
{
"name":"BOOK"
,"cost":"1200"
,"code":"UNGRA1"
,"label":"Books & Supplies"
,"description":"The estimated cost of Books averaged over a 4 year period"
}
]
</pre>
</p>
<p>
<strong>Cost Object Definition</strong><br/>
<strong>name (string) </strong>- The name of the cost, used when looking up costs using $.fn.netprice.getCost([cost.name],[residency.value]) <br />
<strong>cost (float) </strong>- the actual cost of the item for a complete school year <br />
<strong>code (string)</strong> - Used to seperate costs based on residency. The value of the residency object determines which cost is displayed
label (string) - The text that is displayed on the screen when the cost has been selected <br />
<strong>description (string)</strong> - Additional information that will appear when the label is clicked on.</p>
<p> </p>
<hr />
<p><NEED/> - This tag will display the need calculation by totaling all of the costs and then subtracting the EFC value entered </p>
<hr />
<p><AWARDS></AWARDS> - This tag will display the award values based on the calculations provided. This can be customized using an array
of award objects. During calculation all awards defined between these tags will be listed. </p>
<p><strong>Award Array Example: </strong>
<pre>
award[0] = {
name:"Merit"
,description:"Based on a student's academic, artistic, athletic or other abilities, and often factor in an applicant's extracurricular activities and community service record. The most common merit-based scholarships, awarded by either private organizations or directly by a student's intended college, recognize academic achievement or high scores on standardized tests"
,rule:function(efc,profile,residency){
var retval = 0;
switch(parseInt(profile)){
case 1:
case 2:
retval = 15000;
break;
case 3:
case 4:
retval = 14000;
break;
case 5:
case 6:
case 7:
retval = 13000;
break;
case 8:
retval = 2000;
break;
}
return retval;
}
};
</pre>
</p>
<p><strong>Award Object Definition:</strong></p>
<p><strong>name (string):</strong> The name of the award as it will be displayed to the end user <br />
<strong>description (string):</strong> A short description of the award that will appear when the name is clicked
<br />
<strong>rule (function):</strong> The logic that will return the awarded amount based on the EFC value, the Profile selected, and the residency selected
the function must have all three inputs defined in the function even if they are not used.
The return value should always be a numeric value </p>
<hr />
<p><NETPRICE/> - This tag will be updated with the net price (cost of attendance - awards) after every calculation
<TOTAL> - The Total Costs will be updated here after every calculation </p>
<hr />
<p><AWARDTOTAL> - The total awards will be placed here after every calculation </p>
<hr />
<blockquote> </blockquote>
</blockquote>
<h1>Constructor:</h1>
<blockquote>
$('').netPrice(options) - Initializes the netprice Plugin
</blockquote>
<h1>Options</h1>
<blockquote>
<table cellspacing="0" cellpadding="3" border="1">
<tr>
<th>Name</th>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>$.fn.netPrice.defaultOptions.templateUrl</td>
<td>string</td>
<td>Path to the Template File (default: template.txt)</td>
</tr>
<tr>
<td>$.fn.netPrice.defaultOptions.currencyFormat</td>
<td>function</td>
<td>Function to convert float values to currency based format (default: 999,999.00)</td>
</tr>
</table>
</blockquote>
<h1>Public Variables:</h1>
<blockquote><table cellspacing="0" cellpadding="3" border="1">
<tr>
<th>Name</th>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>$.fn.netPrice.defaultOptions</td>
<td>Array[Object]</td>
<td>The default options for the calculator.</td>
</tr>
<tr>
<td>$.fn.netPrice.currentSlide</td>
<td>int</td>
<td>The Current Slide Number (Default is zero)</td>
</tr>
<tr>
<td>$.fn.netPrice.costs</td>
<td>Array[Object]</td>
<td>The Costs used by the calculator (Default is empty, loaded from template.txt)</td>
</tr>
<tr>
<td>$.fn.netPrice.awards</td>
<td>Array[Object]</td>
<td>The Awards used by the calculator (Default is empty, loaded from template.txt)</td>
</tr>
<tr>
<td>$.fn.netPrice.profile</td>
<td>Array[Object]</td>
<td>The Profiles used by the calculator (Default is empty, loaded from template.txt)</td>
</tr>
<tr>
<td>$.fn.netPrice.residency </td>
<td>Array[Object]</td>
<td>The Residency values used by the calculator (Default is empty, loaded from template.txt)</td>
</tr>
<tr>
<td>$.fn.netPrice.totalAward</td>
<td>float</td>
<td>The Total award amount from calculation (Default is zero)</td>
</tr>
<tr>
<td>$.fn.netPrice.totalCost</td>
<td>float</td>
<td>The Total Cost of Attendance value from calculation (Default is zero)</td>
</tr>
<tr>
<td>$.fn.netPrice.template</td>
<td>string</td>
<td>The formated template used by the calculator</td>
</tr>
<tr>
<td></td>
<td></td>
<td></td>
</tr>
</table></blockquote>
<h1>Public Methods</h1>
<blockquote><table cellspacing="0" cellpadding="3" border="1">
<tr>
<th>Name</th>
<th>Description</th>
<th>Returns</th>
</tr>
<tr>
<td>$.fn.netPrice.gotoSlide(idx)</td>
<td>Displays the Slide Number to the one specified by idx (zero-based)</td>
<td>Object</td>
</tr>
<tr>
<td>$.fn.netPrice.nextSlide()</td>
<td>Advances the current slide by one each time it is called until $(".netprice_slide").length is reached</td>
<td>Object</td>
</tr>
<tr>
<td>$.fn.netPrice.previousSlide()</td>
<td>Reduces the current slide by one each time it is called until zero (0) is reached</td>
<td>Object</td>
</tr>
<tr>
<td>$.fn.netPrice.costByCode(code)</td>
<td>Returns an array of cost objects based on the residency code value provided</td>
<td>Array[cost]</td>
</tr>
<tr>
<td>$.fn.netPrice.totalByCode(code)</td>
<td>Returns the total cost value of the costs objects identified by the residency code value provided</td>
<td>Float</td>
</tr>
<tr>
<td>$.fn.netPrice.getCost(name,code)</td>
<td>Returns the cost value of the cost object matching the name and residency code provided</td>
<td>Float</td>
</tr>
<tr>
<td>$.fn.netPrice.getResidency(code)</td>
<td>Returns the residency Object identified by the residency code</td>
<td>Object</td>
</tr>
<tr>
<td>$.fn.netPrice.updateResidencyLabel()</td>
<td>Updates the <RESIDENCYLABEL/> tag with the $.fn.netPrice.residency.label text</td>
<td>Object</td>
</tr>
<tr>
<td>$.fn.netPrice.updateCOA()</td>
<td>Updates the <COSTS></COSTS> tag set with the formatted costs and amounts</td>
<td>Object</td>
</tr>
<tr>
<td>$.fn.netPrice.updateNeed()</td>
<td>Updates the <NEED></NEED> tag set with the calculated need values</td>
<td>Object</td>
</tr>
<tr>
<td>$.fn.netPrice.updateProfileLabel()</td>
<td>Updates the <PROFILELABEL/> tag with the selected profile.name</td>
<td>Object</td>
</tr>
<tr>
<td>$.fn.netPrice.updateAward()</td>
<td>Updates the <AWARDS></AWARDS> tag set with the calculated awards</td>
<td>Object</td>
</tr>
<tr>
<td>$.fn.netPrice.updateEFCValue()</td>
<td>Updates the <EFCVALUE/> tag with the user-entered EFC value</td>
<td>Object</td>
</tr>
<tr>
<td>$.fn.netPrice.updateNetPrice()</td>
<td>Updates the <NETPRICE/>, <TOTAL/>, and <AWARDTOTAL> tags with the calculated values</td>
<td>Object</td>
</tr>
<tr>
<td>$.fn.netPrice.update()</td>
<td>Runs all Update methods</td>
<td>Object</td>
</tr>
</table> </blockquote>
</p>
</body>
</html>