serlo / frontend

Next.js app that serves serlo.org
https://serlo.org
Apache License 2.0
38 stars 10 forks source link

Include the complete cohesive exercise groups #882

Closed kulla closed 3 years ago

kulla commented 3 years ago

After https://github.com/serlo/serlo.org/pull/595 got merged and deployed: When an cohesive exercise group is included via an injection not only the exercise but also its subtasks and their solutions.

Entkenntnis commented 3 years ago

Nice! Do you also need some kind of visual indicator that the exercise group is cohesive?

kulla commented 3 years ago

Nice! Do you also need some kind of visual indicator that the exercise group is cohesive?

Yes, we end up with changing the ordering from <ul> to <ol> in the subtasks

Entkenntnis commented 3 years ago

Some background info: Injections are using the same data fetching method as entity pages. This way, if we change the behaviour of a normal page view, injections will change in sync.

So the proposed change would be not to load a subexercise of a cohesive exercise (if accessed by id), but load the whole exercise instead. This can be achieved by a change in https://github.com/serlo/frontend/blob/staging/src/fetcher/request-page.ts (simliar to Course of Solution)

Hope this helps.

kulla commented 3 years ago

Actually when an exercise group is injected, always the full exercise with all sub exercises are injected. Thus we do not have to change anything :tada: