-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathsubjectwise.py
40 lines (35 loc) · 1.03 KB
/
subjectwise.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
from response_scraper import ResponseScraper
from answer_scraper import ProvisionalKeyScraper
from answer_scraper import FinalKeyScraper
from checker import Checker
sub = "maths"
s = ResponseScraper(scraper='mains_2021')
with open("files/Subjectwise/"+sub+".txt") as f:
s.parse(f, parse_candidate_details=False, parse_test_details=False)
with open("files/Subjectwise/"+sub+".json", 'w') as f:
s.dump_to(f)
f.close()
'''###
s = ProvisionalKeyScraper(scraper='mains_2021')
with open("files/Provisional Answer Key.txt") as f:
s.parse(f)
with open("files/provisional_answer.json", 'w') as f:
s.dump_to(f)
f.close()
'''
s = FinalKeyScraper(scraper='mains_2021')
with open("files/Final Answer Key.txt") as f:
s.parse(f)
with open("files/final_answer.json", 'w') as f:
s.dump_to(f)
f.close()
'''
with open("files/provisional_answer.json") as f:
c = Checker(f)
'''
with open("files/final_answer.json") as f:
c = Checker(f)
###
with open("files/Subjectwise/"+sub+".json") as f:
c.check(f)
c.display_default()