public function modulesActiveOn($periodId)
    {
        $courses = $this->coursesActiveOn($periodId)->pluck('course_id');
        return StudyModule::whereHas('modulesByPeriod.courses', function ($query) use ($courses)  {
            $query->whereIn('course_id',$courses);
        });
    }