Click to See Complete Forum and Search --> : Calculate average based on multiple choice Q's???


keanem
03-26-2003, 04:27 PM
I'm trying to put together a logic tool to help some folks with determining an overall rating number. The rating is based on eight multiple choice questions (3 answers/each) separated into two categories, five in the first and three in the second. The ratings are all values of 1, 2 or 3. The categories are averaged: (A1:A5)/5 and (B1:B3)/3; and then averaged together [(A1:A5)/5 + (B1:B3)/3]/2.

Should/could this be done with radio button inputs?

Is there a better way to have the end user answer the eight multiple choice questions and have this report an overall rating? Thanks in advance....

BTW, here's what I've got so far -- but I have no clue what I'm doing wrong:


<html>
<head>
<title>Automagic Risk Rating Tool</title>
</head>
<body>
<form>
<center>
<p><h1>Rate the following per the Change Management Standards</h1></p>
</center>

<script language="Javascript">

function computeTotal()
{
var Prob = parseFloat(document.RISK.hist.value + document.RISK.comp.value + document.RISK.veri.value +

document.RISK.back.value + document.RISK.coor.value)/5;

var Imp = parseFloat(document.RISK.cost.value + document.RISK.ebsa.value + document.RISK.cust.value)/3;

parseFloat(Prob + Imp)/2;
}

</script>


<form name="RISK">
<table border=2><caption align="bottom">Use this form to help you find the appropriate Risk Rating for your change.</caption>

<tr><td colspan=2 align="center"><font size="+1"><b>Risk Probability is the Probability of Impact</b></font></td></tr>

<tr><td><b>History</b> of problems for changes to this system or similar systems</td>
<td><INPUT TYPE="RADIO" NAME="hist" VALUE="1">NONE<BR>
<INPUT TYPE="RADIO" NAME="hist" VALUE="2">SELDOM<BR>
<INPUT TYPE="RADIO" NAME="hist" VALUE="3">FREQUENT</td></tr>

<tr><td><b>Complexity</b> of the change</td>
<td><INPUT TYPE="RADIO" NAME="comp" VALUE="1">SIMPLE; One Application or Inventory Item Involved<BR>
<INPUT TYPE="RADIO" NAME="comp" VALUE="2">MEDIUM; Two Applications or Inventory Items Involved<BR>
<INPUT TYPE="RADIO" NAME="comp" VALUE="3">HIGH; Three Applications or Inventory Items Involved</td></tr>

<tr><td><b>Verification</b> -- Ability to verify the functionality of the change</td>
<td><INPUT TYPE="RADIO" NAME="veri" VALUE="1">Performed by designated monitoring/support group<BR>
<INPUT TYPE="RADIO" NAME="veri" VALUE="2">Performed by Change Owner/Implementer only<BR>
<INPUT TYPE="RADIO" NAME="veri" VALUE="3">No verification to be performed</td></tr>

<tr><td><b>Backout</b> -- The ability to backout within the designated change window</td>
<td><INPUT TYPE="RADIO" NAME="back" VALUE="1">SIMPLE; Backout is simple and can absolutely be performed within change

window<BR>
<INPUT TYPE="RADIO" NAME="back" VALUE="2">MODERATE; Backout is moderately difficult even though backout procedures are

well documented and the backout may extend beyond change window<BR>
<INPUT TYPE="RADIO" NAME="back" VALUE="3">DIFFICULT; Backout is difficult or impossible and/or requires an extended

period of time to perform</td></tr>

<tr><td><b>Coordination</b> -- Pre- and/or Co-requisites exist for successful implementation of the change activity</td>
<td><INPUT TYPE="RADIO" NAME="coor" VALUE="1">NONE; No Pre- and/or Co-requisite changes exist<BR>
<INPUT TYPE="RADIO" NAME="coor" VALUE="2">SOME; At least one Pre- or Co-requisite change exists<BR>
<INPUT TYPE="RADIO" NAME="coor" VALUE="3">EXTENSIVE; Involves many Pre- and/or Co-requisite changes</td></tr>


<tr><td colspan=2 align="center"><font size="+1"><b>Risk Impact is Possible Adverse Effect</b></font></td></tr>

<tr><td><b>Direct Cost</b> -- If the change fails, the bank will lose:</td>
<td><INPUT TYPE="RADIO" NAME="cost" VALUE="1">&lt; $100,000<BR>
<INPUT TYPE="RADIO" NAME="cost" VALUE="2">$100,001 to $500,000<BR>
<INPUT TYPE="RADIO" NAME="cost" VALUE="3">&gt; $500,000</td></tr>

<tr><td><b>EBSA "Top 10" List</b> -- Enterprise Business Systems Availability "Top 10" List component</td>
<td><INPUT TYPE="RADIO" NAME="ebsa" VALUE="1">NO; System/application does not support an EBSA "Top 10" Business Service<BR>
<INPUT TYPE="RADIO" NAME="ebsa" VALUE="2">YES; System/application supports one EBSA "Top 10" Business Service<BR>
<INPUT TYPE="RADIO" NAME="ebsa" VALUE="3">MANY; System/application supports more than one EBSA "Top 10" Business

Service</td></tr>

<tr><td><b>Customers Affected</b> -- Quantity of Internal &amp; External Customers Affected</td>
<td><INPUT TYPE="RADIO" NAME="cust" VALUE="1">FEW; Few Internal or External Customers COULD Be Affected<BR>
<INPUT TYPE="RADIO" NAME="cust" VALUE="2">MODERATE; Effects Felt Throughout A Department Or Moderate Numbers Of External

Customers Affected<BR>
<INPUT TYPE="RADIO" NAME="cust" VALUE="3">WIDE; Effects Felt Across Departments or Widespread External Customers Affected

or High Visibility</td></tr>


<tr><td ALIGN="CENTER"><INPUT TYPE="BUTTON" onClick="computeTotal()" Value="What's the Overall Risk?"></td>
<td align="center">Overall Risk: <input TYPE="NUMBER" NAME="Total" SIZE="6"></td></tr>



</table>
</form>

</body>
</html>

khalidali63
03-26-2003, 07:50 PM
You seem to be on "almost" right track.

this line

document.RISK.hist.value + document.RISK.comp.value + document.RISK.veri.value +

document.RISK.back.value + document.RISK.coor.value)/5;

you are trying toaccess radio buttons,I am assuming, you want the value for the button that is checked.To do that you'll nedd towrite a bit more code.

youd need to run a loop and see which radion buttonis checked and then get its value

Get this done first then we'll procede to next..
:D

Cheers

Khalid

keanem
03-27-2003, 11:53 AM
If you could help me understand why the script doesn't recognize the assigned values of the selected radio buttons, that would probably make it easier for me to understand where I need to go with the loop.

Thanks in advance.

dkm

keanem
03-27-2003, 02:17 PM
Okay, I think I'm on the right track with checking the values of the radio buttons. The script isn't producing any results, though.

Can you help me verify???

Thanks in advance!

--------------------------------------------

<html>
<head>
<title>Automagic Risk Rating Tool</title>
</head>
<body>
<center>
<p><h1>Rate the following per the Change Management Standards</h1></p>
</center>

<script language="Javascript">


function computeTotal()
{
//begin HISTORY checks
if (document.RISK.hist[0].checked == true) { //1st option is selected
varHist = 1; }
else
if (document.RISK.hist[1].checked == true) { //2nd option is selected
varHist = 2; }
else
if (document.RISK.hist[2].checked == true) { //3rd option is

selected
varHist = 3; }
else // no option selected
{ alert("You must select a HISTORY option"); }
//end HISTORY checks


//begin COMP checks
if (document.RISK.comp[0].checked == true) { //1st option is selected
varComp = 1; }
else
if (document.RISK.comp[1].checked == true) { //2nd option is selected
varComp = 2; }
else
if (document.RISK.comp[2].checked == true) { //3rd option is

selected
varComp = 3; }
else // no option selected
{ alert("You must select a COMPLEXITY option"); }
//end COMP checks


//begin VERI checks
if (document.RISK.veri[0].checked == true) { //1st option is selected
varVeri = 1; }
else
if (document.RISK.veri[1].checked == true) { //2nd option is selected
varVeri = 2; }
else
if (document.RISK.veri[2].checked == true) { //3rd option is

selected
varVeri = 3; }
else // no option selected
{ alert("You must select a VERIFICATION option"); }
//end VERI checks


//begin BACK checks
if (document.RISK.back[0].checked == true) { //1st option is selected
varBack = 1; }
else
if (document.RISK.back[1].checked == true) { //2nd option is selected
varBack = 2; }
else
if (document.RISK.back[2].checked == true) { //3rd option is

selected
varBack = 3; }
else // no option selected
{ alert("You must select a BACKOUT option"); }
//end BACK checks


//begin COOR checks
if (document.RISK.coor[0].checked == true) { //1st option is selected
varCoor = 1; }
else
if (document.RISK.coor[1].checked == true) { //2nd option is selected
varCoor = 2; }
else
if (document.RISK.coor[2].checked == true) { //3rd option is

selected
varCoor = 3; }
else // no option selected
{ alert("You must select a COORDINATION option"); }
//end COOR checks


//begin COST checks
if (document.RISK.cost[0].checked == true) { //1st option is selected
varCost = 1; }
else
if (document.RISK.cost[1].checked == true) { //2nd option is selected
varCost = 2; }
else
if (document.RISK.cost[2].checked == true) { //3rd option is

selected
varCost = 3; }
else // no option selected
{ alert("You must select a COST option"); }
//end COST checks


//begin EBSA checks
if (document.RISK.ebsa[0].checked == true) { //1st option is selected
varEbsa = 1; }
else
if (document.RISK.ebsa[1].checked == true) { //2nd option is selected
varEbsa = 2; }
else
if (document.RISK.ebsa[2].checked == true) { //3rd option is

selected
varEbsa = 3; }
else // no option selected
{ alert("You must select an EBSA option"); }
//end EBSA checks


//begin CUST checks
if (document.RISK.cust[0].checked == true) { //1st option is selected
varCust = 1; }
else
if (document.RISK.cust[1].checked == true) { //2nd option is selected
varCust = 2; }
else
if (document.RISK.cust[2].checked == true) { //3rd option is

selected
varCust = 3; }
else // no option selected
{ alert("You must select an CUSTOMER option"); }
//end CUST checks


varProb = parseFloat(varHist + varComp + varVeri + varBack + varCoor)/5;

varImpl = parseFloat(varCost + varEbsa + varCust)/3;

varTotal = parseFloat(varProb + varImpl)/2;


} // end function


</script>


<form name="RISK">
<table border=2><caption align="bottom">Use this form to help you find the appropriate Risk

Rating for your change.</caption>

<tr><td colspan=2 align="center"><font size="+1"><b>Risk Probability is the Probability of

Impact</b></font></td></tr>

<tr><td><b>History</b> of problems for changes to this system or similar systems</td>
<td><INPUT TYPE="RADIO" NAME="hist" VALUE="1">NONE<BR>
<INPUT TYPE="RADIO" NAME="hist" VALUE="2">SELDOM<BR>
<INPUT TYPE="RADIO" NAME="hist" VALUE="3">FREQUENT</td></tr>

<tr><td><b>Complexity</b> of the change</td>
<td><INPUT TYPE="RADIO" NAME="comp" VALUE="1">SIMPLE; One Application or Inventory Item

Involved<BR>
<INPUT TYPE="RADIO" NAME="comp" VALUE="2">MEDIUM; Two Applications or Inventory Items

Involved<BR>
<INPUT TYPE="RADIO" NAME="comp" VALUE="3">HIGH; Three Applications or Inventory Items

Involved</td></tr>

<tr><td><b>Verification</b> -- Ability to verify the functionality of the change</td>
<td><INPUT TYPE="RADIO" NAME="veri" VALUE="1">Performed by designated monitoring/support

group<BR>
<INPUT TYPE="RADIO" NAME="veri" VALUE="2">Performed by Change Owner/Implementer only<BR>
<INPUT TYPE="RADIO" NAME="veri" VALUE="3">No verification to be performed</td></tr>

<tr><td><b>Backout</b> -- The ability to backout within the designated change window</td>
<td><INPUT TYPE="RADIO" NAME="back" VALUE="1">SIMPLE; Backout is simple and can absolutely

be performed within change window<BR>
<INPUT TYPE="RADIO" NAME="back" VALUE="2">MODERATE; Backout is moderately difficult even

though backout procedures are well documented and the backout may extend beyond change

window<BR>
<INPUT TYPE="RADIO" NAME="back" VALUE="3">DIFFICULT; Backout is difficult or impossible

and/or requires an extended period of time to perform</td></tr>

<tr><td><b>Coordination</b> -- Pre- and/or Co-requisites exist for successful implementation

of the change activity</td>
<td><INPUT TYPE="RADIO" NAME="coor" VALUE="1">NONE; No Pre- and/or Co-requisite changes

exist<BR>
<INPUT TYPE="RADIO" NAME="coor" VALUE="2">SOME; At least one Pre- or Co-requisite change

exists<BR>
<INPUT TYPE="RADIO" NAME="coor" VALUE="3">EXTENSIVE; Involves many Pre- and/or

Co-requisite changes</td></tr>


<tr><td colspan=2 align="center"><font size="+1"><b>Risk Impact is Possible Adverse

Effect</b></font></td></tr>

<tr><td><b>Direct Cost</b> -- If the change fails, the bank will lose:</td>
<td><INPUT TYPE="RADIO" NAME="cost" VALUE="1">&lt; $100,000<BR>
<INPUT TYPE="RADIO" NAME="cost" VALUE="2">$100,001 to $500,000<BR>
<INPUT TYPE="RADIO" NAME="cost" VALUE="3">&gt; $500,000</td></tr>

<tr><td><b>EBSA "Top 10" List</b> -- Enterprise Business Systems Availability "Top 10" List

component</td>
<td><INPUT TYPE="RADIO" NAME="ebsa" VALUE="1">NO; System/application does not support an

EBSA "Top 10" Business Service<BR>
<INPUT TYPE="RADIO" NAME="ebsa" VALUE="2">YES; System/application supports one EBSA "Top

10" Business Service<BR>
<INPUT TYPE="RADIO" NAME="ebsa" VALUE="3">MANY; System/application supports more than

one EBSA "Top 10" Business Service</td></tr>

<tr><td><b>Customers Affected</b> -- Quantity of Internal &amp; External Customers

Affected</td>
<td><INPUT TYPE="RADIO" NAME="cust" VALUE="1">FEW; Few Internal or External Customers COULD

Be Affected<BR>
<INPUT TYPE="RADIO" NAME="cust" VALUE="2">MODERATE; Effects Felt Throughout A Department

Or Moderate Numbers Of External Customers Affected<BR>
<INPUT TYPE="RADIO" NAME="cust" VALUE="3">WIDE; Effects Felt Across Departments or

Widespread External Customers Affected or High Visibility</td></tr>


<tr><td ALIGN="CENTER"><INPUT TYPE="BUTTON" onClick="computeTotal()" Value="What's the

Overall Risk?"></td>
<td align="center">Overall Risk: <input TYPE="NUMBER" NAME="varTotal" SIZE="6"></td></tr>



</table>
</form>

</body>
</html>

keanem
03-31-2003, 09:54 AM
Does anyone have any new thoughts on making this work???

Thanks in advance!

dkm