I'm glad you brought up the driving tests. Maybe you should reread it.
Vehicle Code § 21954
(a) Every pedestrian upon a roadway at any point other than within a marked crosswalk or within an unmarked crosswalk at an intersection shall yield the right-of-way to all vehicles upon the roadway so near as to constitute an immediate hazard.
Of course, importantly subsection (b) goes on to say:
The provisions of this section shall not relieve the driver of a vehicle from the duty to exercise due care for the safety of any pedestrian upon a roadway.
So we're in full agreement the driver (or vehicle operator, in this case) is 100% responsible for avoiding the pedestrian. But I wouldn't say the pedestrian "had the [legal] right of way." Certainly not on the freeway.
To wit,
Vehicle Code § 21960
(a) … prohibit or restrict the use of the freeways, expressways, or any portion thereof by pedestrians …