StrangeIB commited on
Commit
4951c88
Β·
1 Parent(s): 2fd90c5

Rewrite app copy: friendly ask, skimmable Q&A, detailed consent, CTA

Browse files
Files changed (1) hide show
  1. app.py +95 -44
app.py CHANGED
@@ -16,92 +16,143 @@ from redactors import engine
16
 
17
  PASSPHRASE = os.environ.get("APP_PASSPHRASE", "")
18
 
 
 
 
 
19
  st.set_page_config(page_title="STARS Report Redactor", page_icon="πŸ›‘οΈ",
20
  layout="centered")
21
 
22
- st.title("πŸ›‘οΈ STARS Report Redactor")
23
- st.caption("Remove your personal information and grades from a USC STARS "
24
- "Degree Progress Report before sharing it with the BUAI Builder Hub (BBH).")
 
 
 
 
 
 
 
 
 
 
 
 
 
25
 
26
- with st.expander("What this does and how your file is handled", expanded=True):
27
  st.markdown(
28
- "- **Removes** your name, student ID, mailing address, and sport/team.\n"
29
- "- **Replaces every grade** with a pass/fail marker and **blanks out GPA** figures.\n"
30
- "- Your uploaded file is processed **in memory on the server and is never "
31
- "saved or logged** β€” only you receive the redacted copy.\n"
32
- "- This is redaction, **not perfect anonymization**: your major, terms, and "
33
- "course list remain, which could be identifying in a small program. "
34
- "Please share only if you consent."
35
  )
36
 
37
- with st.expander("How to download your STARS report (PDF)"):
38
  st.markdown(
39
- "1. Go to **experience.usc.edu** and open **My Academics**.\n"
40
  "2. Open your **STARS** (Degree Progress) report.\n"
41
- "3. Click the **red Print button** at the top of the report.\n"
42
- "4. In the print dialog, set the destination to **Save as PDF** and save the file.\n"
43
- "5. Upload that saved PDF below."
 
 
 
 
 
 
 
 
 
44
  )
45
 
46
- # --- access gate -----------------------------------------------------------
 
 
47
  if not PASSPHRASE:
48
- st.error("This app isn't configured yet (no access phrase set). "
49
- "Please contact the team.")
50
  st.stop()
51
 
52
- entered = st.text_input("Access phrase", type="password",
53
- help="Provided to you by the BBH team.")
 
54
  if entered.strip() != PASSPHRASE:
55
  if entered:
56
- st.warning("That access phrase isn't right. Please try again.")
57
  st.stop()
58
 
59
- # --- redaction flow --------------------------------------------------------
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
60
  consent = st.checkbox(
61
- "I consent to share my redacted STARS report with the BUAI Builder Hub (BBH).")
62
 
63
  uploaded = st.file_uploader(
64
  "Upload your STARS report (the PDF you saved from experience.usc.edu)",
65
  type=["pdf"], accept_multiple_files=False)
66
 
67
  if uploaded is not None and not consent:
68
- st.info("Please check the consent box above to proceed.")
69
 
70
  if uploaded is not None and consent:
71
- with st.spinner("Redacting…"):
72
  res, out = engine.redact_bytes(uploaded.getvalue(), {"pii", "grades"})
73
 
74
  status = res["status"]
75
  if status in ("REDACTED", "REVIEW") and out:
76
  g = res.get("grades", {})
77
- st.success("Done β€” your redacted report is ready below.")
78
  st.write(
79
- f"Removed **{len(res.get('pii', {}))}** identifier field(s), "
80
- f"**{g.get('grades_replaced', 0)}** grade(s), and "
81
- f"**{g.get('gpa_replaced', 0)}** GPA/points figure(s)."
82
  )
83
  if res.get("fragments"):
84
- st.info("Part of your name may still appear inside a course title; "
85
- "the team will double-check before use.")
86
 
87
  stem = os.path.splitext(uploaded.name)[0]
88
  stem = stem.replace("DONOTSHARE_", "").replace("REDACTED_", "")
89
- st.download_button("⬇️ Download redacted PDF", data=out,
90
  file_name=f"REDACTED_{stem}.pdf",
91
  mime="application/pdf")
92
- st.caption("Download it, open it to confirm it looks right, then send it "
93
- "to the team as instructed.")
94
 
95
  elif status == "SKIPPED":
96
- st.error("This PDF looks like a **scan** (it has no text layer), so it "
97
- "can't be redacted here. Please use the PDF you save via the "
98
- "**Print β†’ Save as PDF** steps above on experience.usc.edu, "
99
- "rather than a scanned or photographed copy.")
100
  else:
101
- st.error("The redaction could not be fully verified, so **no file was "
102
- "produced**. Please contact the team β€” and do not share the "
103
- "original in the meantime.")
104
 
105
  st.divider()
106
- st.caption("Internal tool of the BUAI Builder Hub (BBH) / BBHCourseReg project. "
107
- "Processing happens in memory; no files are stored.")
 
16
 
17
  PASSPHRASE = os.environ.get("APP_PASSPHRASE", "")
18
 
19
+ # Where students should send questions / ask to have their report removed.
20
+ # TODO: replace with a real BBH contact email.
21
+ CONTACT = "the BBH team"
22
+
23
  st.set_page_config(page_title="STARS Report Redactor", page_icon="πŸ›‘οΈ",
24
  layout="centered")
25
 
26
+ # ---------------------------------------------------------------- the ask ----
27
+ st.title("πŸ› οΈ Help us build better tools for USC students")
28
+
29
+ st.markdown(
30
+ "BBH (the **BUAI Builder Hub**) is hard at work building tools to make "
31
+ "**degree planning, course registration, and picking classes** way less of "
32
+ "a headache. One thing y'all keep telling us is a pain: actually "
33
+ "**making sense of your STARS report**.\n\n"
34
+ "**You can help.** We're putting together a set of STARS reports to build "
35
+ "against. If you're down, upload yours below β€” we'll strip out the sensitive "
36
+ "stuff (**your name, address, student ID, and grades**) right here, and only "
37
+ "ever keep the **redacted** version."
38
+ )
39
+
40
+ # ------------------------------------------------------------------- Q & A ----
41
+ st.subheader("Quick questions you might have")
42
 
43
+ with st.expander("Wait β€” are my grades going in a database?"):
44
  st.markdown(
45
+ "Nope. Before anything gets saved, we swap **every grade for a plain "
46
+ "\"passed / didn't pass\" marker** and **wipe your GPA**. The copy we keep "
47
+ "literally doesn't have your letter grades in it β€” we can tell a class was "
48
+ "finished, not what you got in it."
 
 
 
49
  )
50
 
51
+ with st.expander("How do I even get my STARS report?"):
52
  st.markdown(
53
+ "1. Go to **experience.usc.edu** β†’ **My Academics**.\n"
54
  "2. Open your **STARS** (Degree Progress) report.\n"
55
+ "3. Hit the **red Print button** up top.\n"
56
+ "4. In the print pop-up, pick **Save as PDF** and save it.\n"
57
+ "5. Upload that PDF here. (Grab the real PDF from the site β€” a screenshot "
58
+ "or scan won't work.)"
59
+ )
60
+
61
+ with st.expander("Why should I bother?"):
62
+ st.markdown(
63
+ "You'd be helping build tools that make planning your degree and getting "
64
+ "into the classes you need way less painful β€” for you *and* everyone after "
65
+ "you. It takes about two minutes, and your personal info and grades get "
66
+ "stripped out before anything is stored. That's it."
67
  )
68
 
69
+ st.markdown("### Ready? Let's do it πŸ‘‡")
70
+
71
+ # --------------------------------------------------------------- pass gate ----
72
  if not PASSPHRASE:
73
+ st.error("This app isn't set up yet (no passphrase configured). Ping the team.")
 
74
  st.stop()
75
 
76
+ entered = st.text_input("Passphrase", type="password")
77
+ st.caption("If you're a USC student using this, whoever referred you should've "
78
+ "shared a passphrase.")
79
  if entered.strip() != PASSPHRASE:
80
  if entered:
81
+ st.warning("Hmm, that's not it β€” double-check with whoever sent you here.")
82
  st.stop()
83
 
84
+ # ------------------------------------------------------- consent + upload ----
85
+ with st.expander("πŸ“‹ Please read this before you upload β€” what you're agreeing to",
86
+ expanded=True):
87
+ st.markdown(
88
+ "- **This is totally voluntary.** You don't have to do it, and you can "
89
+ "close this page anytime. No penalty, no hard feelings.\n"
90
+ "- **What we keep:** only the **redacted** version of your STARS report β€” "
91
+ "the file this tool hands back after removing your personal info.\n"
92
+ "- **What's removed before anything is stored:** your **name, USC ID, "
93
+ "mailing address, sport/team**, every **letter grade** (each becomes a "
94
+ "simple pass/fail marker), and your **GPA**.\n"
95
+ "- **What stays in the file:** your **major/minor, the courses and terms "
96
+ "on your record, and your degree-progress details** β€” that's the part "
97
+ "we're actually building with.\n"
98
+ "- **Heads up on anonymity:** because that academic info stays in, we "
99
+ "**can't promise you're impossible to identify** β€” in a small major, "
100
+ "someone who already knows your situation might be able to guess. Only "
101
+ "share if you're comfortable with that.\n"
102
+ "- **Your original file** is processed on the spot and **not saved** by "
103
+ "this tool. You download the redacted copy yourself; if you send it back "
104
+ "to us, we store **only that redacted copy**.\n"
105
+ "- **How we use it:** to build and test tools that help USC students plan "
106
+ "degrees and register for classes. We won't sell it or try to identify "
107
+ "you.\n"
108
+ f"- **Changed your mind later?** It's your record and your call β€” you can "
109
+ f"ask us to delete your redacted report anytime. Contact {CONTACT}."
110
+ )
111
+
112
  consent = st.checkbox(
113
+ "I've read the above and I'm good with sharing my **redacted** STARS report.")
114
 
115
  uploaded = st.file_uploader(
116
  "Upload your STARS report (the PDF you saved from experience.usc.edu)",
117
  type=["pdf"], accept_multiple_files=False)
118
 
119
  if uploaded is not None and not consent:
120
+ st.info("Check the consent box above and you're good to go.")
121
 
122
  if uploaded is not None and consent:
123
+ with st.spinner("Scrubbing your info…"):
124
  res, out = engine.redact_bytes(uploaded.getvalue(), {"pii", "grades"})
125
 
126
  status = res["status"]
127
  if status in ("REDACTED", "REVIEW") and out:
128
  g = res.get("grades", {})
129
+ st.success("Done! Your redacted report is ready below. πŸŽ‰")
130
  st.write(
131
+ f"We removed **{len(res.get('pii', {}))}** personal detail(s), turned "
132
+ f"**{g.get('grades_replaced', 0)}** grade(s) into pass/fail markers, and "
133
+ f"wiped **{g.get('gpa_replaced', 0)}** GPA/points number(s)."
134
  )
135
  if res.get("fragments"):
136
+ st.info("Part of your name might still show up inside a course title β€” "
137
+ "we'll double-check that on our end.")
138
 
139
  stem = os.path.splitext(uploaded.name)[0]
140
  stem = stem.replace("DONOTSHARE_", "").replace("REDACTED_", "")
141
+ st.download_button("⬇️ Download my redacted report", data=out,
142
  file_name=f"REDACTED_{stem}.pdf",
143
  mime="application/pdf")
144
+ st.caption("Open it to make sure it looks right, then send it back to "
145
+ "whoever referred you (or to the BBH team). Thank you! πŸ™")
146
 
147
  elif status == "SKIPPED":
148
+ st.error("This looks like a **scan or photo** (no text in it), so it can't "
149
+ "be redacted here. Grab the actual PDF via **Print β†’ Save as PDF** "
150
+ "on experience.usc.edu and try again.")
 
151
  else:
152
+ st.error("Something didn't check out, so we **didn't produce a file** β€” "
153
+ f"better safe than sorry. Please reach out to {CONTACT}, and "
154
+ "don't share the original in the meantime.")
155
 
156
  st.divider()
157
+ st.caption("A BUAI Builder Hub (BBH) project. Your file is processed in memory; "
158
+ "nothing is stored by this tool.")