THC does affect memory, but it only affects short term memory and only for the duration of the high. Translation: when you come down again, your mental capacities are back to normal. Don't be afraid to get really stoned; I'm sure it won't lower your score any smoking a day before the test.