Hi,
After installing the code from https://wplms.io/support/knowledge-base/lock-assignment-after-submission/ the whole website goes down with 500 internal server error. What could be wrong?
There was some html formating in the code.
I have updated the code. Please use that tip again in the wplms-customizer.php file and delete the old code, through ftp.
Hi,
Thank you for your assistance. Now it works, but I couldn't say it is worth to use because it locks not only the assignment text, but the whole page, and user can go back to profile only using arrows in browser. I thought that "lock assignment" means only input locking, not the disappearing of the whole page with navigation and contacts and everything:))
And now when the assignment in not submitted yet, the ### symbols appears on the top of the page.
Please try adding the given code in your wplms-customizer.php file in wplms customizer plugin and remove the previous code that you have added :
add_action('wplms_before_single_assignment','wplms_check_wplms_assignment_submission2');
function wplms_check_wplms_assignment_submission2(){
if(is_user_logged_in()){
$user_id = get_current_user_ID();
$assignment_id = get_the_ID();
$status = get_post_meta($assignment_id,$user_id,true);
if(isset($status) && is_numeric($status)){
if(!$status){
wp_die('Assignment under evaluation');
}else{
$link = bp_core_get_user_domain($user_id).BP_COURSE_SLUG.'/'.BP_COURSE_RESULTS_SLUG.'/?action='.$assignment_id;
?>
<script type="text/javascript">
window.location= <?php echo "'" . $link . "'"; ?>;
</script>
<?php
}
}
}
}
Hi Alex,
Thank you, that works.
But still, if possible I would prefer to lock only input screen, not the whole page:)
No this is not possible as of now.
I recommend you hire a freelancer for such customizations.
PS:Customization is not the part of theme support.
PS:Customization is not the part of theme support.
Nice to hear it in "WPLMS customizations" forum.