implement quiz function version2