Skip to content

Commit

Permalink
Merge pull request #2782 from gocodebox/dev
Browse files Browse the repository at this point in the history
Release 7.8
  • Loading branch information
brianhogg authored Oct 29, 2024
2 parents a5e02b8 + fde3350 commit c047f22
Show file tree
Hide file tree
Showing 81 changed files with 2,231 additions and 768 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ assets/js/llms-admin-elementor-editor.asset.php
assets/js/*.min.js
assets/js/llms-metaboxes.js
blocks/certificate-title/*
blocks/my-account/*
includes/class.llms.l10n.js.php
languages/lifterlms.pot

Expand Down
54 changes: 54 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,60 @@
LifterLMS Changelog
===================

v7.8.0 - 2024-10-29
-------------------

##### New Features

+ Added attribute 'layout' to My Account block and shortcode to display content as columns or stacked.
+ Changes styling in the Course Syllabus block for the current lesson, when used on a single lesson page. [#2777](https://github.com/gocodebox/lifterlms/issues/2777)
+ Added new feature: Quiz Resume. [#2783](https://github.com/gocodebox/lifterlms/issues/2783)

##### Updates and Enhancements

+ Improved UI of the Access Plans UI for better usability.
+ Improved accessibility of the Access Plans metaboxes to use proper labels and screen reader text where needed.
+ Added Launch Course Builder to the WP Admin Bar when viewing a course.
+ Added Launch Course Builder button when using the Classic Editor, beside “Add Course” button.
+ Added “Clear Reporting Cache” button on admin reporting page.
+ Improved help messaging on the Course Builder, and the Account and Checkout tabs of the LifterLMS settings.
+ Added support for image upload in Result Clarifications box for quizzes.
+ Removes spacing before or after answers for conditional quiz questions.

##### Bug Fixes

+ Fixed reference in `LLMS_Ajax_Handler::quiz_start()` to `LLMS_Quiz_Attempt::get_status()` method removed since LifterLMS 4.0.0.
+ Fix for notifications no longer auto-dismissing. [#2772](https://github.com/gocodebox/lifterlms/issues/2772)
+ Fix for the lifterlms_registration shortcode not working on certain themes on a separate page. [#2779](https://github.com/gocodebox/lifterlms/issues/2779)
+ Using a more reliable method of keeping LifterLMS notices dismissed. [#2767](https://github.com/gocodebox/lifterlms/issues/2767)

##### Breaking Changes

+ Hiding the Plan SKU field for access plans if not in use. Set the `llms_access_plans_allow_skus` option to get this field back.

##### Developer Notes

+ Adds current-lesson CSS class for the current Lesson in the Course Syllabus block. [#2777](https://github.com/gocodebox/lifterlms/issues/2777)
+ Adds new llms_before_registration_validation filter for 3rd party open registration validation.
+ Added filter `llms_quiz_attempt_resume_time_period` for updating quiz resume allowed time period.

##### Updated Templates

+ [templates/admin/reporting/tabs/quizzes/attempt.php](https://github.com/gocodebox/lifterlms/blob/7.8.0/templates/admin/reporting/tabs/quizzes/attempt.php)
+ [templates/checkout/form-checkout.php](https://github.com/gocodebox/lifterlms/blob/7.8.0/templates/checkout/form-checkout.php)
+ [templates/checkout/form-summary.php](https://github.com/gocodebox/lifterlms/blob/7.8.0/templates/checkout/form-summary.php)
+ [templates/content-single-question.php](https://github.com/gocodebox/lifterlms/blob/7.8.0/templates/content-single-question.php)
+ [templates/myaccount/form-redeem-voucher.php](https://github.com/gocodebox/lifterlms/blob/7.8.0/templates/myaccount/form-redeem-voucher.php)
+ [templates/myaccount/header.php](https://github.com/gocodebox/lifterlms/blob/7.8.0/templates/myaccount/header.php)
+ [templates/notifications/basic.php](https://github.com/gocodebox/lifterlms/blob/7.8.0/templates/notifications/basic.php)
+ [templates/quiz/questions/content-choice.php](https://github.com/gocodebox/lifterlms/blob/7.8.0/templates/quiz/questions/content-choice.php)
+ [templates/quiz/questions/content-picture_choice.php](https://github.com/gocodebox/lifterlms/blob/7.8.0/templates/quiz/questions/content-picture_choice.php)
+ [templates/quiz/results-attempt-questions-list.php](https://github.com/gocodebox/lifterlms/blob/7.8.0/templates/quiz/results-attempt-questions-list.php)
+ [templates/quiz/results-attempt.php](https://github.com/gocodebox/lifterlms/blob/7.8.0/templates/quiz/results-attempt.php)
+ [templates/quiz/results.php](https://github.com/gocodebox/lifterlms/blob/7.8.0/templates/quiz/results.php)
+ [templates/quiz/start-button.php](https://github.com/gocodebox/lifterlms/blob/7.8.0/templates/quiz/start-button.php)


v7.7.8 - 2024-09-17
-------------------

Expand Down
2 changes: 2 additions & 0 deletions assets/js/builder/Models/Quiz.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ define( [
* @since 3.16.0
* @since 7.4.0 Added filter for filtering defaults.
* @since 7.5.0 Replaced unused `random_answers` property with `random_questions`.
* @since 7.8.0 Added filter for filtering defaults and `can_be_resumed` property.
*
* @return {Object}
*/
Expand All @@ -75,6 +76,7 @@ define( [
random_questions: 'no',
time_limit: 30,
show_correct_answer: 'no',
can_be_resumed: 'no',
disable_retake: 'no',

questions: [],
Expand Down
15 changes: 14 additions & 1 deletion assets/js/builder/Schemas/Quiz.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@
* @since 3.17.6
* @since 7.4.0 Added upsell for Question Bank and condition in `random_questions` schema.
* @since 7.6.2 Added `disable_retake` schema.
* @version 7.6.2
* @since 7.8.0 Added `can_be_resumed` option.
* @version 7.8.0
*/
define( [], function() {

Expand Down Expand Up @@ -56,6 +58,17 @@ define( [], function() {
type: 'switch-number',
},
], [

{
attribute: 'can_be_resumed',
id: 'resume',
label: LLMS.l10n.translate( 'Can be resumed' ),
tip: LLMS.l10n.translate( 'Allow a new attempt on this quiz to be resumed' ),
type: 'switch',
condition: function() {
return 'yes' === this.get( 'limit_time' ) ? false : true;
}
},
{
attribute: 'show_correct_answer',
id: 'show-correct-answer',
Expand Down
19 changes: 11 additions & 8 deletions assets/js/builder/Views/Question.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
/**
* Single Question View
* @since 3.16.0
* @version 3.27.0
* Single Question View.
*
* @since 3.16.0
* @version 7.8.0
*/
define( [
'Views/_Detachable',
Expand Down Expand Up @@ -82,10 +83,12 @@ define( [
},

/**
* Compiles the template and renders the view
* @return self (for chaining)
* @since 3.16.0
* @version 3.16.0
* Compiles the template and renders the view.
*
* @since 3.16.0
* @since 7.8.0 Added support for image upload in tinyMCE editor.
*
* @return self (for chaining)
*/
render: function() {

Expand Down Expand Up @@ -124,7 +127,7 @@ define( [

if ( this.model.get( 'clarifications_enabled' ) ) {
this.init_editor( 'question-clarifications--' + this.model.get( 'id' ), {
mediaButtons: false,
mediaButtons: true,
tinymce: {
toolbar1: 'bold,italic,strikethrough,bullist,numlist,alignleft,aligncenter,alignright',
toolbar2: '',
Expand Down
44 changes: 44 additions & 0 deletions assets/js/llms-admin-tables.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,12 @@

var $table = $( this );

$table.parent().find('form#llms-clear-student-progress-cache' ).on( 'submit', function( e ) {
e.preventDefault();
self.clear_cache( $table, $( this ) );

} );

$table.on( 'click', 'button[name="llms-table-paging"]', function( e ) {
e.preventDefault();
self.change_page( $table, $( this ) );
Expand Down Expand Up @@ -83,6 +89,44 @@

};

this.clear_cache = function( $table, $form ) {
var self = this;
var $btn = $form.find( 'button' );

LLMS.Ajax.call( {
url: $form.attr( 'action' ),
method: 'POST',
dataType: 'html',
data: {
'_wpnonce' : $form.find('[name="_wpnonce"]').val(),
'_wp_http_referer' : $form.find('[name="_wp_http_referer"]').val(),
'llms_tool': 'clear-cache'
},
beforeSend: function() {
if ( $btn ) {
$btn.prop( 'disabled', true );
LLMS.Spinner.start( $btn, 'small' );
}
},
error: function( jqXHR, status, error ) {
if ( $btn ) {
$btn.prop( 'disabled', false );
LLMS.Spinner.stop( $btn );
}

console.error( error );
},
success: function( res ) {
if ( $btn ) {
$btn.prop( 'disabled', false );
LLMS.Spinner.stop( $btn );
}

self.reload( $table, {} );
}
} );
};

/**
* Handle clicks on sortable column headers
* @param obj $table jQuery selector for the current table
Expand Down
2 changes: 0 additions & 2 deletions assets/js/llms-admin-tables.min.js

This file was deleted.

10 changes: 9 additions & 1 deletion assets/js/llms-form-checkout.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@

/**
* Fix `HTMLFormElement.reportValidity()` when `scroll-behavior: smooth`.
*
*
* @see {@link https://github.com/gocodebox/lifterlms/issues/2206}
*/
document.querySelector( 'html' ).style.scrollBehavior = 'auto';
Expand All @@ -78,6 +78,8 @@

this.bind_gateways();

$( document ).trigger( "llms-checkout-refreshed" );

} else if ( this.$confirm_form.length ) {

this.form_action = 'confirm';
Expand Down Expand Up @@ -156,6 +158,8 @@

};



/**
* Bind coupon add & remove button events
*
Expand Down Expand Up @@ -353,6 +357,8 @@

$( '.llms-order-summary' ).replaceWith( r.data.summary_html );

$( document ).trigger( "llms-checkout-refreshed" );

}

}
Expand Down Expand Up @@ -396,6 +402,8 @@
$( '.llms-payment-gateways' ).replaceWith( r.data.gateways_html );
self.bind_gateways();

$( document ).trigger( "llms-checkout-refreshed" );

}

}
Expand Down
2 changes: 0 additions & 2 deletions assets/js/llms-form-checkout.min.js

This file was deleted.

17 changes: 17 additions & 0 deletions assets/js/llms-launch-course-button.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
/**
* Add Launch Course Builder button to the classic editor.
*
* @since Unknown
* @version 3.35.0
*/

( function( $ ){

var mainCourseButton = $( '.page-title-action' );

if ( mainCourseButton.length ) {
// Add your custom button beside the "Add Course" button
$( '<a href="' + llms_launch_course.builder_url + '" class="page-title-action button-primary">' + LLMS.l10n.translate( 'Launch Course Builder' ) + '</a>' ).insertAfter( mainCourseButton );
}

} )( jQuery );
30 changes: 21 additions & 9 deletions assets/js/llms-metabox-product.js
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,7 @@
} else {
$plan_redirect_forced.off( 'change' );
$plan_redirect_settings.show();

}

} );
Expand Down Expand Up @@ -580,15 +581,16 @@
$( this ).removeAttr( 'disabled' ); // enabled the field
} );

$clone.find( '.llms-access-plan-datepicker' ).datepicker( {
dateFormat: "mm/dd/yy"
} );

$clone.appendTo( '#llms-access-plans' );

// rewrite the order of all elements
this.update_plan_orders();

// Bind the datepicker to the new plan AFTER the input names have been updated via update_plan_orders() above.
$clone.find( '.llms-access-plan-datepicker' ).datepicker( {
dateFormat: "mm/dd/yy"
} );

$clone.find( '.llms-collapsible-header' ).trigger( 'click' );

// check if the limit has been reached and toggle the button if it has
Expand Down Expand Up @@ -789,12 +791,22 @@
// de-init tinyMCE from the editor.
tinyMCE.EditorManager.execCommand( 'mceRemoveEditor', true, editor_id );

// update the order of each field in the plan.
$p.find( 'select, input, textarea' ).each( function() {
// update the order of each label and field in the plan.
$p.find( 'label, select, input, textarea' ).each( function() {

var labelFor = $( this ).attr( 'for' );
if ( labelFor ) {
$( this ).attr( 'for', labelFor.replace( orig, curr ) );
}

var inputID = $( this ).attr( 'id' );
if ( inputID ) {
$( this ).attr( 'id', inputID.replace( orig, curr ) );
}

var name = $( this ).attr( 'name' );
if ( name ) {
$( this ).attr( 'name', name.replace( orig, curr ) );
var inputName = $( this ).attr( 'name' );
if ( inputName ) {
$( this ).attr( 'name', inputName.replace( orig, curr ) );
}

} );
Expand Down
Loading

0 comments on commit c047f22

Please sign in to comment.