kolplattformen / skolplattformen

The source code to the civic tech project Öppna Skolplattformen.
https://skolplattformen.org
Apache License 2.0
795 stars 176 forks source link

Hjärntorget - Some messages shows on all children #600

Closed archevel closed 1 year ago

archevel commented 2 years ago

Currently some messages are being shown for all children even though the content of the message makes it clear that it belongs only to children at a particular school.

Currently we divide messages a partent receives (fetched via a call to https://hjarntorget.goteborg.se/api/wall/events?language=en&limit=500) between their children by checking if the creator/sender have a common event with any child. This is done by calling https://hjarntorget.goteborg.se/api/event-members/members-having-role?eventId=${eventId}&roleId=${roleId}) for each event returned by https://hjarntorget.goteborg.se/api/events/events-sorted-by-name?offset=0&limit=100 and checking each role for that event.

That means we have a list of all common participants (students and teachers and possibly others depending on the roles associated with the event). So if the sender and child are both participants in some event together we will show the message as a Notification for that child.

However, some events do not include any students (for instance: 138JÄTS 21/22 VH F-9 with id 175700) and this event is used at some of my childrens' school to send messages to the guardians of students. At the moment these messages, that we can not connect to a particular set of children, is shown under the "News". Unfortunately this means they also show up for children attending another school or daycare.

Is there a way of connecting these messages so they only need to be shown as news/notifications for some children? One approach, albeit prehaps a bit unreliable, would be to use the name of the events: 138JÄTS 21/22 VH F-9 and 138JÄTS 21/22 7B have a common prefix: 138JÄTS 21/22. So this could be used to check for connectedness between children and senders even when they don't belong to a common group. Is there a better approach?

irony commented 1 year ago

Hjärntorget integrationen fungerar inte längre- vi behöver mer hjälp från er som är programmerare och har barn i Göteborg för att få stöd för Vklass. Skicka PM så kommer ni åt vår Discord där vi har diskussioner om hur det ska kunna gå till.