Ok, after much searching i finally decided to ask. (Newbie to this forum so I apologise if I don't use correct format)
I have built an assessment that pulls through X number of questions from a questionbank.
The questionbank sits in a single js file whilst the code controlling everything sits in another js file. This is so the users can update the questions without messing around with the code. (All this is client side - cannot run on server)
My problem is this: The question bank is in an array and the non-tech people updating it misses the quotes, commas etc needed to keep the structure of the array.
I have built a validation function (try catch etc) but if the structure of the array is compromised the system just throws out an error.
Questions:
1) Is there an alternative to using a javascript array to allow users to easily update questions without screwing up the system?
or
2) Is there a way i can validate the array for syntax and alert the user about the error?