apluslms / a-plus

A+ frontend portal - A+ LMS documentation:
https://apluslms.github.io/
Other
68 stars 73 forks source link

Set chapter as module model answer #1229

Closed Mikael-Lenander closed 1 year ago

Mikael-Lenander commented 1 year ago

Description

What?

Modules can be configured a chapter as model answer. The chapters visibility is controlled through a RevealRule.

Why?

Chapters may include prujus to previous modules, especially in O1.

How?

Adds model answer and reveal rule fields to CourseModule. A Chapter can check (by reversing the relation) if it is a model solution to a module. Any LearningObject can check if it is a child of this kind of Chapter. Adds a key 'is_revealed' to every LearningObject entry in cache. Updates exercise permission class to check LearningObject's visibility. Adds new reveal state that takes all module's exercises into account.

Fixes #1098

Testing

Remember to add or update unit tests for new features and changes.

What type of test did you run?

Made chapter 2.0 module 1's model answer. Added deadline deviation to module 1 for student so that module 1 and 2 are open simultaneously. Made sure chapter 2.0 is not visible to student, not through toc, results or direct link.

Did you test the changes in

Think of what is affected by these changes and could become broken

Translation

Programming style

Have you updated the README or other relevant documentation?

Is it Done?

Clean up your git commit history before submitting the pull request!

Mikael-Lenander commented 1 year ago

Still fixed linting errors.