tests and item grade calculator function