if($action=="page1") { $score = calculatescorehereandassignittovariable(); }
if($action=="page2" and isset($score)) { calculatenewscoreandassignittoavariable(); }