# This paper designs an examination system for automatically setting questions and judging papers by using Python standard library language to investigate the ability of users to calculate four integers within 100.

CSDN Q & A 2021-11-25 18:27:16
paper designs examination automatically setting

The basic requirements are as follows ：
1、 The user can input the number of questions by himself n, The system automatically according to the difficulty of the topic , Give points to each topic , The total score is 100 branch .
2、 The system randomly generates four operation expressions , Let users calculate , Such as ：1+1=？,2/4=?,27557+67/79+29*37-49, etc.
3、 The system automatically judges the right and wrong of the user's calculation results , Such as 1+1=2：√,2/4=8：×
4、 The system automatically calculates and returns the user's final score and the duration of the test .

Reference code

``import randomn = int(input(" Please input the number of questions ："))op = ['+','-','*','/']tsc = 0sc = 0lis = []for i in range(n): c = random.randint(1,5) calc = str(random.randint(1,100)) t = 0 for j in range(c): p = random.randint(0,3) t += 2 if p<2 else 3 calc += op[p] calc += str(random.randint(1,100)) lis.append([calc,t]) tsc += tfor i,(calc,t) in enumerate(lis): g = float(input(f" The first {i+1} topic {t/tsc*100:.2f} branch {calc}=")) d = round(eval(calc)*100)/100 if g==d: print(" Correct answer ") sc += t else: print(" Wrong answer , answer ：",d)print(f' The final score :{sc/tsc*100:.2f}')`` If help , Hope to adopt ！ thank you !