The main aim of this article is to see how you can compare marks per student per subject in a class using a 3D HTML recordset. Comparing in this case involves subtotals, which result from aggregate functions such as Sum, Avg and Count (on database tables). This article is the fourth part of a four-part series.
Comparing Test Marks Using a 3D HTML Recordset - Minimum Requirements of a 3D Read/Write Recordset (Page 2 of 4 )
Thinking logically from the above requirements, as a minimum, a 3D recordset should have the following functions:
A function to give the total number of horizontal and/or vertical planes of the recordset.
A function to locate a plane or a cell in order to access data.
A function to edit data in a cell, row or plane.
A function to delete a plane.
A function to add a plane.
Browsers today may not allow you to meet all these requirements. All browsers today will allow you have a good 3D read-only recordset and some features for writing to them.
Example
I will use a hypothetical example here. Imagine that you are a teacher or teaching assistant and you have to compile test results at the end of a semester. For the sake of clarity, let us take a very simple example where there are only two students, John and Peter, and two subjects, history and geography. The following three tables show marks for a sequence of three different groups of tests.
History
Geography
John
46
50
Peter
70
47
History
Geography
John
51
70
Peter
52
50
History
Geography
John
62
75
Peter
63
59
For each of the above tables you can find the average for each student's marks for history and the average for each student's mark for geography. We will consider a web page that does this for us.
To achieve that we shall have a 3 by 3 recordset with 4 vertical planes. The first table above will be on the first V plane; the second will be in the second V plane and the third will be in the third V plane. The fourth V plane will have the averages.