Skip to content

Commit

Permalink
Fix typos in get percentage function
Browse files Browse the repository at this point in the history
  • Loading branch information
sazedul-haque committed Aug 18, 2023
1 parent 44613fc commit 95becc3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions assets/react/front/tutor-front.js
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ jQuery(document).ready(function($) {
enable_complete_lesson_btn: function(instance) {
const complete_lesson_btn = $('button[name="complete_lesson_btn"]');
const video_data = this.video_data();
const completedPercentage = getPercentage(Number(instance.currentTime), Number(instance.duration));
const completedPercentage = this.getPercentage(Number(instance.currentTime), Number(instance.duration));

if (completedPercentage >= video_data.required_percentage) {
complete_lesson_btn.attr('disabled', false);
Expand All @@ -271,7 +271,7 @@ jQuery(document).ready(function($) {
},
getPercentage: function(value, total) {
if (value > 0 && total > 0) {
return Math.round((value / total) * 100);;
return Math.round((value / total) * 100);
}
return 0;
},
Expand Down

0 comments on commit 95becc3

Please sign in to comment.