Homework assignments ungraded but mandatory.
Then an in-class oral exam on a random subject drawn at exam entry.
Works great in my country.
At the end of the day, the responsibility is on the student to study.