NUBIC/nu_surveyor — pull request #105 by jacobvanorder (2013-02-06 20:42:59+00:00)
Title: Commuter logic fix

According to Bug #3222, the commuter section wasn't displaying sections correctly. In delving into the issue more, it seemed to be a two-pronged issue where NUResponseSet wasn't creating proper dependency graphs due to writing over the container array for which items to hide and show. The second issue was related to inserting in the dependent questions that were to appear into the section's tableview. Often, the index would be wrong or, worse, out of bounds of the data source holding the visible sections. This was resolved, after much trial and error, by checking against NSNotFound.

I compiled a test for the example app called "dependency toolbox" that mimics the main issues I ran into: dependencies in another section, dependency with multiple answers and multiple dependencies from an answer.