-
Notifications
You must be signed in to change notification settings - Fork 481
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
write CSF course name onto blank certificate #46829
Conversation
…ustomize-csf-blank
Your screencasts are so helpful. I'm having trouble verifying this works locally though:
I pulled your branch, ran |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changes look good to me (but I didn't try to pull the branch and run it like Meg's doing). Thanks for continuing to push on this!
Apologies, Meg. For some reason, you have to be running the dashboard server on Linux for writing onto certificates to work. I tried to set up an adhoc, but it kept failing due to known issues which infra is working on, so I took the screenshots against a server running on a developer EC2 instance. I think that explains the first 2 anomalies, but I'll have to look into the 3rd next week. |
@megcrenshaw I think this looks like you may not have had the experiment enabled on dashboard. unfortunately, you have to enable it on both dashboard AND pegasus. you can see this happening in the UI tests: code-dot-org/dashboard/test/ui/features/hour_of_code/hour_of_code_finish.feature Lines 61 to 65 in 6b5f4fc
|
Ah, thanks! That was the problem. Name doesn't come through locally, but it's not the Hour of Code certificate: |
mee: require('@cdo/static/MC_Hour_Of_Code_Certificate_mee.png'), | ||
mee_empathy: require('@cdo/static/MC_Hour_Of_Code_Certificate_mee_empathy.png'), | ||
mee_timecraft: require('@cdo/static/MC_Hour_Of_Code_Certificate_mee_timecraft.png') | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hurray deleted files!
@@ -33,13 +31,20 @@ class CertificateImagesControllerTest < ActionController::TestCase | |||
assert_includes response.body, 'invalid donor name' | |||
end | |||
|
|||
test 'can show certificate image given bogus course name' do |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like that you added a test to document undesired behavior and then revised the test once the functionality was as desired
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code looks great! I verified what I could locally. Nice work, and thanks for the thorough documentation
Thank you both for the thorough review! I tried one last time to start an adhoc, but no luck 🤷 |
Background
Finishes PLAT-1735. Here is the current state of the world:
Most importantly, when completing a course:
For more diagrams and next steps, see congrats page work plan.
Description
The goal of this PR is that when you complete a CSF course with the experiment enabled, you should see the course name printed onto a blank certificate (see 1st screenshot). In order to accomplish that, this PR does the following things:
default_random_donor
param tocreate_course_certificate_image
, and use it to limit random donor selection so that this method never provides a random donor when called from dashboard (e2b1624)Steps 1-3 are necessary to get blank csf certificates to appear properly on
/certificates/
and/print_certificates/
pages (see 1st screenshot/video for a refresher). step 4 is also necessary to get blank csf certificates to appear properly on/congrats/
.Also worth noting that step 4 is a "visible" change even for users without the experiment, in the sense that it changes the url used to display the certificate image for HOC tutorials. However, the image itself should be identical (see last screenshot).
Screenshots
new behavior for finishing CSF congrats page, with experiment:
Screen.Recording.2022-06-13.at.9.37.24.AM.mov
after going to code.org/congrats/course1?enableExperiments=studioCertificate (before / after):
after completing the oceans tutorial, with or without experiment (before / after):
no image rendered with a bogus course name (just trying to keep us out of trouble here):
Testing story
Follow-up work