How is the weekly score worked out?

The weekly score is an average of your score over the time driving for that week.

This includes your average score for time driving in the green, minus your average score for time driving in the red. It also factors in any penalties you have received during that week which apply.