Hello,
I am struggling to wrap my head around a problem I am having with one of the sections of my survey.
For background, this part of the survey will be used to record dynamic cone penetrometer (dcp) blows per 50mm. Currently, the user can enter how many blows it took them to go down each 50mm increment. That is fine, and very simple however sometimes a single blow might go down multiple 50mm increments for example 250mm in one blow. If it does indeed take 1 blow to go down 250mm then the user would need to enter '0.2' in each of the fields.
In this case, what I am trying to do is allow the user to go to the depth that the dcp has dropped to, and enter '1'. I then want the survey to check to see if the 50mm increment before it has any data in it, if it doesn't then it will note that (assigning it a value of 1 in the background), it will then check the increment before that and so on so forth until it comes to an increment that has a value entered into it, at which point it will 'stop' (or assign it a value of 0). The survey will then divide the initial '1' (that we entered at the 250mm mark) by 1 (for the initial one) + the sum of all the other 1's (made up of previous fields who's string-length = 0) . It will then override the '1' we entered in the 250mm field and assign it the last of the '0.2's' that are now entered in the previous values.
It is important to note that '0' should not be considered an empty field, as it is possible to have 0 blows per 50mm if the dcp sinks under its own weight.
For every increment, except the first value some form of this logic will need to happen, checking back through each increment until a non empty string is encountered. Just struggling to figure out exactly how to go about this.
Any help would be much appreciated.
I have attached a photo of this part of the survey.
Cheers