Changes

Test

1,962 bytes removed, 00:58, 7 March 2012
no edit summary
<html>
<script type="text/javascript">
var isArray = function doCalc(obj) { return Object.prototype.toString.call(obj) var trimps=== "[object new Array]";},getNumWithSetDec = function( num, numOfDec ){; var pow10s total = Math.pow( 10, numOfDec || 0 ); return for( numOfDec ) ? Math.round( pow10s * num i=1; i< 8; i++) / pow10s : num;}, {getAverageFromNumArr = function doTrimp( numArr'dur_'+i, numOfDec 'cr10_'+i, 'trimp_'+i){ if( !isArray( numArr ) ){ return false; } var trimps[i -1] = numArrNumber(document.length, sum = 0; whilegetElementById( 'trimp_'+i-- ){.innerHTML); sum total += numArrtrimps[ i -1];
}
return getNumWithSetDecvar average = getAverageFromNumArr( (sum / numArr.length )trimps, numOfDec 2);},getVariance var stddev = functiongetStandardDeviation( numArrtrimps, numOfDec 2){ if( !isArray(numArr) ){ return false; } var avg Monotony = getAverageFromNumArr( numArr, numOfDec ), i = numArr10.length, v = 0; whileif (average < ( i-- 10 * stddev)) { v +Monotony = average / stddev; Monotony = Math.powround( (numArr[ i ] - avg), 2 Monotony*100)/100;
}
v /= numArr.length; return getNumWithSetDec( v, numOfDec );},getStandardDeviation = function( numArr, numOfDec ){ if( !isArray(numArr) ){ return false; } var stdDev = Math.sqrt( getVariance( numArr, numOfDec ) ); return getNumWithSetDec( stdDev, numOfDec );}; function doCalc(){ var d1 = document.getElementById('dur_1Monotony').innerHTML; alert= "Monotony: " + Monotony + " (d1" + average + " / " + stddev + " )"; //var c1 = document.getElementById('cr10_1Total').innerHTML; //alert(c1); //var t1 = d1 * c1"Total TRIMP: " + total; //alert(t1); // document.getElementById('trimp_1Stress').innerHTML = t1"Training Stress: " + Math.round(total * Monotony);
}
</script>
<form style="font-family: Helvetica,Arial,sans-serif;border: solid 2px #40a0c0" id="MonotonyMonotonyForm">
<table style="text-align: left;" border="1" cellpadding="1" cellspacing="1">
<tr>
<th>DayQuestion</th> <th>Duration (min)strongly disagree</th> <th>CR10 Ratingdisagree</th> <th>TRIMP(CR10)neutral</th> </tr> <tr> <td>1</td> <td><input maxlength="3" size="3" id="Dur_1" value="0"th>agree</tdth> <td><input maxlength="3" size="3" id="cr10_1" value="0"th>strongly agree</td> <td><label id="trimp_1"></label></td> </tr> <tr> <td>2</td> <td><input maxlength="3" size="3" id="Dur_2" value="0"></td> <td><input maxlength="3" size="3" id="cr10_2" value="0"></td> <td><input maxlength="3" size="3" id="trimp_2" value="0" readonly="readonly"></td> </tr> <tr> <td>3</td> <td><input maxlength="3" size="3" id="Dur_3" value="0"></td> <td><input maxlength="3" size="3" id="cr10_3" value="0"></td> <td><input maxlength="3" size="3" id="trimp_3" value="0" readonly="readonly"></td> </tr> <tr> <td>4</td> <td><input maxlength="3" size="3" id="Dur_4" value="0"></td> <td><input maxlength="3" size="3" id="cr10_4" value="0"></td> <td><input maxlength="3" size="3" id="trimp_4" value="0" readonly="readonly"></td> </tr> <tr> <td>5</td> <td><input maxlength="3" size="3" id="Dur_5" value="0"></td> <td><input maxlength="3" size="3" id="cr10_5" value="0"></td> <td><input maxlength="3" size="3" id="trimp_5" value="0" readonly="readonly"></td> </tr> <tr> <td>6</td> <td><input maxlength="3" size="3" id="Dur_6" value="0"></td> <td><input maxlength="3" size="3" id="cr10_6" value="0"></td> <td><input maxlength="3" size="3" id="trimp_6" value="0" readonly="readonly"></tdth>
</tr>
<tr>
<td>7I slept well last night</td> <td><input maxlengthtype="3radio" name="slept" value="1" size/></td> <td><input type="3radio" idname="Dur_7slept" value="02"/></td> <td><input maxlength="3" sizetype="3radio" idname="cr10_7slept" value="03"/></td> <td><input maxlengthtype="3radio" name="slept" sizevalue="34" id/></td> <td><input type="trimp_7radio" valuename="0slept" readonlyvalue="readonly5"/></td>
</tr>
</table>
<label id="MonotonyTotal">MonotonyTotal:</label> <br> <input type="button" value="Calculate" onclick="doCalc()"/>
</form>
</html>