Filling in list with loop


I’ve posted question on this problem few weeks ago, but I’m still struggling.

I’ve posted PNG file of blocks and .aia file at the end of this document.

I’m trying to fill in a list with weighted score of OS, Res, and PP. Each student profile has aggregateOS, aggregatePP, and aggregateRes score, and the page retrieves weight of each score from database when it opens. For example, if aggregateOS is 9 and weight of OS score is 0.3, the portion added to weighted score by OS score would be 9 x 0.3 = 2.7. Complete weighted score should have undergone same process for aggregateRes and aggregatePP and add them all up.

Program successfully arranges studentList into ABC order and display it into ListView1. However, I cannot create new list that has corresponding weighted score for each student in ABC sorted order. AfterSelecting method fills the entire new list with weighted score of student in last index.

This is what happens when AfterSelecting method is first called. (This is mystery for me too…why is this happening?)

When AfterSelecting method is called the second time, I see that scores are same for every student, by the weighted score for last student in studentList. The image for this page is with PNG in the link below. (I cannot post multiple images because I’m new)

The link to PNG of blocks is as follows:
Link to PNG files
Link to .aia file
The page in concern is Ranking page.

You can assume that all global variables are initialized appropriately and there was no compilation nor run-time error.

I’ve been struggling with this problem for few weeks but still can’t find what actually is the problem. Please help …TT

Thank you for reading.

You could try a different way with just one listview:

Get a student record
Do the calculation
Join the student name with the calculation output in a string - e.g. (“Nameji Cha 2.7”)
Add this to a new list
Do for all students
Sort the list
Display in listview

Alignment won’t be so pretty, so what you could do instead, after sorting the list:
Split each record after the name
Add a each part of the split to a different list
Display each list in the listview

Another method would be to make a list if lists: (Student Name Score)
then use look up in pairs to display both elements in different list views
Sorting by name is more difficult this way

Can you type up and share a Google Sheet with
sample data for 5 students?

That would help visualize your process and data dependencies.

If necessary, add extra sheets for detail and summary levels.