Showing unique element in a repeating group

Hi all,

I’m creating a portal for teachers to manage students in their class and the subjects they take. The subjects can be whatever they like - English, Math, Science, etc so I’ve added a text field so that the teacher can name the subject whatever they like. As well as the subject, there’s also a year-level associated with that subject .ie - Level 3, Level 4 etc.

When a teacher creates a new student, I want to give them the option to add all the unique subjects of previous students as most students will be the same and it will also help remove work for the teacher having to create the same fields over and over.

My database (simplified) looks like this.

Subject

  • Name (text)
  • Level (text)

Student

  • Student name (text)
  • Subjects (list of subjects)

User

  • Student (list of students)

I’m using a repeating group to show the different subjects that the students take using the following data source - Current user’s Students:each item’s Subjects - and that’s giving me all the students subjects back when I create a new student.

The problem -
That’s all working exactly as I had hoped but now it’s also bringing back double ups of subjects. ie. Maths, Maths, Science, etc. What i thought I could do was use the :unique-elements selector to filter out double ups of the same subjects however, because I’m using the text, the unique identifier for each subject is different no matter if the subject name is the same. I can use “text” in my “type of content” repeating group and that gives me back unique subject names but doesn’t then let me also add the “Level” associated with that subject so I’m a little lost in what I should do next.

Can anyone point me in the right direction? I feel like I’ve been going in circles for a few days now and I can’t figure out how to fix it.

@mikeloc - sorry for tagging you in this and bothering you but is there any recommendations you could give me to figure this out? Thanks!

Can you post a wireframe of your intended screen?

Thanks for replying. When you say intended screen, do you mean the result I’m looking for?

Yes the screen you’re trying to build… a wireframe or mock

Since you tagged me, @findlaterapps, it’s real simple… I would likely use an option set for the subjects, and not only would that probably be a better way (arguably) to go, but it would probably make everything you are trying to do easier.

Sorry that it’s crude but I have got to the design stage yet. I’m trying to figure out the functionality first but it will look something like this -

Add a student

First name


Last name


Gender
< --Select →

Add subjects from previous students
x Maths
x Science
x English

Well I’d comment a couple things based on that…

  1. Subjects are typically a known list… there aren’t really any subjects that exist that we don’t know of beforehand. My first comment would be to use option sets to list out all the possible subjects - This of course means users won’t be able to add and remove subjects.

  2. Sooo if for whatever reason it’s a key part of your app that users need to be ale to add subjects - why can’t you be loading the subjects table data, rather than the subjects that have been added to students?

My last comment would be that you should think about your user journeys and screens, before building. I can tell you that without a doubt you will end up needing to configure everything

Thanks for replying @mikeloc - agreed, that would be the easier solution but I want to give teachers as much flexibility as possible. Of course there would be core subjects like Maths, English, Science - but there could also be Art, Religious Studies, Geometry or even something completely bespoke to a single school. I want to give the teacher complete flexibility to add whatever they want. I feel that I may not be able to have that by using text as the subject name. Is that correct?

Typically teachers teach against a curriculum that is regulated by some state/territory government. They can’t really ‘make up’ subjects.

How will you handle scenarios where someone adds ‘Maths’ and someone else adds ‘Mathematics’? This seems like a nightmare to manage and will impact the user experience.

1 Like

Absolutely. Typically there is a standardised curriculum. However this app will cater for students from 5 years old all the way through to 18+. As a 5 year old (for example) there could be a subject called “Learning through play” or “Creativity class”. Lame examples I know, but hopefully you get the point as to why I want it to be flexible. Schools do have a standardised curriculum but they’re also completely different and do have quirks between each other. @thethinklab.au

And that’s exactly why I’m trying to build this system. So that when a teacher adds Mathematics, they don’t then create a new subject for a new student called Maths. It would already be there as a checkbox indicating that the subject Mathematics

Ok - could you not just load the subjects table data then, given they should all be unique?

On whatever screen the teacher is allowed to create subjects, you should have validation to check whether it exists already - meaning no duplicates…

This topic was automatically closed after 70 days. New replies are no longer allowed.