Updated Course java scripts to calculate sums of the lengths and par onLoad and onChange.