There are conditional activities and have you looked at the Lesson module docs.
Courses and course formats
Conditonal Release: viewing last page in a sequence?
Eztabaida hau blokeatu da eta beraz aurrerantzean ezingo duzu bertan erantzun.