public static function calculate_all_expressions(
            qtype_calculated_question_with_expressions $question) {
        $question->questiontext = $question->vs->replace_expressions_in_text(
                $question->questiontext);
        $question->generalfeedback = $question->vs->replace_expressions_in_text(
                $question->generalfeedback);

        foreach ($question->answers as $ans) {
            if ($ans->answer && $ans->answer !== '*') {
                $ans->answer = $question->vs->replace_expressions_in_text($ans->answer,
                        $ans->correctanswerlength, $ans->correctanswerformat);
            }
            $ans->feedback = $question->vs->replace_expressions_in_text($ans->feedback,
                    $ans->correctanswerlength, $ans->correctanswerformat);
        }
    }