Skip to content

Commit 72feb83

Browse files
committed
Stable Version Completed
Finished the syntax overall for all questions. Updated the report generation specifically for page 3 to have less spaces. Capable of running all currently obtained applications from the beginning of this year till now.
1 parent 9e3cee7 commit 72feb83

File tree

4 files changed

+228
-85
lines changed

4 files changed

+228
-85
lines changed

core/reportgen.py

Lines changed: 22 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -378,9 +378,9 @@ def handle_third_page(self, canvas: object, select_app: int, last_idx: int) -> N
378378
'Name Verification Notice', 'Conduct Question: Conviction',
379379
'Graduation Date', 'Consultant Agency ?', 'Alumni ?', 'Citzenship ?',
380380
'Conduct Question: Expulsion', 'Conduct: Pending Action', 'Multi type question',
381-
'End of App', 'Long REQ']
381+
'End of App']
382382

383-
req_start = ['Request and/or Answer', 'Short REQ', 'Med REQ', "Post-Secondary Colleges/Universities"]
383+
req_start = ['Request and/or Answer', 'Long REQ', 'Short REQ', 'Med REQ', "Post-Secondary Colleges/Universities"]
384384

385385
_list = []
386386

@@ -389,11 +389,12 @@ def handle_third_page(self, canvas: object, select_app: int, last_idx: int) -> N
389389
_str = self.nested_list[select_app][current_idx]
390390
struct = core.ReportStructure(_str)
391391

392-
if val in paragraph_start or val in req_start:
392+
if val in paragraph_start:
393+
yadd -= 10
394+
elif val in req_start:
393395
target = str(_str).split("!")
394-
if val == 'Long REQ' and len(target) == 6:
395396

396-
long_syntax = {
397+
req_syntax = {
397398
'PAYMENT RECONCILIATION': s.payment_syntax(target),
398399
'RES: PREVIOUS ENROLLMENT': s.prev_syntax(target),
399400
'RES: BASIS OF CLAIM': s.basis_syntax(target),
@@ -402,41 +403,35 @@ def handle_third_page(self, canvas: object, select_app: int, last_idx: int) -> N
402403
'RES: GUAR': s.residency_guar_syntax(target),
403404
'CTRY SELF': s.country_syntax(target),
404405
'FAMILY OBLIGATION INCOME': s.family_obj_income_syntax(target),
405-
'VET STATUS': s.vet_syntax(target)
406-
}
407-
408-
for key, value in long_syntax.items():
409-
if target[3] == key:
410-
_list = value
411-
yadd -= 10
412-
413-
if target[3] == 'PAYMENT RECONCILIATION':
414-
canvas.drawString(xstart, ystart+yadd, "Application Fee Information:")
415-
yadd -= 10
416-
417-
elif val == 'Request and/or Answer' and len(target) >= 3:
418-
419-
req_syntax = {
406+
'VET STATUS': s.vet_syntax(target),
407+
'HOME SCHOOLED': s.home_syntax(target),
420408
'RES: COMMENTS\\': s.comment_syntax(),
421409
'RES: BASIS OF CLAIM\\': s.basis_syntax(target),
410+
'CURRENT ACADEMIC SUSP': s.suspension_syntax(target),
411+
'COLLEGE WORK': s.college_work_syntax(target),
412+
'RES: RESIDENCY CLAIM': s.residency_claim_syntax(target),
413+
'RES: DETERM': s.residency_determ_syntax(target),
414+
'FAMILY OBLIGATIONS': s.family_obj_syntax(target),
415+
'APPLICATION SHARING': s.app_share_syntax(target)
422416
}
423417

424-
for key, value in req_syntax.items():
425-
if target[3] == key:
426-
_list = value
427-
yadd -= 10
418+
for key, value in req_syntax.items():
419+
if target[3] == key:
420+
_list = value
421+
yadd -= 10
428422

429423
if _list != None:
430424
for x in range(len(_list)):
431425
canvas.drawString(xstart, ystart+yadd, str(_list[x]))
432426
yadd -= 10
433427

434428
_list = []
435-
436-
yadd -= 10
429+
# yadd -= 10
437430

438431
conv = struct.transform_page(val)
439-
432+
# if val == 'Med REQ':
433+
# yadd -= 10
434+
440435
if conv != "None":
441436
canvas.drawString(xstart, ystart+yadd, str(conv)) # prints syntax values
442437
# canvas.drawString(xstart, ystart+yadd, val + _str)

core/syntax.py

Lines changed: 190 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -50,15 +50,24 @@ def hs_diploma_syntax(self, _list: list) -> list:
5050
diploma = {
5151
'N': 'No',
5252
'Y': 'Yes',
53+
'K': 'Not provided'
5354
}
5455

5556
target = "".join(_list[-1]).translate(str.maketrans("", "", "\\0"))
5657
target = str(target).split(" ")
5758

5859
output = self.p.process_list(target)
5960

60-
while len(output) < 4:
61-
output.append('Not provided')
61+
if len(output) == 2:
62+
output.append('KK')
63+
64+
while len(output[-1]) != 2:
65+
output[-1] += 'K'
66+
67+
val = output[-1]
68+
del(output[-1])
69+
output.append(val[0])
70+
output.append(val[1])
6271

6372
for idx in range(len(output)):
6473
for key, value in diploma.items():
@@ -69,7 +78,7 @@ def hs_diploma_syntax(self, _list: list) -> list:
6978
f'Location: {output[1]}','',
7079
'Did you live or will you have lived in Texas the 36 months leading up',
7180
'to high school graduation or completion of the GED?', f'{output[2]}', '',
72-
'Also, when you begin the semester for which you are applying, will you have lived',
81+
'When you begin the semester for which you are applying, will you have lived',
7382
'in Texas for the previous 12 months?', f'{output[3]}']
7483

7584
def hs_ged_syntax(self, _list: list) -> list:
@@ -90,7 +99,7 @@ def hs_ged_syntax(self, _list: list) -> list:
9099
target = target.replace('N', "No").replace('Y', "Yes")
91100

92101

93-
return ['If you did not graduate from high school, do you have a DEG or have you completed',
102+
return ['3. If you did not graduate from high school, do you have a DEG or have you completed',
94103
'another high school equivalency program?',
95104
f'{target}','',]
96105

@@ -140,17 +149,19 @@ def prev_syntax(self, _list: list) -> list:
140149
resident_q_1 = str(output[-1][-2]).replace('R', 'Resident (In-state)').replace('U', 'Not provided')
141150
resident_q_2 = str(output[-1][-1]).replace('R', 'Resident (In-state)').replace('U', 'Not provided')
142151

143-
return ['During the 12 months prior to you applying, did you register',
144-
'for a public college or university in Texas?', f'{months_q}', '',
145-
'What Texas public college or university did you last attend?',
146-
f'{attend_q}', '',
147-
'In which terms were you last enrolled?', f'{enrolled_q}', '',
148-
'During you last seemster at a Texa public institution, did you pay resident (in-state)',
149-
'or nonresident (out-of-state) tution?', f'{resident_q_1}', '',
150-
'If you paid in-state tution at your last institution, was it because you were classified',
151-
'as a resdient or because you were non-resident who received a wavier?', f'{resident_q_2}']
152-
153-
return ['During the 12 months prior to you applying, did you register',
152+
return ['Residency Information', '', '1. Residency Information', '',
153+
'During the 12 months prior to you applying, did you register',
154+
'for a public college or university in Texas?', f'{months_q}', '',
155+
'What Texas public college or university did you last attend?',
156+
f'{attend_q}', '',
157+
'In which terms were you last enrolled?', f'{enrolled_q}', '',
158+
'During you last seemster at a Texa public institution, did you pay resident (in-state)',
159+
'or nonresident (out-of-state) tution?', f'{resident_q_1}', '',
160+
'If you paid in-state tution at your last institution, was it because you were classified',
161+
'as a resdient or because you were non-resident who received a wavier?', f'{resident_q_2}']
162+
163+
return ['Residency Information', '', '1. Residency Information', '',
164+
'During the 12 months prior to you applying, did you register',
154165
'for a public college or university in Texas?', 'No']
155166

156167
def basis_syntax(self, _list: list) -> list:
@@ -204,7 +215,8 @@ def comment_syntax(self) -> list:
204215
:rtype: list
205216
"""
206217

207-
return ['Is there any additional information that you believe your college should know in',
218+
return ['General Comments:',
219+
'Is there any additional information that you believe your college should know in',
208220
'evaluating your eligibility to be classified as a resident? If so, please provide.']
209221

210222
def dual_syntax(self, _list: list) -> list:
@@ -241,13 +253,27 @@ def conservator_syntax(self, _list: list) -> list:
241253
if _list[3] != 'CONSERVATORSHIP SWITCHES':
242254
return
243255

244-
target = "".join(_list[-1]).translate(str.maketrans("", "", "\\0"))
256+
target = self.p.process_str(_list[-1])
245257

246-
target = target.replace('N', "No").replace('Y', "Yes")
258+
syntax = {
259+
'N': 'No',
260+
'Y': 'Yes',
261+
'K': 'N\A'
262+
}
263+
264+
if len(target) != 2:
265+
target.append('K')
266+
267+
for idx in range(len(target)):
268+
for key, value in syntax.items():
269+
if key == target[idx]:
270+
target[idx] = value
247271

248-
return ['At anytime in your life were you placed in foster care or adopted from foster care in Texas?',
272+
return ['17. Texas Conservatorship:',
273+
'At anytime in your life were you placed in foster care or adopted from foster care in Texas?',
274+
f'{target[0]}', '',
249275
'If admitted, would your like to receive student foster care info and benefits?',
250-
f'{target}']
276+
f'{target[1]}']
251277

252278
def country_syntax(self, _list: list) -> list:
253279
"""Text fully listing the question given from country application information from
@@ -339,32 +365,163 @@ def vet_syntax(self, _list: list) -> list:
339365
return
340366

341367
syntax = {
342-
'1': 'Veteran',
343-
'2': 'Current US Miliary Service Member',
344-
'3': 'Spouse or Dependen of Veteran or Current Service Member',
345-
'4': 'Spouce or dependent of, or a veteran or current U.S. military servicemember with injury or illness resulting from military service (service-connected injury/illness)',
346-
'5': 'Spouse or dependent of deceased US servicemember'
368+
'1': '\nVeteran',
369+
'2': '\nCurrent US Miliary Service Member',
370+
'3': '\nSpouse or Dependen of Veteran or Current Service Member',
371+
'4': '\nSpouce or dependent of, or a veteran or current U.S. military servicemember with injury or illness',
372+
'4+': 'resulting from military service (service-connected injury/illness)',
373+
'5': '\nSpouse or dependent of deceased US servicemember'
347374
}
348-
print(_list, '\n')
349375

350376
target = str(_list[-1]).replace("\\", "")
351377

352-
output = [str(d) for d in target]
353-
print(output)
378+
output = [str(val) for val in target]
379+
380+
for idx in range(len(output)):
381+
if output[idx] == '4':
382+
output.insert(idx+1, '4+')
383+
354384

355-
356385
for idx in range(len(output)):
357386
for key, value in syntax.items():
358387
if key == output[idx]:
359388
output[idx] = value
360-
361-
389+
362390
if len(output) == 1:
363391
return ['U.S. Military-Veteran Status?',
364392
f'{output}']
365393
elif len(output) == 2:
366394
return ['U.S. Military-Veteran Status?',
367395
f'{output[0]}', f'{output[1]}']
396+
elif len(output) == 3:
397+
return ['U.S. Military-Veteran Status?',
398+
f'{output[0]}', f'{output[1]}', f'{output[2]}']
399+
400+
def home_syntax(self, _list: list) -> list:
401+
402+
if _list[3] != 'HOME SCHOOLED':
403+
return
404+
405+
syntax = {
406+
'N': 'No',
407+
'Y': 'Yes'
408+
}
409+
410+
target = str(_list[-1]).replace("\\", "")
411+
412+
for key, value in syntax.items():
413+
if key == target:
414+
target = value
415+
416+
return ['Home Schooled?',
417+
f'{target}']
418+
419+
def suspension_syntax(self, _list: list) -> list:
420+
421+
if _list[3] != 'CURRENT ACADEMIC SUSP':
422+
return
423+
424+
syntax = {
425+
'N': 'No',
426+
'Y': 'Yes'
427+
}
428+
429+
target = str(_list[-1]).replace("\\", "")
430+
431+
for key, value in syntax.items():
432+
if key == target:
433+
target = value
434+
435+
return ['5. Are you currently on academic suspension from the last college or univeristy attended?',
436+
f'{target}']
437+
438+
def college_work_syntax(self, _list: list) -> list:
439+
440+
if _list[3] != 'COLLEGE WORK':
441+
return
442+
443+
target = str(_list[-1]).replace("\\", "")
444+
445+
syntax = {
446+
'N': 'No',
447+
'Y': 'Yes'
448+
}
449+
450+
for key, value in syntax.items():
451+
if key == target:
452+
target = value
453+
454+
return ['Will you have college credit hours by high school graduation date, if so how many?',
455+
f'{target}']
456+
457+
def family_obj_syntax(self, _list: list) -> list:
458+
459+
if _list[3] != 'FAMILY OBLIGATIONS':
460+
return
461+
462+
target = str(_list[-1]).replace("\\", "")
463+
464+
syntax = {
465+
'N': 'No',
466+
'Y': 'Yes'
467+
}
468+
469+
for key, value in syntax.items():
470+
if key == target:
471+
target = value
472+
473+
return ['Do you have family obligations that keep you from participating in extracurricular activities?',
474+
f'{target}']
475+
476+
def app_share_syntax(self, _list: list) -> list:
477+
478+
if _list[3] != 'APPLICATION SHARING':
479+
return
480+
481+
target = str(_list[-1]).replace("\\", "")
482+
483+
syntax = {
484+
'N': 'No',
485+
'Y': 'Yes'
486+
}
487+
488+
for key, value in syntax.items():
489+
if key == target:
490+
target = value
491+
492+
return ['Application sharing on denied admission?',
493+
f'{target}']
494+
495+
def residency_determ_syntax(self, _list: list) -> list:
496+
497+
if _list[3] != 'RES: DETERM':
498+
return
499+
500+
target = str(_list[-1]).replace("\\", "")
501+
502+
503+
return ['To assist colleges or universities in residency determinations, the ApplyTexas System asks',
504+
'applicants a series of core questions. Based on answers to these questions, the System estimates',
505+
'the residency of each applicant. College or university administrators should make final residency',
506+
'determinations based on rules set out in the Texas Administrative Code Title 19, Part 1, Chapter 21,',
507+
'Subchapter B. The residency determinations are Texas resident (T), Non-Texas resident (N), or Unable',
508+
'to Determine (U).', '',
509+
'Exception codes are provided for applicants with Unable to Determine status, and may be',
510+
'provided for applicants with Texas resident status, if the applicant needs to provide more',
511+
'information or verification of status. It is recommended that institutions verify this information.', '',
512+
'Note: The residency determination is not visible to the applicant.', '',
513+
f'Applytexas Residency Determination: {target}']
514+
515+
def residency_claim_syntax(self, _list: list) -> list:
516+
517+
if _list[3] != 'RES: RESIDENCY CLAIM':
518+
return
519+
520+
target = str(_list[-1]).replace("\\", "")
521+
target = target.strip()
522+
523+
return ['Of what state or country are you a resident?',
524+
f'{target[:3]}--{target[3:]}']
368525

369526
def residency_self_syntax(self, _list: list) -> list:
370527

@@ -378,7 +535,7 @@ def residency_self_syntax(self, _list: list) -> list:
378535

379536
ans = self.p.process_self(output)
380537

381-
return ['Residency Information:',
538+
return ['Residency Information - continued:', '',
382539
'4. If you are not a U.S. Citizen or U.S. Permanent Resident, are youa foreign national',
383540
'here with a visa eligible to domicile in the United States or are you a Refugee, Asylee,',
384541
'Parolee or here under Temporary Protective Status? If so, indicate which:', f'{ans[0]}', '',
@@ -414,7 +571,7 @@ def residency_guar_syntax(self, _list: list) -> list:
414571

415572
ans = self.p.process_guar(output)
416573

417-
return ['Residency Information:',
574+
return ['Residency Information - continued:', '',
418575
'1. Is the parent or legal guardian upon whom you base your claim of residency a U.S.',
419576
'Citizen?', f'{ans[0]}', '',
420577
'2. If no, does the parent or legal guardian upopn whom you base your claim residency',

0 commit comments

Comments
 (0)