I’ve completed the front-end part of my project which now the judges can score the performer who performs more than one song by using the split sub-string method to split the piece name then I make it as a loop. Now, the slider will come out according to the number of pieces that performer made.
currentPerformanceObjectGlobalVar.name.split(‘;’).foreach(function(e, i)
{
//your iterator
} );
As you can see from the source code, I’ve split the piece name using a semicolon (;) as the tsv file data of the piece name is also separated with a semicolon. You can choose anything to separate it such as comma and spaces. The forEach( ) method executes a provided function once for each array element. E as the value of the current element being processed in the array which is the piece name while [i] is the index of the current element being processed in the array. The index of the current elements are the slider and span absolute score.
There is an issue that I’m having right now. The back-end doesn’t accept two scores from the front-end. It can only accept one score because the source code was programmed to accept one score only. Since the absolute score in the front-end has more than one score, I have to make sure that all the score submits at the front-end can be accepted at the back-end too so that the scores can be calculated. The front-end and back-end need to be modified so that they can accept each other.
I’m still not happy with my progress because I still need Dr. Shawn help even for the simple task. I feel frustrated with myself because the fear of failure that is haunting me. Because I am new to this environment, I was constantly in fear of my code is wrong or poorly made, so I spent a lot of time studying, double-checking everything and adhered to coding best practices. This is the reason I rarely attempted solutions in creative new ways because of the fear that it might not correctly at the end. This effectively shut down my drive to learn new things. I am so grateful that I have Dr. Shawn as my supervisor. A great engineer can patiently handle and teach “noobie” like me is one of the things that I should be grateful for. I’m sorry I have become a burden to you but I promised that I will improve myself to be better.
0 Comments