Skip to content

Commit

Permalink
v1.3.7; updates
Browse files Browse the repository at this point in the history
  • Loading branch information
bmatt468 committed Sep 25, 2015
1 parent 1592b3f commit c52b120
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 10 deletions.
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,13 @@ LIFTER LMS

CHANGELOG
=========
v1.3.7
v1.3.7 - 2015/09/25
-------------------
+ Updates: Adds Spanish translation
+ BugFixes: Resolved security issue with WordPress searches and lessons
+ Updates: Adds new filter 'lifterlms_single_payment_text' to customize single payment string on checkout
+ Updates: Student analytics now indicate which courses a student has completed
+ BugFixes: Resolved security issue with WordPress searches and lessons
+ BugFixes: Fixes analytics bug that potentially arises after a course is deleted

v1.3.6 - 2015/09/18
-------------------
Expand Down
22 changes: 16 additions & 6 deletions includes/class.llms.analytics.php
Original file line number Diff line number Diff line change
Expand Up @@ -844,9 +844,16 @@ public static function get_user_enrollments( $user_id ) {

$post = get_post( $value->post_id );

$results[$key]->post_title = $post->post_title;
$results[$key]->post_type = $post->post_type;

if (isset($post))
{
$results[$key]->post_title = $post->post_title;
$results[$key]->post_type = $post->post_type;
}
else
{
$results[$key]->post_title = '';
$results[$key]->post_type = '';
}
}
}

Expand All @@ -872,9 +879,12 @@ public static function get_courses_by_user_table( $user ) {

$courses_array = array();

foreach ( $user->courses as $course ) {

$course_array = array( $course->post_title, LLMS_Date::db_date( $course->updated_date ), $course->meta_value );
foreach ( $user->courses as $course )
{
$c = new LLMS_Course($course->post_id);
$comp = $c->get_percent_complete($user->id);
$status = ($comp == '100') ? 'Completed' : 'Enrolled';
$course_array = array( $course->post_title, LLMS_Date::db_date( $course->updated_date ), $status );
array_push( $courses_array, $course_array);
}

Expand Down
9 changes: 7 additions & 2 deletions includes/class.llms.course.php
Original file line number Diff line number Diff line change
Expand Up @@ -439,7 +439,12 @@ public function get_lesson_ids() {
* Get the current percent complete by user
* @return int [numerical representation of % completion in course]
*/
public function get_percent_complete() {
public function get_percent_complete($user_id = '') {

if ($user_id == '')
{
$user_id = get_current_user_id();
}

$lesson_ids = $this->get_children_lessons();

Expand All @@ -453,7 +458,7 @@ public function get_percent_complete() {
}

foreach( $array as $key => $value ) {
$user_postmetas = $user->get_user_postmeta_data( get_current_user_id(), $value );
$user_postmetas = $user->get_user_postmeta_data( $user_id, $value );
if ( isset($user_postmetas['_is_complete']) ) {
if ( $user_postmetas['_is_complete']->meta_value === 'yes' ) {
$i++;
Expand Down

0 comments on commit c52b120

Please sign in to comment.