packagemainimport("context""encoding/csv""flag""fmt""log""os""strconv""time")funcCommandLine()(string,int){csvFileName:=flag.String("csv","problems.csv","put the filename after this")limitValue:=flag.Int("limit",4,"the time limit for the quiz in seconds")flag.Parse()return*csvFileName,*limitValue}funcmain(){csvFileName,timeLimit:=CommandLine()ctx,cancel:=context.WithTimeout(context.Background(),time.Duration(timeLimit)*time.Second)defercancel()file,err:=os.Open(csvFileName)iferr!=nil{log.Fatalf("Error opening file: %v",err)}deferfile.Close()reader:=csv.NewReader(file)lines,err:=reader.ReadAll()iferr!=nil{log.Fatalf("Error reading CSV: %v",err)}varcorrect,incorrectintforidx,line:=rangelines{select{case<-ctx.Done():fmt.Println("\nTime's up!")printResults(correct,incorrect)returndefault:formula:=line[0]answerChan:=make(chanint)gofunc(){varresultintfmt.Printf("Question:%d/%d\tFormula: %v = ",idx+1,len(lines),formula)fmt.Scanln(&result)answerChan<-result}()answer,err:=strconv.Atoi(line[1])iferr!=nil{log.Fatalf("Invalid answer in CSV: %v",err)}select{case<-ctx.Done():fmt.Println("\nTime's up!")printResults(correct,incorrect)returncaseresult:=<-answerChan:ifresult==answer{correct++}else{incorrect++}}}}printResults(correct,incorrect)}funcprintResults(correct,incorrectint){fmt.Printf("\nYou got %d correct and %d incorrect.\n",correct,incorrect)}