- Professional Self-Assessment and Project Introduction - 14 Apr 2019
- Refinement Plan and Code Review - 14 Apr 2019
- Enhancement One - 14 Apr 2019
- Enhancement Two - 14 Apr 2019
- Enhancement Three - 14 Apr 2019
Enhancement Two: Algorithms and Data Structure
For this milestone, I preformed some efficiency updates on a survey that I programmed some months ago. For the purposes of this project, I stripped some information from the original surveys including the brand names that were involved in the survey to maintain some anonymity.
I chose this artifact to showcase my skills in data structures and algorithms. I also wanted to do this project as opposed to an old project from school, because doing something for this can help me moving forward at my job. I wanted to select artifacts that I would use in my future life rather than ones that would merely serve an academic purpose. Some of the things I did in this project, I will be able to reuse moving forward at my job, and that’s pretty cool.
Although some parts were a bit of a struggle, I was able to accomplish everything I set out to improve with this project. The key improvement I made, and the one that took the most time to figure out, was the algorithm for punching the AWARE_SEL, USED_SEL, and FINAL_BRANDS hidden questions that drive the rest of the survey. If you remember from my code review, this was previously done using a series of if statements that was very inefficient and cumbersome to write and would have been even more cumbersome with more brands added. The new method I developed only requires that the new brands be added in two places in the XML and into the quota tables that are uploaded to the survey.
I created the algorithm to loop through 1-33 (the number of brands that will in the survey). It will then check the respondent for each marker AQ1 and UQ1, etc. If the respondent has UQ1, for example, it will mark USED_SEL.r1 and FINAL_BRANDS.r1 with a 1, saying that that is one of the brands the respondent will be answering for in this survey. This algorithm is a much more efficient way to handle the brand selection that we were doing before.
I had a hard time getting this one to work at first, mostly concerning my use of %d and figuring out to use .attr. But with a lot of trial and error, I was able to get this working, and the feeling was amazing! I hope to share this method with my coworkers when they come across similar issues in surveys and plan to use this moving forward.
Other improvements that I made were using a reusable answer list for the brands, the use of filters that allowed me to remove extra variables, and bucketing the FINAL_BRANDS selected, which allowed me to clean up a lot of the survey.
Update
I didn’t continue to enhance this project any more after I turned in my milestone. I was more concerned with the other areas of my project and I was happy with the improvements I already made to this one.
Links
Here is a link to my GitHub repository for this project: Enhancement Two
Here is a link to test the survey: Survey