Version Description
~ Added: option enable sticky navigation pagination when user answer question on quiz. ~ Fixed: set again current item when manager remove item current when edit course. ~ Modified: page profile - load ajax call API, show more info... ~ Fixed: can't upgrade DB from 3 to 4 because user translate menu "LearnPress". ~ Modified: Navigation on page quiz - change icon next, previous to text. ~ Fixed: function "duplicate course" not duplicate "answer option" ~ Fixed: Social icons on page profile when user view another user. ~ Fixed: on multiple site enable option "Registration is disabled" will not show form register on page Profile.
Download this release
Release Info
Developer | ThimPress |
Plugin | LearnPress – WordPress LMS Plugin |
Version | 4.0.9 |
Comparing to | |
See all releases |
Code changes from version 4.0.9-beta-1 to 4.0.9
- assets/css/learnpress.css +4 -0
- inc/class-lp-checkout.php +2 -2
- inc/curds/class-lp-question-curd.php +1 -0
- inc/question/class-lp-question-fill-in-blanks.php +33 -12
- learnpress.php +2 -2
- readme.txt +4 -3
assets/css/learnpress.css
CHANGED
@@ -5056,6 +5056,10 @@ button[data-counter]::after {
|
|
5056 |
line-height: 3;
|
5057 |
}
|
5058 |
|
|
|
|
|
|
|
|
|
5059 |
.learn-press-message.fixed {
|
5060 |
position: fixed;
|
5061 |
top: 32px;
|
5056 |
line-height: 3;
|
5057 |
}
|
5058 |
|
5059 |
+
.lp-sort-bg label.option-title {
|
5060 |
+
background: rgba(255, 182, 6, 0.68) !important;
|
5061 |
+
}
|
5062 |
+
|
5063 |
.learn-press-message.fixed {
|
5064 |
position: fixed;
|
5065 |
top: 32px;
|
inc/class-lp-checkout.php
CHANGED
@@ -681,7 +681,7 @@ class LP_Checkout {
|
|
681 |
} else {
|
682 |
// maybe throw new exception
|
683 |
$this->validate_payment();
|
684 |
-
|
685 |
// Create order.
|
686 |
$order_id = $this->create_order();
|
687 |
|
@@ -693,7 +693,7 @@ class LP_Checkout {
|
|
693 |
do_action( 'learn-press/checkout-order-processed', $order_id, $this );
|
694 |
|
695 |
if ( $this->payment_method ) {
|
696 |
-
// Store the order is waiting
|
697 |
LP()->session->order_awaiting_payment = $order_id;
|
698 |
// Process Payment
|
699 |
$result = $this->payment_method->process_payment( $order_id );
|
681 |
} else {
|
682 |
// maybe throw new exception
|
683 |
$this->validate_payment();
|
684 |
+
|
685 |
// Create order.
|
686 |
$order_id = $this->create_order();
|
687 |
|
693 |
do_action( 'learn-press/checkout-order-processed', $order_id, $this );
|
694 |
|
695 |
if ( $this->payment_method ) {
|
696 |
+
// Store the order is waiting f6or payment and each payment method should clear it
|
697 |
LP()->session->order_awaiting_payment = $order_id;
|
698 |
// Process Payment
|
699 |
$result = $this->payment_method->process_payment( $order_id );
|
inc/curds/class-lp-question-curd.php
CHANGED
@@ -192,6 +192,7 @@ if ( ! class_exists( 'LP_Question_CURD' ) ) {
|
|
192 |
*
|
193 |
* @param $question_id | origin question
|
194 |
* @param $new_question_id | new question
|
|
|
195 |
*/
|
196 |
public function duplicate_answer( $question_id, $new_question_id ) {
|
197 |
global $wpdb;
|
192 |
*
|
193 |
* @param $question_id | origin question
|
194 |
* @param $new_question_id | new question
|
195 |
+
* @TODO tungnx: check duplicate question typ fill_in_blank - must clone row in learnpress_question_answermeta
|
196 |
*/
|
197 |
public function duplicate_answer( $question_id, $new_question_id ) {
|
198 |
global $wpdb;
|
inc/question/class-lp-question-fill-in-blanks.php
CHANGED
@@ -39,23 +39,38 @@ if ( ! class_exists( 'LP_Question_Fill_In_Blanks' ) ) {
|
|
39 |
public function __construct( $the_question = null, $args = null ) {
|
40 |
parent::__construct( $the_question, $args );
|
41 |
|
42 |
-
add_filter(
|
43 |
-
|
|
|
|
|
|
|
44 |
|
45 |
add_action( 'learn-press/before-clear-question', array( $this, 'clear_question_answer_meta' ) );
|
46 |
|
47 |
-
add_filter(
|
48 |
-
|
49 |
-
|
50 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
51 |
|
52 |
add_filter( 'learn-press/question/fib/regex-content', array( $this, 'match_shortcode' ), 10, 4 );
|
53 |
}
|
54 |
|
55 |
public function match_shortcode( $content, $answer_id, $show_answer = false, $answered = '' ) {
|
56 |
if ( ! empty( $content ) ) {
|
57 |
-
preg_match_all(
|
58 |
-
|
|
|
|
|
|
|
|
|
59 |
|
60 |
if ( ! empty( $all_shortcode ) ) {
|
61 |
foreach ( $all_shortcode as $shortcode ) {
|
@@ -76,8 +91,11 @@ if ( ! class_exists( 'LP_Question_Fill_In_Blanks' ) ) {
|
|
76 |
$is_correct = '';
|
77 |
|
78 |
if ( ! empty( $answer ) ) {
|
79 |
-
$blanks
|
80 |
-
|
|
|
|
|
|
|
81 |
}
|
82 |
|
83 |
$answer_html = ( ! empty( $answer ) && $is_correct === 'fail' ) ? '<span class="lp-fib-answered__answer">' . $answer . '</span> → ' : '';
|
@@ -129,8 +147,11 @@ if ( ! class_exists( 'LP_Question_Fill_In_Blanks' ) ) {
|
|
129 |
|
130 |
if ( $answers ) {
|
131 |
foreach ( $answers as $k => $answer ) {
|
132 |
-
$blanks = learn_press_get_question_answer_meta(
|
133 |
-
'
|
|
|
|
|
|
|
134 |
$answers[ $k ]['blanks'] = $blanks ? array_values( $blanks ) : array();
|
135 |
}
|
136 |
}
|
39 |
public function __construct( $the_question = null, $args = null ) {
|
40 |
parent::__construct( $the_question, $args );
|
41 |
|
42 |
+
add_filter(
|
43 |
+
'learn-press/question-editor/localize-script',
|
44 |
+
array( $this, 'sanitize_question_answers' ),
|
45 |
+
1000
|
46 |
+
);
|
47 |
|
48 |
add_action( 'learn-press/before-clear-question', array( $this, 'clear_question_answer_meta' ) );
|
49 |
|
50 |
+
add_filter(
|
51 |
+
'learn-press/quiz-editor/question-answers-data',
|
52 |
+
array( $this, 'admin_editor_question_answers' ),
|
53 |
+
10,
|
54 |
+
3
|
55 |
+
);
|
56 |
+
add_filter(
|
57 |
+
'learn-press/question-editor/question-answers-data',
|
58 |
+
array( $this, 'admin_editor_question_answers' ),
|
59 |
+
10,
|
60 |
+
3
|
61 |
+
);
|
62 |
|
63 |
add_filter( 'learn-press/question/fib/regex-content', array( $this, 'match_shortcode' ), 10, 4 );
|
64 |
}
|
65 |
|
66 |
public function match_shortcode( $content, $answer_id, $show_answer = false, $answered = '' ) {
|
67 |
if ( ! empty( $content ) ) {
|
68 |
+
preg_match_all(
|
69 |
+
'/' . get_shortcode_regex( array( 'fib' ) ) . '/',
|
70 |
+
$content,
|
71 |
+
$all_shortcode,
|
72 |
+
PREG_SET_ORDER
|
73 |
+
);
|
74 |
|
75 |
if ( ! empty( $all_shortcode ) ) {
|
76 |
foreach ( $all_shortcode as $shortcode ) {
|
91 |
$is_correct = '';
|
92 |
|
93 |
if ( ! empty( $answer ) ) {
|
94 |
+
$blanks = learn_press_get_question_answer_meta( $answer_id, '_blanks', true );
|
95 |
+
|
96 |
+
if ( ! empty( $blanks ) ) {
|
97 |
+
$is_correct = $this->check_answer( $blanks[ $ids ], $answer ) ? 'correct' : 'fail';
|
98 |
+
}
|
99 |
}
|
100 |
|
101 |
$answer_html = ( ! empty( $answer ) && $is_correct === 'fail' ) ? '<span class="lp-fib-answered__answer">' . $answer . '</span> → ' : '';
|
147 |
|
148 |
if ( $answers ) {
|
149 |
foreach ( $answers as $k => $answer ) {
|
150 |
+
$blanks = learn_press_get_question_answer_meta(
|
151 |
+
$answer['question_answer_id'],
|
152 |
+
'_blanks',
|
153 |
+
true
|
154 |
+
);
|
155 |
$answers[ $k ]['blanks'] = $blanks ? array_values( $blanks ) : array();
|
156 |
}
|
157 |
}
|
learnpress.php
CHANGED
@@ -4,9 +4,9 @@
|
|
4 |
* Plugin URI: http://thimpress.com/learnpress
|
5 |
* Description: LearnPress is a WordPress complete solution for creating a Learning Management System (LMS). It can help you to create courses, lessons and quizzes.
|
6 |
* Author: ThimPress
|
7 |
-
* Version: 4.0.9
|
8 |
* Author URI: http://thimpress.com
|
9 |
-
* Requires at least:
|
10 |
* Tested up to: 5.7
|
11 |
* Requires PHP: 7.0
|
12 |
* Text Domain: learnpress
|
4 |
* Plugin URI: http://thimpress.com/learnpress
|
5 |
* Description: LearnPress is a WordPress complete solution for creating a Learning Management System (LMS). It can help you to create courses, lessons and quizzes.
|
6 |
* Author: ThimPress
|
7 |
+
* Version: 4.0.9
|
8 |
* Author URI: http://thimpress.com
|
9 |
+
* Requires at least: 5.6
|
10 |
* Tested up to: 5.7
|
11 |
* Requires PHP: 7.0
|
12 |
* Text Domain: learnpress
|
readme.txt
CHANGED
@@ -5,7 +5,7 @@ Tags: elearning, education, course, lms, learning management system
|
|
5 |
Requires at least: 5.6
|
6 |
Tested up to: 5.7
|
7 |
Requires PHP: 7.0
|
8 |
-
Stable tag: 4.0.9
|
9 |
License: GPLv2 or later
|
10 |
License URI: https://www.gnu.org/licenses/gpl-2.0.html
|
11 |
|
@@ -200,15 +200,16 @@ https://www.transifex.com/projects/p/learnpress/
|
|
200 |
= 4.0.9 =
|
201 |
~ Added: option enable sticky navigation pagination when user answer question on quiz.
|
202 |
~ Fixed: set again current item when manager remove item current when edit course.
|
203 |
-
~ Modified: page profile - load ajax call API, show more info
|
204 |
~ Fixed: can't upgrade DB from 3 to 4 because user translate menu "LearnPress".
|
205 |
~ Modified: Navigation on page quiz - change icon next, previous to text.
|
206 |
-
~ Fixed: function "duplicate
|
207 |
~ Fixed: Social icons on page profile when user view another user.
|
208 |
~ Fixed: on multiple site enable option "Registration is disabled" will not show form register on page Profile.
|
209 |
|
210 |
= 4.0.8 =
|
211 |
~ Added: feature "Allow Repurchase course"
|
|
|
212 |
~ Fixed: Custom register fields error with some name not utf8
|
213 |
~ Added: field "confirm password" on register form profile
|
214 |
~ Fixed: file config.js permission 403 on some sites, change name to lp-configs.js
|
5 |
Requires at least: 5.6
|
6 |
Tested up to: 5.7
|
7 |
Requires PHP: 7.0
|
8 |
+
Stable tag: 4.0.9
|
9 |
License: GPLv2 or later
|
10 |
License URI: https://www.gnu.org/licenses/gpl-2.0.html
|
11 |
|
200 |
= 4.0.9 =
|
201 |
~ Added: option enable sticky navigation pagination when user answer question on quiz.
|
202 |
~ Fixed: set again current item when manager remove item current when edit course.
|
203 |
+
~ Modified: page profile - load ajax call API, show more info...
|
204 |
~ Fixed: can't upgrade DB from 3 to 4 because user translate menu "LearnPress".
|
205 |
~ Modified: Navigation on page quiz - change icon next, previous to text.
|
206 |
+
~ Fixed: function "duplicate course" not duplicate "answer option"
|
207 |
~ Fixed: Social icons on page profile when user view another user.
|
208 |
~ Fixed: on multiple site enable option "Registration is disabled" will not show form register on page Profile.
|
209 |
|
210 |
= 4.0.8 =
|
211 |
~ Added: feature "Allow Repurchase course"
|
212 |
+
~ Added: feature "No require enroll"
|
213 |
~ Fixed: Custom register fields error with some name not utf8
|
214 |
~ Added: field "confirm password" on register form profile
|
215 |
~ Fixed: file config.js permission 403 on some sites, change name to lp-configs.js
|