-
-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
(Contributor Recognition Infrastructure) Milestone2.4: Add certificate generation for contributors (including service method, API controller) #16513
Conversation
Merged with uostream
merged with develop
Hi @chris7716, it looks like some changes were requested on this pull request by @vojtechjelinek. PTAL. Thanks! |
Hi @chris7716, I'm going to mark this PR as stale because it hasn't had any updates for 7 days. If no further activity occurs within 4 days, it will be automatically closed so that others can take up the issue. |
…ne2.4 Update branch
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.
Thanks! Took a pass.
|
||
if suggestion_type == feconf.SUGGESTION_TYPE_TRANSLATE_CONTENT: | ||
language = self.normalized_request['language'] | ||
language = self.normalized_request.get('language') |
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.
language = self.normalized_request.get('language') | |
language = self.normalized_request['language'] |
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 think we will have to use the self.normalized_request.get('language')
because when generating the question certificate, we do not include language param in the request and it throws KeyError: 'language'
if we use self.normalized_request['language']
We can get the the default value which is set as None
if we use self.normalized_request.get('language')
when language is not included in the request.
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.
Ah, right, sorry.
core/domain/suggestion_services.py
Outdated
# Go to the below link for more information about how we count hours | ||
# contributed.# Goto the below link for more information. | ||
# https://docs.google.com/spreadsheets/d/1ykSNwPLZ5qTCkuO21VLdtm_2SjJ5QJ0z0PlVjjSB4ZQ/edit?usp=sharing | ||
hours_contributed = round((words_count / 300), 2) |
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.
hours_contributed = round((words_count / 300), 2) | |
hours_contributed = round(words_count / 300, 2) |
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.
Done
core/domain/suggestion_services.py
Outdated
# Go to the below link for more information about how we count hours | ||
# contributed. | ||
# https://docs.google.com/spreadsheets/d/1ykSNwPLZ5qTCkuO21VLdtm_2SjJ5QJ0z0PlVjjSB4ZQ/edit?usp=sharing | ||
hours_contributed = round((minutes_contributed / 60), 2) |
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.
hours_contributed = round((minutes_contributed / 60), 2) | |
hours_contributed = round(minutes_contributed / 60, 2) |
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.
Done
createCertificate(response: ContributorCertificateResponse): void { | ||
const canvas = document.createElement('canvas'); | ||
const currentDate = new Date(); | ||
const dateOptions: Intl.DateTimeFormatOptions = { |
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.
Can you explain that in code comment?
// Textual parts are starting when y coordinate is equals to 350. | ||
let linePosition = 350; | ||
const image = new Image(this.LOGO_WIDTH, this.LOGO_HEIGHT); | ||
image.src = '/assets/images/contributor_dashboard/oppia-logo.jpg'; |
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.
Should this path be placed into a constant?
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.
Done
Unassigning @vojtechjelinek since the review is done. |
Hi @chris7716, it looks like some changes were requested on this pull request by @vojtechjelinek. PTAL. Thanks! |
…ne2.4 Update branch
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.
Thanks! LGTM!
|
||
if suggestion_type == feconf.SUGGESTION_TYPE_TRANSLATE_CONTENT: | ||
language = self.normalized_request['language'] | ||
language = self.normalized_request.get('language') |
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.
Ah, right, sorry.
Hi @chris7716, this PR is ready to be merged. Please address any remaining comments prior to merging, and feel free to merge this PR once the CI checks pass and you're happy with it. Thanks! |
…ne2.4 Update branch
Overview
This branch is taken from the milestone2.2 branch so there are some optional files changed that is not related to this PR. You can review the below files which are only related to this PR.
Essential Checklist
Proof that changes are correct
Screen.Recording.2022-12-07.at.08.57.09.mov
Proof of changes on desktop with slow/throttled network
Proof of changes on mobile phone
Proof of changes in Arabic language
PR Pointers