Skip to content
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

Convert Sentence length and paragraph length to use HTML parser and enable AI button for both assessments #21866

Open
wants to merge 16 commits into
base: trunk
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Enable AI button for SentenceLengthInTextAssessment.js and ParagraphT…
…ooLongAssessment.js
  • Loading branch information
FAMarfuaty committed Nov 27, 2024
commit 151132ed58d6564b47f99c2763cf554607468ecf
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,9 @@ export default class ParagraphTooLongAssessment extends Assessment {
}

assessmentResult.setScore( score );

if ( score < 9 ) {
assessmentResult.setHasAIFixes( true );
}
if ( score >= 7 ) {
assessmentResult.setHasMarks( false );
assessmentResult.setText( sprintf(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,9 @@ class SentenceLengthInTextAssessment extends Assessment {
const score = this.calculateScore( percentage );

const assessmentResult = new AssessmentResult();
if ( score < 9 ) {
assessmentResult.setHasAIFixes( true );
}

assessmentResult.setScore( score );
assessmentResult.setText( this.translateScore( score, percentage ) );
Expand Down