Skip to content

Commit

Permalink
Merge branch 'trunk' into update/awaiting-grade-notice
Browse files Browse the repository at this point in the history
  • Loading branch information
donnapep authored Oct 2, 2023
2 parents aad95d5 + ad6ac8c commit 79aa33b
Show file tree
Hide file tree
Showing 25 changed files with 339 additions and 55 deletions.
2 changes: 1 addition & 1 deletion .github/actions/install-php/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ inputs:
php-version:
description: 'The PHP version to use'
required: false
default: '7.3'
default: '7.4'

extensions:
description: 'The PHP extensions to use'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ jobs:
strategy:
fail-fast: false
matrix:
php: [7.3, 8.1]
php: [7.4, 8.1]
steps:
- name: Download Build Artifact
uses: actions/download-artifact@v3
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/php.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '7.3'
php-version: '7.4'
tools: composer
coverage: none

Expand Down Expand Up @@ -59,16 +59,16 @@ jobs:
matrix:
wp: ['latest']
wpmu: [0]
php: ['7.3', '7.4', '8.0']
php: ['7.4', '8.0']
include:
- php: 7.3
- php: 7.4
wp: '6.1'
- php: 7.3
- php: 7.4
wp: '6.2'
- php: 7.3
- php: 7.4
wp: latest
wpmu: 1
- php: 7.3
- php: 7.4
wp: nightly
env:
WP_VERSION: ${{ matrix.wp }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/psalm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
fail-fast: true
max-parallel: 10
matrix:
php: ['7.3', '8.2']
php: ['7.4', '8.2']
steps:
- name: Checkout code
uses: actions/checkout@v3
Expand Down
43 changes: 27 additions & 16 deletions assets/blocks/quiz/question-block/question.scss
Original file line number Diff line number Diff line change
Expand Up @@ -119,19 +119,23 @@ $question-input-border-color: var(--wp--preset--color--foreground, #155E65 );

.sensei-lms-question__answer-feedback {
--color: #DCDCDE;
$horizontal-padding: 24px;
border: 1px solid var(--color);
border: 2px solid var(--border-color);
border-radius: 1px;
font-family: var(--wp--preset--font-family--system, var(--wp--preset--font-family--body-font));
margin: 12px auto;
color: #1e1e1e;
font-size: 1.125rem;

&--correct {
--color: #B8E6BF;
--icon: '\f058';
--color: #d6edda;
--border-color: #5c936b;
--icon: "\f15e";
}

&--incorrect {
--color: #F7DCC6;
--icon: '\f057';
--border-color: #cf8b25;
--color: #faebe0;
--icon: "\f335";
}

&.empty {
Expand All @@ -140,21 +144,20 @@ $question-input-border-color: var(--wp--preset--color--foreground, #155E65 );

&__header {
display: flex;
padding: 6px $horizontal-padding;
padding: 14px;
background: var(--color);
font-size: 80%;
align-items: center;
}
&__title {
flex: 1;
}

&__points {
font-weight: bold;
&__content {
padding: 18px;
}

&__content {
padding: 12px $horizontal-padding;
&__answer-notes > *:first-child {
margin-top: 0;
}

&__correct-answer {
Expand All @@ -177,10 +180,18 @@ $question-input-border-color: var(--wp--preset--color--foreground, #155E65 );
}
}

&__icon:after {
content: var(--icon);
font-family: FontAwesomeSensei, FontAwesome, sans-serif;
margin-right: 6px;
&__icon {
display: flex;

&:after {
box-sizing: border-box;
color: var(--border-color);
content: var(--icon);
font-family: dashicons, sans-serif;
font-size: 1.5rem;
line-height: 1;
margin-right: 8px;
}
}

}
16 changes: 14 additions & 2 deletions assets/course-theme/blocks/quiz-blocks/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@ import quizActionsMeta from './quiz-actions.block.json';
import quizBackToLessonMeta from './quiz-back-to-lesson.block.json';
import quizProgressMeta from './quiz-progress.block.json';

/**
* External dependencies
*/
import classNames from 'classnames';

const meta = {
attributes: {},
icon: {
Expand Down Expand Up @@ -64,9 +69,16 @@ export default [
'Return to the lesson the quiz belongs to.',
'sensei-lms'
),
edit() {
edit: function EditQuizBackToLesson() {
const blockProps = useBlockProps( {
className: classNames(
'sensei-lms-href',
'sensei-lms-quiz-back-to-lesson'
),
} );

return (
<span className="sensei-lms-href sensei-lms-quiz-back-to-lesson">
<span { ...blockProps }>
<ChevronLeft />
{ __( 'Back to lesson', 'sensei-lms' ) }
</span>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"name": "sensei-lms/quiz-back-to-lesson",
"apiVersion": 2,
"category": "theme",
"supports": {
"align": true,
Expand Down
36 changes: 23 additions & 13 deletions assets/css/3rd-party/themes/course/quiz.scss
Original file line number Diff line number Diff line change
Expand Up @@ -12,26 +12,36 @@
}
}
}

.wp-block-sensei-lms-quiz-actions {
button:disabled {
opacity: 0.4;
}
}

#sensei-quiz-list {
margin: 0 0 clamp(3.75rem, 2.5rem + 3.333vw, 5rem) 0;
}

.quiz {
.sensei-course-theme__quiz {
&__main-content {
.wp-block-post-title {
margin-bottom: 3.75rem;
}
}
&__footer {
.sensei-quiz-actions {
.sensei-quiz-action {
button {
padding: 1rem 32px;
}
}
.sensei-quiz-actions-secondary {
.sensei-quiz-action {
button {
font-family: var( --wp--preset--font-family--body );
}
}
}

.sensei-quiz-actions {
.sensei-quiz-action {
button {
padding: 1rem 32px;
}
}
.sensei-quiz-actions-secondary {
.sensei-quiz-action {
button {
font-family: var( --wp--preset--font-family--body );
}
}
}
Expand Down
15 changes: 15 additions & 0 deletions assets/css/3rd-party/themes/divi/learning-mode.scss
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,21 @@ $desktop_min_width: 783px;
padding-bottom: 0;
}

.wp-block-post-content {
.sensei-lms-question__answer-feedback {
&__content {
padding-bottom: 18px;

p {
margin-bottom: 1.6em;
}
}

&__header {
padding: 14px;
}
}
}

.sensei-course-theme__frame .sensei-course-theme-course-progress-bar-inner {
background-color: var(--sensei-primary-color);
Expand Down
6 changes: 5 additions & 1 deletion assets/css/frontend.scss
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,6 @@ a.sensei-certificate-link {
.quiz {
form {
#sensei-quiz-list {
margin: 0 0 1.618em 0;
list-style-position: inside;
list-style-type: none;
padding-inline-start: 0;
Expand Down Expand Up @@ -521,6 +520,11 @@ div.sensei-quiz-actions {
.sensei-quiz-action {
.button, button {
@include button-link;
text-decoration: none;

&:hover {
text-decoration: underline;
}
}
}
}
Expand Down
16 changes: 16 additions & 0 deletions assets/css/sensei-course-theme/quiz-compat.scss
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,22 @@ $textColor: #1E1E1E;
}
}

.wp-block-sensei-lms-quiz-actions {
button:disabled {
opacity: 0.6;
}

.sensei-quiz-actions-secondary {
.sensei-course-theme__button.is-link {
color: var(--sensei-primary-color);
}
}
}

#sensei-quiz-list {
margin: 0 0 3.75rem 0;
}

.quiz {
form {
#sensei-quiz-list {
Expand Down
8 changes: 8 additions & 0 deletions assets/css/sensei-course-theme/quiz.scss
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,14 @@ $vertical-spacing-desktop: 80px;
text-decoration: none;
}

.wp-block-sensei-lms-quiz-actions {
button:disabled {
cursor: not-allowed;
pointer-events: none;
width: auto;
}
}

.sensei-progress-bar {
&__bar {
height: 12px;
Expand Down
4 changes: 4 additions & 0 deletions changelog/add-changed-styles-for-question-feedback
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: minor
Type: changed

Changed styles for graded question answer feedbacks
4 changes: 4 additions & 0 deletions changelog/add-stylings-for-footer-in-awaiting-grade-quiz-lm
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: minor
Type: changed

Changed footer style for quizzes awaiting grading
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: minor
Type: fixed

Fixed back to lesson block to apply block styles in quiz navigation area
4 changes: 4 additions & 0 deletions changelog/update-php-version
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: patch
Type: changed

Bump minimum required PHP version to 7.4
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"woocommerce/action-scheduler": "3.6.2"
},
"require-dev": {
"php": "^7.3 || ^8",
"php": "^7.4 || ^8",
"automattic/jetpack-changelogger": "3.3.5",
"bamarni/composer-bin-plugin": "1.8.2",
"dealerdirect/phpcodesniffer-composer-installer": "1.0.0",
Expand Down Expand Up @@ -95,7 +95,7 @@
"optimize-autoloader": true,
"sort-packages": true,
"platform": {
"php": "7.3"
"php": "7.4"
},
"allow-plugins": {
"dealerdirect/phpcodesniffer-composer-installer": true,
Expand Down
7 changes: 7 additions & 0 deletions includes/blocks/course-theme/class-lesson-actions.php
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,13 @@ public function render( array $attributes = [] ): string {

$course_id = Sensei()->lesson->get_course_id( $lesson_id );

$is_learning_mode = \Sensei_Course_Theme_Option::has_learning_mode_enabled( $course_id );
$is_awaiting_grade = \Sensei_Quiz::is_quiz_awaiting_grade_for_user( $lesson_id, $user_id );

if ( $is_learning_mode && $is_awaiting_grade && 'quiz' === get_post_type() ) {
return '';
}

if (
! Sensei_Course::is_user_enrolled( $course_id )
) {
Expand Down
4 changes: 2 additions & 2 deletions includes/class-sensei-dependency-checker.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
* @since 2.0.0
*/
class Sensei_Dependency_Checker {
const MINIMUM_PHP_VERSION = '7.3';
const FUTURE_MINIMUM_PHP_VERSION = '7.3';
const MINIMUM_PHP_VERSION = '7.4';
const FUTURE_MINIMUM_PHP_VERSION = '7.4';

/**
* Checks for our PHP version requirement.
Expand Down
2 changes: 1 addition & 1 deletion includes/class-sensei-question.php
Original file line number Diff line number Diff line change
Expand Up @@ -1044,7 +1044,7 @@ class="sensei-lms-question__answer-feedback__title"><?php echo wp_kses_post( $an
<?php if ( $correct_answer ) { ?>
<div class="sensei-lms-question__answer-feedback__correct-answer">
<?php echo wp_kses_post( __( 'Right Answer:', 'sensei-lms' ) ); ?>
<strong><?php echo wp_kses_post( $correct_answer ); ?></strong>
<?php echo wp_kses_post( $correct_answer ); ?>

Check warning on line 1047 in includes/class-sensei-question.php

View check run for this annotation

Codecov / codecov/patch

includes/class-sensei-question.php#L1047

Added line #L1047 was not covered by tests
</div>
<?php } ?>
<?php if ( $has_answer_notes ) { ?>
Expand Down
Loading

0 comments on commit 79aa33b

Please sign in to comment.