Teachers can access Assessments for courses they aren't assigned

Hello!

I'm having an issue where teachers can currently access the assessment pages for all the units of every course, even ones they aren't assigned to. Is there a way to limit their access to only the courses they've been assigned? I don't want teachers to be able to mark each other's courses unless they've been assigned to the course.

Thanks,
Paul

  • Vinod Dalvi

    Hi Paul,

    Thank you for your patience here.

    Is there a way to limit their access to only the courses they've been assigned?

    I have tested it on my test site using latest version of CoursePress Pro plugin and found the non admin instructors can only access the courses which are assigned to them. The admin instructors can access all the courses regardless whether they have been assigned to them or not as they have this capability.

    I'm having an issue where teachers can currently access the assessment pages for all the units of every course, even ones they aren't assigned to.

    Yes i could confirm this on my test site.

    To restrict instructors only access the assessment pages for all the units of only assigned courses to them, just edit the following CoursePress Pro plugin file on line number 175 as displayed below.

    CoursePress Pro plugin file :
    /wp-content/plugins/coursepress/includes/admin-pages/assessment.php

    Before Editing :

    foreach ( $courses as $course ) {
    	$show = false;

    After Editing :

    foreach ( $courses as $course ) {
    	$show = false;
    $can_update              = CoursePress_Capabilities::can_update_course( $course->ID );
    $can_delete              = CoursePress_Capabilities::can_delete_course( $course->ID );
    $can_publish             = CoursePress_Capabilities::can_change_course_status( $course->ID );
    $can_view_unit           = CoursePress_Capabilities::can_view_course_units( $course->ID );
    $my_course               = CoursePress_Capabilities::is_course_instructor( $course->ID );
    $creator                 = CoursePress_Capabilities::is_course_creator( $course->ID );
    
    if ( !$my_course && !$creator && !$can_update && !$can_delete && !$can_publish && !$can_view_unit ) {
    continue;
    }

    Best Regards,
    Vinod Dalvi

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.