Version Description
28 March, 2019 =
Fixed: Multiple Instructor, search feature working when pro is not exists
Fixed: an issue in time update when time limit 0 in quiz attempt, it was return in front-js middle point, so rest of js not worked
Download this release
Release Info
Developer | themeum |
Plugin | Tutor LMS – eLearning and online course solution |
Version | 1.1.0 |
Comparing to | |
See all releases |
Code changes from version 1.0.9 to 1.1.0
- assets/js/tutor-front.js +64 -65
- classes/Course.php +2 -2
- classes/Quiz_Attempts_List.php +2 -6
- readme.txt +6 -1
- tutor.php +2 -2
assets/js/tutor-front.js
CHANGED
@@ -234,81 +234,80 @@ jQuery(document).ready(function($){
|
|
234 |
attempt_settings = JSON.parse($tutor_quiz_time_update.attr('data-attempt-settings'));
|
235 |
var attempt_meta = JSON.parse($tutor_quiz_time_update.attr('data-attempt-meta'));
|
236 |
|
237 |
-
if (attempt_meta.time_limit.time_limit_seconds
|
238 |
//No time Zero limit for
|
239 |
-
|
240 |
-
|
241 |
-
|
242 |
-
var countDownDate = new Date(attempt_settings.attempt_started_at).getTime() + (attempt_meta.time_limit.time_limit_seconds * 1000);
|
243 |
-
var time_now = new Date(attempt_meta.date_time_now).getTime();
|
244 |
|
245 |
-
|
246 |
-
|
247 |
|
248 |
-
|
249 |
-
|
250 |
-
|
251 |
-
|
252 |
|
253 |
-
|
254 |
|
255 |
-
|
256 |
-
|
257 |
-
|
258 |
-
|
259 |
-
|
260 |
-
|
261 |
-
|
262 |
-
|
263 |
-
|
264 |
-
|
265 |
-
|
266 |
-
|
267 |
|
268 |
-
|
269 |
-
|
270 |
-
|
271 |
-
|
272 |
-
|
273 |
-
|
274 |
-
|
275 |
-
|
276 |
-
|
277 |
-
|
278 |
-
|
279 |
-
|
280 |
-
|
281 |
-
|
282 |
-
|
283 |
-
|
284 |
-
|
285 |
-
|
286 |
-
|
287 |
-
|
288 |
-
|
289 |
-
|
290 |
-
|
291 |
-
|
292 |
-
|
293 |
-
|
294 |
-
|
295 |
-
|
296 |
-
|
|
|
|
|
|
|
|
|
|
|
297 |
window.location.reload(true);
|
298 |
}
|
299 |
-
}
|
300 |
-
|
301 |
-
$('#tutor-quiz-body').html('');
|
302 |
-
window.location.reload(true);
|
303 |
-
}
|
304 |
-
});
|
305 |
|
306 |
}
|
307 |
-
|
308 |
-
|
309 |
-
|
310 |
-
|
311 |
-
|
|
|
312 |
}
|
313 |
|
314 |
var $quiz_start_form = $('#tutor-quiz-body form#tutor-start-quiz');
|
234 |
attempt_settings = JSON.parse($tutor_quiz_time_update.attr('data-attempt-settings'));
|
235 |
var attempt_meta = JSON.parse($tutor_quiz_time_update.attr('data-attempt-meta'));
|
236 |
|
237 |
+
if (attempt_meta.time_limit.time_limit_seconds > 0) {
|
238 |
//No time Zero limit for
|
239 |
+
var countDownDate = new Date(attempt_settings.attempt_started_at).getTime() + (attempt_meta.time_limit.time_limit_seconds * 1000);
|
240 |
+
var time_now = new Date(attempt_meta.date_time_now).getTime();
|
|
|
|
|
|
|
241 |
|
242 |
+
var tutor_quiz_interval = setInterval(function () {
|
243 |
+
var distance = countDownDate - time_now;
|
244 |
|
245 |
+
var days = Math.floor(distance / (1000 * 60 * 60 * 24));
|
246 |
+
var hours = Math.floor((distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60));
|
247 |
+
var minutes = Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60));
|
248 |
+
var seconds = Math.floor((distance % (1000 * 60)) / 1000);
|
249 |
|
250 |
+
var countdown_human = '';
|
251 |
|
252 |
+
if (days) {
|
253 |
+
countdown_human += days + "d ";
|
254 |
+
}
|
255 |
+
if (hours) {
|
256 |
+
countdown_human += hours + "h ";
|
257 |
+
}
|
258 |
+
if (minutes) {
|
259 |
+
countdown_human += minutes + "m ";
|
260 |
+
}
|
261 |
+
if (seconds) {
|
262 |
+
countdown_human += seconds + "s ";
|
263 |
+
}
|
264 |
|
265 |
+
if (distance < 0) {
|
266 |
+
clearInterval(tutor_quiz_interval);
|
267 |
+
countdown_human = "EXPIRED";
|
268 |
+
//Set the quiz attempt to timeout in ajax
|
269 |
+
|
270 |
+
if (_tutorobject.options.quiz_when_time_expires === 'autosubmit') {
|
271 |
+
/**
|
272 |
+
* Auto Submit
|
273 |
+
*/
|
274 |
+
$('form#tutor-answering-quiz').submit();
|
275 |
+
|
276 |
+
} else if (_tutorobject.options.quiz_when_time_expires === 'autoabandon') {
|
277 |
+
/**
|
278 |
+
*
|
279 |
+
* @type {jQuery}
|
280 |
+
*
|
281 |
+
* Current attempt will be cancel with attempt status attempt_timeout
|
282 |
+
*/
|
283 |
+
|
284 |
+
var quiz_id = $('#tutor_quiz_id').val();
|
285 |
+
var tutor_quiz_remaining_time_secs = $('#tutor_quiz_remaining_time_secs').val();
|
286 |
+
var quiz_timeout_data = {quiz_id: quiz_id, action: 'tutor_quiz_timeout'};
|
287 |
+
|
288 |
+
$.ajax({
|
289 |
+
url: _tutorobject.ajaxurl,
|
290 |
+
type: 'POST',
|
291 |
+
data: quiz_timeout_data,
|
292 |
+
success: function (data) {
|
293 |
+
if (data.success) {
|
294 |
+
window.location.reload(true);
|
295 |
+
}
|
296 |
+
},
|
297 |
+
complete: function () {
|
298 |
+
$('#tutor-quiz-body').html('');
|
299 |
window.location.reload(true);
|
300 |
}
|
301 |
+
});
|
302 |
+
}
|
|
|
|
|
|
|
|
|
303 |
|
304 |
}
|
305 |
+
time_now = time_now + 1000;
|
306 |
+
$tutor_quiz_time_update.html(countdown_human);
|
307 |
+
}, 1000);
|
308 |
+
}else{
|
309 |
+
$tutor_quiz_time_update.closest('.time-remaining').remove();
|
310 |
+
}
|
311 |
}
|
312 |
|
313 |
var $quiz_start_form = $('#tutor-quiz-body form#tutor-start-quiz');
|
classes/Course.php
CHANGED
@@ -451,12 +451,12 @@ class Course extends Tutor_Base {
|
|
451 |
|
452 |
$search_sql = '';
|
453 |
if ($search_terms){
|
454 |
-
$search_sql = "AND user_login like '%{$search_terms}%' or user_nicename like '%{$search_terms}%' or display_name like '%{$search_terms}%' ";
|
455 |
}
|
456 |
|
457 |
$instructors = $wpdb->get_results("select ID, display_name from {$wpdb->users}
|
458 |
INNER JOIN {$wpdb->usermeta} ON ID = user_id AND meta_key = '_tutor_instructor_status' AND meta_value = 'approved'
|
459 |
-
WHERE
|
460 |
|
461 |
$output = '';
|
462 |
if (is_array($instructors) && count($instructors)){
|
451 |
|
452 |
$search_sql = '';
|
453 |
if ($search_terms){
|
454 |
+
$search_sql = "AND (user_login like '%{$search_terms}%' or user_nicename like '%{$search_terms}%' or display_name like '%{$search_terms}%') ";
|
455 |
}
|
456 |
|
457 |
$instructors = $wpdb->get_results("select ID, display_name from {$wpdb->users}
|
458 |
INNER JOIN {$wpdb->usermeta} ON ID = user_id AND meta_key = '_tutor_instructor_status' AND meta_value = 'approved'
|
459 |
+
WHERE 1=1 {$not_in_sql} {$search_sql} limit 10 ");
|
460 |
|
461 |
$output = '';
|
462 |
if (is_array($instructors) && count($instructors)){
|
classes/Quiz_Attempts_List.php
CHANGED
@@ -139,8 +139,8 @@ class Quiz_Attempts_List extends \Tutor_List_Table {
|
|
139 |
$attempt_ids = implode( ',', array_map( 'absint', $attempt_ids ) );
|
140 |
|
141 |
//Deleting attempt (comment), child attempt and attempt meta (comment meta)
|
142 |
-
$wpdb->query( "DELETE FROM {$wpdb->
|
143 |
-
$wpdb->query( "DELETE FROM {$wpdb->
|
144 |
}
|
145 |
}
|
146 |
|
@@ -190,10 +190,6 @@ class Quiz_Attempts_List extends \Tutor_List_Table {
|
|
190 |
|
191 |
}
|
192 |
|
193 |
-
|
194 |
-
|
195 |
-
|
196 |
-
|
197 |
$this->set_pagination_args( array(
|
198 |
'total_items' => $total_items,
|
199 |
'per_page' => $per_page,
|
139 |
$attempt_ids = implode( ',', array_map( 'absint', $attempt_ids ) );
|
140 |
|
141 |
//Deleting attempt (comment), child attempt and attempt meta (comment meta)
|
142 |
+
$wpdb->query( "DELETE FROM {$wpdb->prefix}tutor_quiz_attempts WHERE attempt_id IN($attempt_ids)" );
|
143 |
+
$wpdb->query( "DELETE FROM {$wpdb->prefix}tutor_quiz_attempt_answers WHERE quiz_attempt_id IN($attempt_ids)" );
|
144 |
}
|
145 |
}
|
146 |
|
190 |
|
191 |
}
|
192 |
|
|
|
|
|
|
|
|
|
193 |
$this->set_pagination_args( array(
|
194 |
'total_items' => $total_items,
|
195 |
'per_page' => $per_page,
|
readme.txt
CHANGED
@@ -5,7 +5,7 @@ Tags: lms, education, wp-lms, education management system
|
|
5 |
Requires at least: 4.5
|
6 |
Tested up to: 5.1
|
7 |
Requires PHP: 5.4.0
|
8 |
-
Stable tag: 1.0
|
9 |
License: GPLv3
|
10 |
License URI: https://www.gnu.org/licenses/gpl-3.0.html
|
11 |
|
@@ -183,6 +183,11 @@ This is an alpha version of Tutor, as bugs and issues expected, if you found any
|
|
183 |
|
184 |
== Changelog ==
|
185 |
|
|
|
|
|
|
|
|
|
|
|
186 |
|
187 |
= 1.0.9 - 28 March, 2019 =
|
188 |
|
5 |
Requires at least: 4.5
|
6 |
Tested up to: 5.1
|
7 |
Requires PHP: 5.4.0
|
8 |
+
Stable tag: 1.1.0
|
9 |
License: GPLv3
|
10 |
License URI: https://www.gnu.org/licenses/gpl-3.0.html
|
11 |
|
183 |
|
184 |
== Changelog ==
|
185 |
|
186 |
+
= 1.1.0 - 28 March, 2019 =
|
187 |
+
|
188 |
+
* Fixed: Multiple Instructor, search feature working when pro is not exists
|
189 |
+
* Fixed: an issue in time update when time limit 0 in quiz attempt, it was return in front-js middle point, so rest of js not worked
|
190 |
+
|
191 |
|
192 |
= 1.0.9 - 28 March, 2019 =
|
193 |
|
tutor.php
CHANGED
@@ -4,7 +4,7 @@ Plugin Name: Tutor LMS
|
|
4 |
Plugin URI: http://https://themeum.com/tutor
|
5 |
Description: Tutor is a complete solution for creating a Learning Management System in WordPress way. It can help you to create small to large scale online education site very conveniently. Power features like report, certificate, course preview, private file sharing make Tutor a robust plugin for any educational institutes.
|
6 |
Author: Themeum
|
7 |
-
Version: 1.0
|
8 |
Author URI: http://themeum.com
|
9 |
Requires at least: 4.5
|
10 |
Tested up to: 5.1
|
@@ -17,7 +17,7 @@ if ( ! defined( 'ABSPATH' ) )
|
|
17 |
/**
|
18 |
* Defined the tutor main file
|
19 |
*/
|
20 |
-
define('TUTOR_VERSION', '1.0
|
21 |
define('TUTOR_FILE', __FILE__);
|
22 |
|
23 |
|
4 |
Plugin URI: http://https://themeum.com/tutor
|
5 |
Description: Tutor is a complete solution for creating a Learning Management System in WordPress way. It can help you to create small to large scale online education site very conveniently. Power features like report, certificate, course preview, private file sharing make Tutor a robust plugin for any educational institutes.
|
6 |
Author: Themeum
|
7 |
+
Version: 1.1.0
|
8 |
Author URI: http://themeum.com
|
9 |
Requires at least: 4.5
|
10 |
Tested up to: 5.1
|
17 |
/**
|
18 |
* Defined the tutor main file
|
19 |
*/
|
20 |
+
define('TUTOR_VERSION', '1.1.0');
|
21 |
define('TUTOR_FILE', __FILE__);
|
22 |
|
23 |
|