Main Achievements

  • writing functions (using sequencing, selection, and iteration)
  • learning how to debug (using alerts)
  • implementing better coding habits (not pasting random code, commenting, paying attention to details)

One of my personal Achievements when working on Flow with my group was learning how to debug my code and getting a lot of practice on writing functions(especially iterations). For one of the features in my Symptom tab, I made a checklist that gives you the link to the part of the page that shows the remedies to the symptoms you've checked off in the checklist after pressing the "See Remedies To" button.

See function below

// this function hides all the links at first
  fHide();
  function fHide()
   {
    for (var i =1; i <12;i++){
      document.getElementById("s"+ i).style.visibility = "hidden";
      }
   } 
// when this function is called, it will display the remedies to the symptoms that have been checked
   function fDisplay()
   {
    for (var i =1; i <12;i++)
      if (document.getElementById("chk"+ i).checked==true){
        document.getElementById("s"+ i).style.visibility = "";
      }
    else{
        document.getElementById("s"+ i).style.visibility = "hidden";
      }
   }

The first function "fHide" hides all the hyperlinks when you first click on the page by using a for loop to go through all the hyperlinks and changing their visibility to hidden.

Then the second function "fDisplay" also uses a for loop that goes through the checklist and looks for the ones that are checked. If it is checked, then it will change the visibility from hidden to not hidden, but if it is not checked, it will remain hidden.

Though this may not seem really advanced, for me, writing a function from scratch and using sequencing, selection, and iteration to accomplish my goals is already a pretty big improvement. However, I hope to continue to improve my coding skills and be able to write more concise code.

Another way I grew from this project was learning how to debug through alerts and ultimately just creating better coding habits. I have learned not to just paste random segments of code that I find on the internet and hope it does what I want it to do. Instead, I analyze what the code I find is doing and try to replicate it to fit my own needs. And if it doesn't work, I can use alerts in my code to see what part of my code or what functions are actually running and what aren't so I know where something might have gone wrong and what I have to fix. I have also been trying to pay more attention to simple things like the indentations in my code and adding comments which can actually make a big difference when showing my code to others and it also helps me when I am looking through my code trying to debug.