@Anonymous
This would be a great place for an EditForm as it has an Unsaved property and handles all the save for you.
However, if you are going with a Gallery, there are some ways to go about this. One of my favorites is a string comparison. Typically I will create a label that has a string built from all of the values concatenated together from the controls in the gallery. At the same time, I will take the original record for the whole gallery and create the same exact string based on the record. Then it's any easy job to just compare the two. The label for the gallery values will change dynamically based on any changes in the gallery, so once a change is made, then the strings will not compare.
Example, let's say we have a gallery for section 1 with a dropdown in it (Dropdown1) for projects. And we have a data record for section 1 with the following records:
[{Question: 1, Answer: "ProjectA"}, {Question: 2, Answer: "ProjectB"}, {Question: 3, Answer: "ProjectC"}]
I would have a label on the screen (usually hidden), we'll call it lblGalVals. It has a Text property of:
Concat(Gallery1.AllItems, Dropdown1.Selected.Value)
Optionally we could have another label with the underlying record put together (I say optionally because this can be done elsewhere). Let's call it lblRecVals and its text property would be:
Concat(section1Records, Answer)
Initially your Gallery would display the record values (not going to get into setting the default properties here, but that is what would be needed). So, the lblGalVals would show : ProjectAProjectBProjectC and the lblRecVals would show : ProjectAProjectBProjectC
Now, I can use a Toggle control and set its default property to !(lblGalVals.Text = lblRecVals.Text)
This Toggle would be true when there are changes and false if not.
If someone changes a dropdown in the gallery, the lblGalVals text will change and thus the Toggle will go true (on).
You can then simply check the Toggle to see if it is true to determine if you need to write back to the datasource.
I hope that is relatively clear.