diff --git a/wp-content/themes/pub/wporg-learn-2024/assets/icon-check.svg b/wp-content/themes/pub/wporg-learn-2024/assets/icon-check.svg index c70f8a3e3..713b712e6 100644 --- a/wp-content/themes/pub/wporg-learn-2024/assets/icon-check.svg +++ b/wp-content/themes/pub/wporg-learn-2024/assets/icon-check.svg @@ -1,3 +1,4 @@ diff --git a/wp-content/themes/pub/wporg-learn-2024/inc/block-hooks.php b/wp-content/themes/pub/wporg-learn-2024/inc/block-hooks.php index cad3a7afb..6826af6bb 100644 --- a/wp-content/themes/pub/wporg-learn-2024/inc/block-hooks.php +++ b/wp-content/themes/pub/wporg-learn-2024/inc/block-hooks.php @@ -11,7 +11,9 @@ add_filter( 'render_block_data', __NAMESPACE__ . '\modify_header_template_part' ); add_filter( 'render_block_data', __NAMESPACE__ . '\modify_course_outline_lesson_block_attrs' ); -add_filter( 'render_block_sensei-lms/course-outline', __NAMESPACE__ . '\update_course_outline_block_add_aria', 10, 2 ); +add_filter( 'render_block_sensei-lms/course-outline', __NAMESPACE__ . '\update_course_outline_block_add_aria' ); +add_filter( 'render_block_sensei-lms/course-theme-notices', __NAMESPACE__ . '\update_lesson_quiz_notice_text' ); +add_filter( 'render_block_sensei-lms/quiz-actions', __NAMESPACE__ . '\update_quiz_actions' ); /** * Update header template based on current query. @@ -83,11 +85,10 @@ function modify_course_outline_lesson_block_attrs( $parsed_block ) { * individually, so they cannot be independently filtered. * * @param string $block_content The block content. - * @param array $block The full block, including name and attributes. * * @return string The updated icon HTML with aria data. */ -function update_course_outline_block_add_aria( $block_content, $block ) { +function update_course_outline_block_add_aria( $block_content ) { $html = new WP_HTML_Tag_Processor( $block_content ); $label = ''; @@ -106,3 +107,84 @@ function update_course_outline_block_add_aria( $block_content, $block ) { } return $html->get_updated_html(); } + +/** + * Replace the text for the lesson quiz notice. + * + * @param string $block_content The block content. + * + * @return string + */ +function update_lesson_quiz_notice_text( $block_content ) { + if ( is_singular( 'lesson' ) && is_quiz_ungraded() ) { + // Remove the text "Awaiting grade" in the quiz notice. + $block_content = str_replace( + '
%s
', + esc_html__( 'This is an ungraded quiz. Use it to check your comfort level with what you’ve learned.', 'wporg-learn' ) + ); + + $block_content = str_replace( + '