Merged
Conversation
Contributor
|
Test the previous changes of this PR with WordPress Playground. |
Contributor
|
Test the previous changes of this PR with WordPress Playground. |
Contributor
Author
|
|
Contributor
|
Test the previous changes of this PR with WordPress Playground. |
Imran92
reviewed
Mar 28, 2025
| $grade_rounded | ||
| ); | ||
|
|
||
| if ( get_locale() === 'en_US' || ( function_exists( 'has_translation' ) && has_translation( 'You must score at least %1$s%% to pass this quiz. Your grade is %2$s%%.', 'sensei-lms' ) ) ) { |
Contributor
There was a problem hiding this comment.
Can we extract these three checks to a helper function? 🤔
Contributor
Author
073146c to
961c171
Compare
Contributor
|
Test the previous changes of this PR with WordPress Playground. |
Contributor
|
Test the previous changes of this PR with WordPress Playground. |
961c171 to
38522d5
Compare
38522d5 to
83314ea
Compare
renatho
commented
Mar 28, 2025
| // Quiz grade. | ||
| $submission = Sensei()->quiz_submission_repository->get( $quiz_id, $user_id ); | ||
| $quiz_grade = $submission ? $submission->get_final_grade() : 0; | ||
| $quiz_grade = ( $submission ? $submission->get_final_grade() : 0 ) ?? 0; |
Contributor
Author
There was a problem hiding this comment.
It's just fixing a psalm issue.
Contributor
|
Test the previous changes of this PR with WordPress Playground. |
Contributor
|
Test the previous changes of this PR with WordPress Playground. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Resolves #7788
Proposed Changes
has_translationfunction (introduced in WP 6.7). The strings won't be translated in older versions until we remove the conditionals.Testing Instructions
Screenshots
Pre-Merge Checklist