Home › Forums › Legacy Support › Support queries › Other issues › Timed Units Not Working
- This topic has 3 replies, 2 voices, and was last updated 8 years, 5 months ago by Anshuman Sahu.
Viewing 4 posts - 1 through 4 (of 4 total)
-
AuthorPosts
-
November 3, 2015 at 11:25 pm #6848ksalbrightParticipantHave I installed the code correctly? <?php /* Plugin Name: WPLMS Customizer Plugin Plugin URI: http://www.Vibethemes.com Description: A simple WordPress plugin to modify WPLMS template Version: 1.0 Author: VibeThemes Author URI: http://www.vibethemes.com License: GPL2 */ /* Copyright 2014 VibeThemes (email : [email protected]) wplms_customizer program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2, as published by the Free Software Foundation. wplms_customizer program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with wplms_customizer program; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ include_once 'classes/customizer_class.php'; if(class_exists('WPLMS_Customizer_Plugin_Class')) { // Installation and uninstallation hooks register_activation_hook(__FILE__, array('WPLMS_Customizer_Plugin_Class', 'activate')); register_deactivation_hook(__FILE__, array('WPLMS_Customizer_Plugin_Class', 'deactivate')); // instantiate the plugin class $wplms_customizer = new WPLMS_Customizer_Plugin_Class(); } function wplms_customizer_enqueue_scripts(){ wp_enqueue_style( 'wplms-customizer-css', plugins_url( 'css/custom.css' , __FILE__ )); wp_enqueue_script( 'wplms-customizer-js', plugins_url( 'js/custom.js' , __FILE__ )); } add_action('wp_head','wplms_customizer_enqueue_scripts'); add_action('wp_enqueue_scripts','wplms_customizer_custom_cssjs'); /** * Objective: Register & Enqueue your Custom scripts * Developer notes: * Hook you custom scripts required for the plugin here. */ function wplms_customizer_custom_cssjs(){ wp_enqueue_style( 'wplms-customizer-css', plugins_url( 'css/custom.css' , __FILE__ )); wp_enqueue_script( 'wplms-customizer-js', plugins_url( 'js/custom.js' , __FILE__ )); } add_filter('wplms_unit_mark_complete','wplms_unit_miniumum_time',1,3); function wplms_unit_miniumum_time($mark_unit_html,$unit_id,$course_id){ $unit_time = get_post_meta($unit_id,'vibe_duration',true); $unit_duration_parameter = apply_filters('vibe_unit_duration_parameter',60); $units = bp_course_get_curriculum_units($course_id); $key = array_search($unit_id,$units); if($key > 0){ $pre_unit_completion_time = get_user_meta($user_id,$units[$key-1],true); $unit_time_spent= ($pre_unit_completion_time+$unit_duration_parameter*$unit_time) - time(); if($unit_time_spent > 0 ){ // Minimum time remaining echo "<script>jQuery(document).ready(function(){ $('#mark-complete').addClass('disabled'); setTimeout(function(){ $('#mark-complete').removeClass('disabled'); }, $unit_time_spent); });</script>"; } } return $mark_unit_html; } ?>November 4, 2015 at 10:35 am #6940Anshuman SahuKeymasterYEs the tip is not working as of now . You can enable the unit time as drip feed feature for now from Lms ->Settings till we update the tip . Just enable the drip feed in your course and enable Enable Unit Time as Drip Duration form lms settings .November 4, 2015 at 2:06 pm #7013ksalbrightParticipantOk, that worked...But.. Even the finished users are stopped from accessing the units for review based on duration. Any way to make this a first time through option?November 5, 2015 at 1:32 pm #7204Anshuman SahuKeymasterYes this is an issue with drip feed you have to set the drip feed form the starting of the course when no user is added to it . But in your case students are already added in the course and you have enabled the drip now after that . Now your old students can only access the previous units if you reset the course for them . Also we would update the related tip which is not working as of now soon ,
-
AuthorPosts
Viewing 4 posts - 1 through 4 (of 4 total)
- The topic ‘Timed Units Not Working’ is closed to new replies.