Difference between revisions of "Test"

From Fellrnr.com, Running tips
Jump to: navigation, search
User:Fellrnr (User talk:Fellrnr | contribs)
User:Fellrnr (User talk:Fellrnr | contribs)
Line 5: Line 5:
 
var trimps=new Array();
 
var trimps=new Array();
 
var total = 0;
 
var total = 0;
for(i=1; i< 8; i++)
+
for(i=1; i<=5; i++)
 
{
 
{
doTrimp('dur_'+i, 'cr10_'+i, 'trimp_'+i);
+
if(document.getElementById('0'+i).checked)
trimps[i-1] = Number(document.getElementById('trimp_'+i).innerHTML);
+
{
total += trimps[i-1];
+
total += document.getElementById('0'+i).value;
 +
}
 
}
 
}
var average = getAverageFromNumArr(trimps, 2);
+
document.getElementById('Total').innerHTML = "Total: " + total;
var stddev = getStandardDeviation(trimps, 2);
 
var Monotony = 10.0;
 
if (average < (10 * stddev))
 
        {
 
Monotony = average / stddev;
 
Monotony = Math.round(Monotony*100)/100;
 
}
 
document.getElementById('Monotony').innerHTML = "Monotony: " + Monotony + "  ( " + average + " / " + stddev + " )";
 
document.getElementById('Total').innerHTML = "Total TRIMP: " + total;
 
document.getElementById('Stress').innerHTML = "Training Stress: " + Math.round(total * Monotony);
 
 
}
 
}
 
</script>
 
</script>
Line 37: Line 28:
 
       <tr>
 
       <tr>
 
       <td>I slept well last night</td>
 
       <td>I slept well last night</td>
         <td><input type="radio" name="slept" value="1" /></td>
+
         <td><input type="radio" name="slept" value="1" id="01"/></td>
         <td><input type="radio" name="slept" value="2" /></td>
+
         <td><input type="radio" name="slept" value="2" id="02"/></td>
         <td><input type="radio" name="slept" value="3" /></td>
+
         <td><input type="radio" name="slept" value="3" id="03"/></td>
         <td><input type="radio" name="slept" value="4" /></td>
+
         <td><input type="radio" name="slept" value="4" id="04"/></td>
         <td><input type="radio" name="slept" value="5" /></td>
+
         <td><input type="radio" name="slept" value="5" id="05"/></td>
 
       </tr>
 
       </tr>
 
   </table>
 
   </table>
 
   <label id="Total">Total:</label><br/>
 
   <label id="Total">Total:</label><br/>
 +
  <input type="button" value="Calculate" onclick="doCalc()"/>
 
</form>
 
</form>
 
</html>
 
</html>

Revision as of 21:03, 6 March 2012

Question strongly disagree disagree neutral agree strongly agree
I slept well last night