Forum Replies Created

Viewing 15 replies - 16 through 30 (of 37 total)
  • Thread Starter jstead

    (@jstead)

    Thanks for the prompt reply icc0rz.

    How is the interactive elements rendered over the YouTube video? Is there a specific file you could point me too to see if the private video sources I have researched could be spliced in the YouTube embed codes place (some have very similar default embed structure).

    Thread Starter jstead

    (@jstead)

    Looking into alternate methods of speeding up the translating process. Are there any ways of exporting H5P content, then re-importing?

    Planning to try apply translations to the exported data and re-import.

    Also looking at wp-export plugin to see if it will export/import H5P content.

    Thread Starter jstead

    (@jstead)

    Yes I did flush the permalinks and clear all caches/test in incognito.

    The odd thing is all links when you mouseover are still English. Its not until you click a link and it hits the English /lesson/class/ page that post-type lesson gets translated and then results in the 404.

    Its almost like the front end is translating but the admin section is still in English.

    Thread Starter jstead

    (@jstead)

    Great, thank you for quick response.

    Worked perfectly, and didn’t see any PHP errors on first load either (don’t have database access on this particular box so couldn’t clear that DB table)

    Thread Starter jstead

    (@jstead)

    Thats right, the prerequisites would completely remove this issue from being accessible in the first place and make any fix redundant.

    Sorry about that… been long week ??

    Thread Starter jstead

    (@jstead)

    Hi Thomas,

    No worries at all, thank you for following up. Appreciate it.

    After using it for a bit, I agree with the case for having them all, so that there is a complete picture of the multiple steps needed before getting to your clicked link. I think its just in our use case, it’s a huge block of text.

    I actually got some interesting feedback from our team when bringing up this questions, our product in fact handles a similar situation in a similar way, but minimizes the message by combining the reported text.

    e.g “The lesson “[lesson accessed]” cannot be accessed until the required lessons [x], [y] and [z] are completed”
    Not sure if the way the data is gathered could be tweaked in this way for a happy medium?

    But for our immediate use I was able to use ul.llms-error li:not(:first-of-type){display: none;} to only show the message for the link clicked.

    Thank you again for the great support!

    Thread Starter jstead

    (@jstead)

    Your 100% right, this function looks to be exactly what I need. Thank you very much.

    I’ll test this out and let you know how I go.

    Thread Starter jstead

    (@jstead)

    Hi Thomas,

    Thank you and I understand… I now see where I saw it on the next lesson button. I didn’t mean having the tool-tip display on the page reload, but when you mouse-over a side menu item that you don’t have perquisites for.. preventing the ability to click it in the first place (similar to the next lesson button).

    With the display issue, in the below image each lesson has a perquisite of the previous lesson
    Example of bulk perquisites display

    So when I click on “service testimonial” It only redirects to the last lesson with passed perquisites(Review and Authorize), but returns the error message for every lesson between it and the one I selected. (in this example 5).

    Should this only display the first required perquisite (the bottom one in the image) and not stack them?

    Thanks,
    Jason
    Note: As temporarily fix I have hidden all <li> tags within ul.llms-error excluding the last-of-type to only show the bottom one.

    Thread Starter jstead

    (@jstead)

    Ok, so I think i’m extremely close to getting this to work. Just when I add the final function mentioned here I get a 500 Internal Server Error from the ajax call.

    First I have the below function setup some global variables

    add_action( 'wp_footer', 'variable_setup');
    function variable_setup() {
    ?>
    <script>
    	console.log('start');
    	var llms_objectid = '<?php echo get_the_ID(); ?>';
    	var llms_userid = '<?php echo get_current_user_id(); ?>';
    	var llms_objecttype = '<?php echo get_post_type(); ?>';
    	console.log('id: ' + llms_objectid + ' | user: ' + llms_userid + ' | type: ' + llms_objecttype);
    </script>
    <?php
    }

    I then use these global variables in the ajax call triggered by a button click

    $('.footer-logo').click(function() {
    	$.ajax({
    		method: 'post',
    		url: my_ajax_object.ajax_url,
    		data : {
    			action: 'llms_custom_marke_complete' ,
    			objectid: llms_objectid ,
    			userid: llms_userid , 
    			objecttype: llms_objecttype
    		},
    		success : function(data) {
    			alert(data);
    		},
    		error:function(exception){
    			alert('exception: '+exception);
    		}
    	});		
    });

    This is the function triggered by the ajax call.

    function llms_custom_marke_complete() {
    	$object_id = $_POST['objectid'];
    	$user_id = $_POST['userid'];
    	$object_type = $_POST['objecttype'];
    	$trigger = 'custom complete';
    	
    	/*echo 'id: ' . $object_id . ' | user: ' . $user_id . ' | type: ' . $object_type;*/
    	
    	function llms_mark_complete( $user_id, $object_id, $object_type , $trigger) {
    		$student = new LLMS_Student( $user_id );
    		return $student->mark_complete( $object_id, $object_type, $trigger );
    	}
    	die();
    }
    add_action( 'wp_ajax_llms_custom_marke_complete', 'llms_custom_marke_complete' );

    If I comment out the function llms_mark_complete the ajax works (the currently commented echo is returned through the alert in the ajax success: But if I enable the llms_mark_complete() function, I get 500 Internal Server Error.

    Anyone got this working or see any errors in my setup?

    Thread Starter jstead

    (@jstead)

    completely understand and thank you for the great work.

    I found a plugin that ‘kinda’ works, but should hold us out (it filters by the section/course bu only displays ID numbers, not name. So just need an ID>name cheat sheet while working on it).

    If I get anything working better i’ll post it here.

    In all my projects I add a custom Javascript file for custom code editions like this.

    Add the following code to your function.php to load a custom javascript file from the following location [yourTheme-child]/js/custom-scripts.js

    // Load Custom JavaScript file
    function mytheme_custom_scripts() {
    	if ( ! is_admin() ) {
    		wp_enqueue_script('jquery');
    		$scriptsrc = get_stylesheet_directory_uri() . '/js/';
    		wp_register_script( 'myhandle', $scriptsrc . 'custom-scripts.js', 'jquery', '1.0',  TRUE );
    		wp_enqueue_script( 'myhandle' );
    	}
    }
    add_action( 'wp_enqueue_scripts', 'mytheme_custom_scripts' );

    Then within that JavaScript file add the previously mentioned snippet within a JQuery document ready function.

    jQuery(document).ready(function($) {	
    	var lessonCompleted = false;
    	if($('#llms_mark_complete').length == 0){
    		lessonCompleted = true;
    	};
    	
    	$('.llms-next-lesson').click(function(e) {	
    		if(lessonCompleted == false){
    			e.preventDefault();
    			$('#llms_mark_complete').trigger("click");
    		} 
    	});
    }

    I made this prior to the incomplete button being added, so not sure how it works… but from what I can gather, you wouldn’t want the incomplete button to have the functionality this gives (combining with the “next-lesson” button)

    Thread Starter jstead

    (@jstead)

    Thank you for the prompt reply.

    So that function, is 1 redirect per lesson? Is the 10, 1 in add_filter the lesson ID?

    Unfortunately, in our use case, one lesson has 3 buttons… each taking the student to a different lesson section, at the end of these sections they then end up at a final common lesson…
    So wouldn’t be utilizing the default mark-complete button, which is why the manual mark complete would be ideal. Currently have the redirects working but cant get the lessons with these links to be marked complete on clicking.

    /— Section1/Lessons —\
    Lesson —– Section2/Lessons —– Lesson
    \— Section3/Lessons —/

    Thanks,
    Jason

    Sorry, on another note… I can see our lesson page getting very big with common named lessons within different courses… Is it possible to add a filter by course dropdown on the lessons admin page? I tried doing this myself, but could only find filter by taxonomy methods, and by the looks of it, the course column is another post_types not taxonomy

    I did something that might help. We only wanted to one button at the bottom to avoid confusion, so made the “next lesson” button trigger the mark complete button via jquery and hide it via css.

    The issue to work around though is that IF the lesson is complete, the mark complete button doesn’t exist so you need to test for it first.

    // test if lesson is already complete by checking if the mark_complete div exists
    var lessonCompleted = false;
        if($('#llms_mark_complete').length == 0){
        lessonCompleted = true;
    };
    
    // if the lesson in NOT complete this will trigger the mark complete button. If lesson IS complete the next lesson button will function as normal.	
    $('.llms-next-lesson').click(function(e) {	
        if(lessonCompleted == false){
            e.preventDefault();
    	$('#llms_mark_complete').trigger("click");
        }
    });

    Technically the above could be triggered from other events but would then need an else statement triggering the ‘next lesson’ button.

    Thread Starter jstead

    (@jstead)

    Hi Jules,

    Did some tests, and looks to work really well. Couldn’t break it. Setup exactly as above use case and tested to, From, Subject and Additional Headers fields.

    Only issue, wasn’t even to do with the conditionals itself, but CF7 in general, and the Contact Form DB plugin I use to store entries.
    The fact that all ‘consistent’ fields among conditional sections have to be unique. Means have [name1] – [name6], [subject1] – [subject6] etc, which bloats out the Database

    Don’t wonder there is a way of being able to use the same form ID in multiple conditional sections?
    at the moment, it pulls the data from the last “entry” of a specific ID.

    Thread Starter jstead

    (@jstead)

    Great, thank you for the prompt reply.

    That pipes method will defiantly be useful in what we are looking to do… but might need to manually do the conditional using 4 separate forms, as the full use-case is conditional groups within a conditional group.

    users 1st selects from 4 departments…. but then in 1 department there are 3 regions to choose from. So, there are 6 end recipients.

    department1 – {form > [email protected]}

    department2 – region1 – {form > [email protected]}
    – region2 – {form > [email protected]}
    – region3 – {form > [email protected]}

    department3 – {form > [email protected]}

    department4 – {form > [email protected]}

    Will the update use the [group] as separation for the To: field and be able to work with a nested conditionals setup?

Viewing 15 replies - 16 through 30 (of 37 total)