Coder Social home page Coder Social logo

themeum / tutor Goto Github PK

View Code? Open in Web Editor NEW
75.0 75.0 63.0 60.18 MB

A complete WordPress LMS plugin to create any e-learning website easily.

Home Page: https://www.themeum.com/product/tutor-lms/

License: GNU General Public License v3.0

CSS 0.80% JavaScript 13.52% PHP 58.71% SCSS 13.88% HTML 1.11% Shell 0.17% MDX 11.81%

tutor's People

Contributors

360fun avatar agusmu avatar anik avatar anindra123 avatar delowardev avatar haruncpi avatar harunollyo avatar hsntareq avatar humbertleonardo avatar iamsaief avatar ibrahim-kardi avatar ivanrf avatar javilemp avatar jayedul avatar jobayer-tuser avatar kawshar avatar lesthertod avatar mi-prakash avatar nur-alam avatar ollyonirjhor avatar sazedul-haque avatar sekanderb avatar shewa12 avatar shohel avatar sifat009 avatar sksaju avatar w3guy avatar wprashed avatar zamanq avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

tutor's Issues

Short codes are not working with WP Page Builder

Hi!

I have a problem, because when I want to put RODO information about what I will do with my student data below the short code on the student registration page, only the registration form appears. Any other WordPress page building blocks are not displayed.

I'm using:

  • Tutor LMS
  • Tutor LMS PRO
  • WooCommerce (and addons)
  • OCEAN WP (theme)
  • Elementor

Maximum Students doesn't work

I created a course and set the maximum students to 2. I tested creating the enrollments manually and by add-on, but neither works. I inserted an image demonstrating this bug.
max-students-bug

Instructors profile photo issue (Over Wordpress Admin)

I'm trying to add instructors over WordPress Backend, all works fine except the image for the instructor, never get saved.

I get fixed this behavior by doing these simple modifications.

[PLUGIN FOLDER]/views/metabox/user-profile-fields.php
Line 48 (Fix field name)

From:
<input type="hidden" name="_tutor_profile_photo_field” value="<?php echo $user_profile_photo; ?>">
To:
<input type="hidden" name="_tutor_profile_photo" value="<?php echo $user_profile_photo; ?>">

[PLUGIN FOLDER]/classes/User.php

Line 109 (Add meta post updater)

From:

public function profile_update($user_id){
	$_tutor_profile_job_title = sanitize_text_field(tutor_utils()->avalue_dot('_tutor_profile_job_title', $_POST));
	$_tutor_profile_bio = wp_kses_post(tutor_utils()->avalue_dot('_tutor_profile_bio', $_POST));

	update_user_meta($user_id, '_tutor_profile_job_title', $_tutor_profile_job_title);
	update_user_meta($user_id, '_tutor_profile_bio', $_tutor_profile_bio);
}

To:

public function profile_update($user_id){
	$_tutor_profile_job_title = sanitize_text_field(tutor_utils()->avalue_dot('_tutor_profile_job_title', $_POST));
	$_tutor_profile_bio = wp_kses_post(tutor_utils()->avalue_dot('_tutor_profile_bio', $_POST));
	$_tutor_profile_image = wp_kses_post(tutor_utils()->avalue_dot('_tutor_profile_photo', $_POST));

	update_user_meta($user_id, '_tutor_profile_job_title', $_tutor_profile_job_title);
	update_user_meta($user_id, '_tutor_profile_bio', $_tutor_profile_bio);
	update_user_meta($user_id, '_tutor_profile_photo', $_tutor_profile_image);
}

Please send this update because I made these modifications over the plugin if you send another update with this change I get bugged again.

I have a PRO account.

Tutor-Course Shortcode html issue

I have started using the Tutor LMS plugin and must say it really makes life easy.

I have encountered a UI error that I am not able to fix.

I have 2 courses as of now and want to list them using the "[tutor-course]" shortcode. But its giving some HTML issue.

Please see the UI below (2nd course comes below the 1st). Also attaching the HTML output. As you can see from the HTML, the 2nd course

is embedded inside the 1st div with tutor-course-col-3 class. Here lies the problem.

Screen Shot 2020-04-17 at 8 38 01 pm
Screen Shot 2020-04-17 at 8 37 40 pm

Redundant page refreshing after adding item to cart causing an error

Hi.

I'm using Tutor with WooCommerce. Recently I discovered that right after adding an item to a cart the page refreshes causing an error of triggering another item to cart addition, and, in my case, sometimes resulting in an example WooCommerce notification:

You cannot add another "Title" to your cart.

Using a developer tools I've found out the code that's causing the issue:

// Refresh page after coming back to course archive page from cart
    var archive_loop = $('.tutor-course-loop');
    if(archive_loop.length>0){
        window.sessionStorage.getItem('tutor_refresh_archive')==='yes' ? window.location.reload() : 0;
        window.sessionStorage.removeItem('tutor_refresh_archive');
        archive_loop.on('click', '.tutor-loop-cart-btn-wrap', function(){
            window.sessionStorage.setItem('tutor_refresh_archive', 'yes');
        });
    }

It really look like a quite serious bug to me. I assume the code is triggered by adding a query parameter and I'm quite sure it shouldn't be called in this specific situation. Is it really necessary by the way? And do You have an idea how can I fix the issue myself right now, without manually editing the plugin code?

I also do take into consideration the there could be some bug on my side, but I haven't really found anything and this looks like a reasonably possible cause of the issue to me.

Admin user enrolled instead student when payment status is switched manually (EDD)

  1. student buys a course
  2. EDD receives the payment and put it in pending status (I use Sorsawo EDD Bank Transfer)
  3. Admin switch the payment on Complete (value='publish') (when receives the money in the bank)
  4. Admin is enrolled instead of the student (BUG)

DEBUGGING
This seems to be the problem:
tutor_utils()->do_enroll($course_id, $payment_id);

Should pass also $user_id somehow, otherwise get_user_id calls get_current_user_id() which loads the current user id (the Admin) instead of the student id.

Unable to view previous quiz attempts

How to reproduce:

  • Enable ability to view previous quiz attempts in options
  • Take z quiz attempt
  • View your attempt (it is ok now)
  • Go to another lesson or any other link
  • Come back again to the quiz page
  • Try to view attempt (displays 0 only as in attached screenshot)

Zrzut ekranu 2020-05-13 o 12 09 23

Interesting thing is that after another attempt I am able to see my previous attempts as long as I stay in this Quiz lesson. Changing lesson causes all attempts to be unavailable.

Color picker in settings now looks ugly.

Hi guys with the new update in the settings when customizing the color now looks ugly.

Previously we had this:

Captura02

And in the new version 2.0.0 we are going backwards in functions?

Captura01

Ability to create chained quizzes

Chained quizzes using if/then logic are valuable in providing a personalized experience for students.

For example, if a student gets a question wrong (let's say this question has a tag called "Algebra"), then we should be able to add logic that shows them another question with the same tag or set of tags.

A more advanced implementation would save the question tags along with frequency correct/incorrect with the student's profile. Then a simple algorithm can be used to recommend their next quiz or generate a quiz based on certain parameters.

Questions about TutorLMS

(1) What is the name of the PHP file where the instructor uploads the video to the "Topic"? example in the image below:
bbb

  1. Can I change the language of the plugin to Hebrew? Can I translate any field by myself?

Error Logged in debug.log

Handling a site for a client with WooCommerce installed alongside Tutor Pro. The following error repeatedly occurs.

[07-Oct-2022 02:21:35 UTC] WordPress database error You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'AND course_id = 1767 AND result_for != 'final'' at line 4 for query SELECT wp_tutor_gradebooks_results .*, grade_config FROM wp_tutor_gradebooks_results LEFT JOIN wp_tutor_gradebooks ON wp_tutor_gradebooks_results.gradebook_id = wp_tutor_gradebooks.gradebook_id WHERE user_id = AND course_id = 1767 AND result_for != 'final' made by do_action_ref_array('action_scheduler_run_queue'), WP_Hook->do_action, WP_Hook->apply_filters, ActionScheduler_QueueRunner->run, ActionScheduler_QueueRunner->do_batch, ActionScheduler_Abstract_QueueRunner->process_action, ActionScheduler_Action->execute, do_action_ref_array('woocommerce_scheduled_subscription_payment'), WP_Hook->do_action, WP_Hook->apply_filters, WC_Subscriptions_Manager::prepare_renewal, WC_Subscriptions_Manager::process_renewal, WC_Subscription->update_status, WC_Order->save, WC_Subscription->status_transition, do_action('woocommerce_subscription_status_updated'), WP_Hook->do_action, WP_Hook->apply_filters, TUTOR_WCS\WCSubscriptions->update_enrollment_status, TUTOR\Utils->update_enrollments, TUTOR\Utils->delete_course_progress, do_action('delete_tutor_course_progress'), WP_Hook->do_action, WP_Hook->apply_filters, TUTOR_GB\GradeBook->gradebook_generate, get_generated_gradebook

The closest I can dig this is to /var/www/html/wp-content/plugins/tutor-pro/includes/functions.php: line 24 apparently user_id being 0, it's using an empty value in the SQL? (Not an SQL expert).

Active Plugins (amongst others)
...
tutor,active,none,2.0.10
tutor-lms-certificate-builder,active,none,1.0.0
tutor-lms-elementor-addons,active,none,2.0.5
tutor-pro,active,available,2.0.9
woocommerce,active,none,6.9.4
woocommerce-services,active,none,1.26.3
woocommerce-gateway-stripe,active,none,6.8.0
woocommerce-subscriptions,active,none,4.5.1
...

video to a quiz

How do I add a video to a quiz?
I have an <iframe> but after trying to save everything goes out of question description.
I want to record the content of the question in a video and give qiuz to each question. The videos will be different.
It is important to me that there is a player for questions.

Using MD or HTML code in quiz questions

Hello! I am a programming teacher and it would be great to have an opportunity to use either MarkDown or HTML code tags to put something like that in questions:

int a = 4;
a++;

Right now it looks like this ```cpp int a = 4; a++; ```

It doesn't work with HTML either.

Another option is to have at least a possibility to upload an image to a question, not only answers (like multiple choice).

Unable to make finishing a quiz mandatory

Unable to make finishing a quiz mandatory before going to the next topic/lesson.
This is a serious issue. My younger students need to to be forced to take and finish a quiz.

Complete Lesson button only visible on Mobile

Hello,

I really like the plugin and I have one small issue. Right now it is not possible to mark a lesson as completed. This because the progress bar, where the complete button is placed, is only visible for mobile users. The progess bar is also only visible for mobile.

I think this is very important, because right now desktop users can not set a lesson to completed.

Bildschirmfoto 2022-05-30 um 15 16 30

Telegram sharing button

Please add Telegram to social sharing buttons 🙏

https://t.me/share/url?url={url}&text={text}

/**
 * @param string $url Absolute URL to share, e.g. "https://example.com/path/to/article?with=params"
 * @param string $text Optional comment to share URL with, e.g. "Check out this article!"
 * @return string Button HTML markup, feel free to modify to your taste
 */
function telegramForwardButton($url, $text = '') {
  $share_url = 'https://t.me/share/url?url='.rawurlencode($url).'&text='.rawurlencode($text);
  return "<a href=\"{$share_url}\">Share</a>";
}

https://core.telegram.org/widgets/share

RODO - Functions needed

Hello!

I noticed that EU people need checkboxes to accept the privacy policy. Can you add the possibility to add text next to every possible place to enter text, e.g. registration form? (Not counting in quizzes).

Buying courses with amazon pay does not enroll students

Hello together,
using woocommerce as monetarization works fine for all payment methods i tested ( six different ones) but when using amazon pay the payment sucessfully finished in woocommerce but does not lead enroll the user in the course he/she brought with tutor lms.

Can you give me a hint what the reason could be?

  • I'm guessing woocommerce_new_order_item is not fired with amazon pay, but I do not know how to confirm that.
  • I validated the enrollment posts in the database are actually missing by that query:
SELECT * FROM `wp_posts` WHERE `post_status` LIKE "completed"`

I'm using c430863

Avoid students to be enrolled automatically after the payment (EDD)

In order to make this possible is needed to avoid students to be enrolled in the first place, which means after they buy a course.
The filter hook tutor_enroll_data would be the first choice but...that's not possible with EDD (no idea about the other payment options) because the function edd_update_payment_status calls complete_course_enroll at the end (so the course starts immediately after the payment).

This is what I had to do since no hook was present in the EDD code to stop the enrolment.

add_action('edd_update_payment_status', function( $payment_id, $new_status, $old_status ){
	global $wpdb;

	// when a new payment is completed
	if( $old_status=='pending' && $new_status=='publish' ) {
		$enrolled_ids_with_course = tutor_utils()->get_course_enrolled_ids_by_order_id($payment_id);
		if ($enrolled_ids_with_course){
			$enrolled_ids = wp_list_pluck($enrolled_ids_with_course, 'enrolled_id');

			if (is_array($enrolled_ids) && count($enrolled_ids)){
				foreach ($enrolled_ids as $enrolled_id){
					
					// tutor_utils()->complete_course_enroll($payment_id);
					// this last call of "edd_update_payment_status" makes post_status=='complete': we want to revert that to pending so...
					
					// ...we immediately switch back the enrollment status to 'pending'
					$wpdb->update( $wpdb->posts, array( 'post_status' => 'pending' ), array( 'ID' => $enrolled_id ) );
				}
			}
		}
	}
	
}, 99, 3);
// if priority>10 fires after:
// add_action('edd_update_payment_status', array($this, 'edd_update_payment_status'), 10, 3);
// https://github.com/themeum/tutor/blob/54984cd5e81e35dc9ab0b5809e2c218ef9cfc4e9/classes/TutorEDD.php

Hope this can help others or to improve LMS Tutor 🙏

Login button on course page redirects to Student Dashboard

The login form/button on the course page is redirecting to the student dashboard instead of the course page itself.

I fixed it by changing the content of else condition on line 69 with the following line of codes in classes/FormHandler.php

else { //Redirect page $redirect_page = tutils()->array_get('redirect_to', $_REQUEST); if ( ! $redirect_page){ $redirect_page = tutor_utils()->tutor_dashboard_url(); } tutor_redirect_back(apply_filters('tutor_login_redirect_url', $redirect_page)); }

Recent quiz update in 1.8.10 is causing exception

Recent quiz update in 1.8.10 is causing below error -

Created a quiz with single choice questions. After opening the quiz when user selects the and – clicks on the “Answer & nExt question” button. Nothing happens.

WordPress : 5.7.2
Tutor LMS : 1.9.1

Checked in both chrome and firefox latest version.

Exception in the inspect -
tutor-front.js?ver=1.9.1:789 Uncaught TypeError: Cannot read property 'split' of undefined
at feedback_response (tutor-front.js?ver=1.9.1:789)
at HTMLButtonElement. (tutor-front.js?ver=1.9.1:607)
at HTMLDocument.dispatch (jquery.min.js?ver=3.5.1:2)
at HTMLDocument.v.handle (jquery.min.js?ver=3.5.1:2)

https://imgur.com/a/I7MnBcX

Update which is causing the exception -
1608220

assets/js/tutor-front.js

Plyr Video Player Controls not showing up

Hey there,
First things First I am a fan of this great LMS plugin. I like the way the developer folks have contributed and developed the plugin and provided as a free and open source great looking LMS plugin like a cherry on a cake. Coming to the issue I just noted that the LMS plugin is using plyr JS plugin which is also a great alternative to HTML5 video but the player used in the plugin doesn't show up the controls like mute and volume controls. At the beginning it was displaying the full screen and settings menu for video playback only.

To resolve this issue I have followed the documentation for the plugin on GitHub repo.
There I found that we can add options directly for the player controls while initializing the plugin. so I have tweaked the given JS code on tutor-front.js file.

Below is the code snippet for reference:


         const player = new Plyr('#tutorPlayer', {
	      controls: [
		'play-large', // The large play button in the center
	        'restart', // Restart playback
	        'rewind', // Rewind by the seek time (default 10 seconds)
		'play', // Play/pause playback
		'fast-forward', // Fast forward by the seek time (default 10 seconds)
		'progress', // The progress bar and scrubber for playback and buffering
		'current-time', // The current time of playback
		'duration', // The full duration of the media
		'mute', // Toggle mute
		'volume', // Volume control
		'captions', // Toggle captions
	        'settings', // Settings menu
		'pip', // Picture-in-picture (currently Safari only)
	        'airplay', // Airplay (currently Safari only)
		'download', // Show a download button with a link to either the current source or a custom URL you specify in your options
		'fullscreen', // Toggle fullscreen				
           ]
	});

I hope this small solution makes sense for the controls to show up. All the controls are visible on my plugin player.

Thanks 😄

Quiz pass/fail actions?

I can't find a way to hook into a single pass or fail event for quizzes. I can see that the pass/fail(let's call it the quiz's status) is calculated just in time, for example here:

$earned_percentage = $attempt->earned_marks > 0 ? ( number_format(($attempt->earned_marks * 100) / $attempt->total_marks)) : 0;
$passing_grade = (int) tutor_utils()->get_quiz_option($attempt->quiz_id, 'passing_grade', 0);
?>
<tr class="<?php echo esc_attr($earned_percentage >= $passing_grade ? 'pass' : 'fail') ?>">

I have considered hooking into tutor_quiz/attempt_ended and calculating it like the example above to decide whether a student has passed or failed the quiz.

However, if a manual review is required, as in https://github.com/themeum/tutor/blob/master/classes/Quiz.php#L309, then the hook above isn't reliable to hook into a pass/fail event. So, I started looking at tutor_quiz_review_answer_after and check if the attempt has ended to calculate pass/fail. This runs for each answer though.

Are there any thoughts on running the tutor_quiz/attempt_ended hook at the end of a manual review?

Or maybe, about adding something on the lines of tutor_quiz/attempt_passed or tutor_quiz/attempt_failed actions?

I'm a developer too so can help with code contributions, if needed.

Gutenberg editor for Lesson

https://wordpress.org/support/topic/gutenberg-editor-for-lesson-and-quiz/

I have a case where I want to copy and paste content from Google Docs into Lesson, where this only works when using the Gutenberg Editor, while for now Lesson only supports using the Classic Editor, and it makes it difficult for me to move content from Google Docs into Lesson, I’ve tried several plugins like Jetpack and Mammoth Docx Converter, but they didn’t live up to my expectations (there are still some bugs).

I have found the solution by changing the tutor/classes/Post_types.php file

below the following code

'show_in_menu' => false,

it becomes

'show_in_menu' => false,
'show_in_rest' => true,

but I hope this can become official support from Themeum without me having to manually edit every time there is an update.

Suggestions : add option for hiding a lesson and highlight the current lecture

Hi !

Tutor LMS is great and I am glad we bought the full license for my school.

However, some things could be improved for real world lectures in schools (and not online lecture) :

  • when preparing lessons, I would love to have a switch button to hide the lessons content until I am ready to show it. I know there is content drip but it is not the same.
  • during the course of the semester, it would be nice to be able to highlight the current lesson of the week

image

Cheers,

Topic lesson and orders not always working

Bug

Next and Previous links on a lesson don't always link to the correct Lesson or Quiz, and will default to the last Lesson or Quiz in the topic.

Temporary fix

Rearrange the order, save, and then change it back.

Quiz validation not working properly

If the questions given to the user are in random order, he or she will sometimes get wrong evaluation.

82644352-78021180-9c11-11ea-9e5c-21a459a98b8e

If I disable this option and set it to sorted/ascending/descending - it works properly.

IncorrectPrevious Attempt time.

Hi,
I just notice the previous attempt time showing incorrect.

Steps to reproduce:

  • Take any Quiz
  • submit it or let the timer runs out
  • check the previous attempt time.

In my case, i have given test at 16 May 2020, 10 am and its showing time as screenshot below.

Screenshot 2020-05-16 at 10 11 50 AM

Group questions together with a single prompt

Many quizzes require questions to be grouped with a certain prompt. For example, I might display a chart or a paragraph of text followed by three questions about it. The SAT and ACT both use these grouped questions heavily and this feature is extremely valuable.

Redirect Problem with NavBar's links on Enrroled Course Page

Hello friends of Tutor Pro LMS.
My name is Aragon Lima, I'm from Brazil and I'm having a problem with redirection and slugs with the Nav Bar's that are on the Course's page of the student who is enrolled.

I used the CTP Slug Change plugin to change the slug Courses for our "Cursos" ... It worked normal for other pages, however, for these nav bars it didn't work.

Look this Video https://www.loom.com/share/e5599253b4204cf2a7c1c92cd104a241

Student Registration (password error)

Each a new student tries to register and they fill out their name, username, email, and password then click register. An error message comes up saying "Error: Please enter a password". I check this several times myself by trying different passwords to put in and the same message keeps coming up. Can someone please help me with this issue
student_registration

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.