Assignment Answers/Explanations (Repost due to formatting issues)

Home Forums Legacy Support Support queries How-to & Troubleshooting Assignment Answers/Explanations (Repost due to formatting issues)

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #55328
    mesrick
    Spectator
    <span style="color: #4b4d4d; font-family: Lato; font-size: 14px;">We had you guys do a customization a while back such that assignments would display an explanation/answer to students only after they submit that assignment. I was provided with the following code, but it no longer works. I was hoping for an update/fix:</span> add_filter('wplms_assignments_metabox','custom_explantion');   function custom_explantion($wplms_assignments_metabox){   $wplms_assignments_metabox[]=array( // Single checkbox   'label' => __('Explanation','vibe-customtypes'), // <label>   'desc'  => __('Assignment explanation','vibe-customtypes'), // description   'id'    => $prefix.'explanation', // field id and name   'type'  => 'editor', // type of field   'std'   => ''   );   return $wplms_assignments_metabox;   }   add_action('wplms_assignment_after_content','show_explanation');   function show_explanation(){   global $post;   if(is_user_logged_in()){   $user_id=get_current_user_id();   $user_time = get_user_meta($user_id,$post->ID,true);   $assignment_time = get_post_meta($post->ID,'vibe_assignment_duration',true);   $assignment_duration_parameter = apply_filters('vibe_assignment_duration_parameter',86400);   $expiry = $user_time+$assignment_time* $assignment_duration_parameter;   $assignment_finished = get_post_meta($post->ID,$user_id,true);   if(isset($assignment_finished) && is_numeric($assignment_finished) && $expiry < time()){   $explanation= get_post_meta( $post->ID,'explanation',true);   if(isset($explanation) && !empty($explanation))   echo  apply_filters('the_content',$explanation);   }   }   }
    #55408
    H.K. Latiyan
    Participant
    Duplicate topic and will continue the discussion on the original topic: https://wplms.io/support/forums/topic/assignment-answersexplanations/   Therefore closing the topic.
Viewing 2 posts - 1 through 2 (of 2 total)
  • The topic ‘Assignment Answers/Explanations (Repost due to formatting issues)’ is closed to new replies.