Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
A GradeBook demo based on NasaCow UDTs and ideas
#1
Hi QB64 coders

in another thread a member of our community has the idea to develop (reinventing the wheel) a database program for Gradebook for teacher user.
in this thread,that is readable following this link Gradebook for teacher, you can find the original declaration of UDTs used in this demonstration.

While at #24 post there are some my observations and modifications to original UDT to get one database file with all informations ordered and stored.

Quote:I have loosen the structure of data that you have planned.... I see a StudentType, a MasterAssignment and a SlaveAssignment.
In the first and in the last structure you use an ID to identify and  correlate the data. In MasterAssignment there is no ID.
You like to have all the data into one file.

I think that to keep in one file all the data you need to use an ID also for the third structure of data.
In this manner you can access to the searched data using the ID as index:
here an example

this is the file
________________________________________________________________________________________________
|long digit| records of StudentType|long digit|records of MasterAssignment|long digit|records of SlaveAssignment|CRC|
|_______ |___________________|_______ |_______________________ |_______|_______________________|___ |
^              ^                                ^               ^                                    ^               ^                                   ^
 |               |                                 |                |                                     |                |                                    |
number of   |_________DATA         number of   |_________DATA             number of    |_________DATA            |__Security data
Student records                         Master Assignment                               Slave Assignment
                                                      records                                          records

while in RAM you load the data into 3 array with which you can work.


the final result of these first steps is to get three different array of data to link for getting informations about of students in a class, Assignments done in that class and results of assignment for each student that has done that assignment.
From these basic data we can get other school results' data  like Average Grade , Final Grade, Dropped students, Added students
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------
the final goal of NasaCow is this Gradebook showed at these links Gradebook for teacherGradebook for teacher: assignmentGradebook for teacher: student view
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------

So let's to start : 
step1 it creates UDTs, it populates the array of the 3 UDTs and it shows in output the data stored. It create one file for storing the data following the above scheme of data storing.

Here the code for step1
Code: (Select All)
_Title "Gradebook step 1"
$NoPrefix
Option Explicit
Option ExplicitArray
'-------------------------------------------------------
Type NameListType 'Used for the student name database
    PinYinName As String * 20
    FirstName As String * 20
    MiddleName As String * 20
    LastName As String * 20
    Year As Integer
    Month As Integer
    Day As Integer
    HouseColor As String * 8
    MomName As String * 30
    MomPhone As String * 20 'Saved as string to support symbols and international prefixes
    MomEmail As String * 38
    DadName As String * 30
    DadPhone As String * 20
    DadEmail As String * 38
    UID As Integer
End Type

Type MasterAssignmentType 'Each entry needs to be defined before use with slave
    UID As Integer ' UID for distinguish among different assignments made in the same date and class or set of students
    ARName As String * 20 'Assignment report name
    ADName As String * 10 'Assignment display name (short name)
    AType As Unsigned Byte 'Assignment Type (Completeion, formative, summative, etc.)
    ACat As String * 20 'Assignment Category (subject, unit, etc)
    AColor As Unsigned Byte 'Color coding assignment headers and for grouping for reports
    ACode As Unsigned Byte 'Reserved
    APts As Unsigned Integer 'Total points allowed
End Type

Type SlaveAssignmentType 'Each student would require one with use with master
    UIDm As Integer 'UID shows which MasterAssignment has been used
    UIDs As Integer 'UID will match the student name list to match results, negative UID means deleted and we will ignore it on display and reports
    MPts As Unsigned Integer 'Points earned for each particular students
    Flags As Unsigned Byte 'See below for codes
    Flags2 As Unsigned Byte ' Reserved
    Notes As String * 512 'Comments for a student's work
End Type

'====================Flag codes====================
'1   - Late (Turned in late)                      |
'2   - Absent on due date (ignore due date)       |
'4   - Incomplete (turned in but not done)        |
'8   - Missing (Not turned in)                    |
'16  - Excused/Exempt                             |
'32  - Ignore score internally for avg, etc.      |
'64  - Remove from reports (ignore externally)    |
'128 - Reserved                                   |
'==================================================


Dim Max As Integer, HowMuch As Long, How As Integer
Max = 1
HowMuch = 0

Dim Students(1 To Max) As NameListType, Assignments(1 To Max) As MasterAssignmentType, Results(1 To Max) As SlaveAssignmentType

GoSub initFilerecords

Open "DatabaseDemo.txt" For Binary As #1
Cls , 14
Print "Now reading Students..."
GoSub ReadStudents
Print " press a key to continue..."
Sleep
Cls , 13
Print "Now reading Assignments..."
GoSub ReadAssignment
Print " press a key to continue..."
Sleep
Cls , 12
Print "Now reading Results..."
GoSub ReadResults
Print " press a key to continue..."
Sleep
Print "Quitting"
Close #1
End '<-------- end of program

' Initialization GOSUB creates file of database reading internal data
initFilerecords:
Open "DatabaseDemo.txt" For Binary As #1 ' here database file has been created
' writing Students in the file
HowMuch = 10
Put #1, , HowMuch
Restore StudentsData
Locate 24, 1: Print " Filling file"
For How = 1 To HowMuch Step 1
    Read Students(1).PinYinName, Students(1).FirstName, Students(1).MiddleName, Students(1).LastName, Students(1).Year, Students(1).Month, Students(1).Day, Students(1).HouseColor, Students(1).MomName, Students(1).MomPhone, Students(1).MomEmail, Students(1).DadName, Students(1).DadPhone, Students(1).DadEmail, Students(1).UID
    GoSub ShowStudentRecord
    _Delay 1
    Put #1, , Students()
Next How

'write assignments in the file
Cls , 5
HowMuch = 4
Restore AssignmentData
Put #1, , HowMuch
For How = 1 To HowMuch Step 1
    Read Assignments(1).UID, Assignments(1).ARName, Assignments(1).ADName, Assignments(1).AType, Assignments(1).ACat, Assignments(1).AColor, Assignments(1).ACode, Assignments(1).APts
    GoSub ShowAssignmentsRecord
    _Delay 1
    Put #1, , Assignments()
Next How

'write results in the file
Cls , 4
HowMuch = 35
Restore ResultsData
Put #1, , HowMuch
For How = 1 To HowMuch Step 1
    Read Results(1).UIDm, Results(1).UIDs, Results(1).MPts, Results(1).Flags, Results(1).Flags2, Results(1).Notes
    GoSub ShowResultsRecord
    _Delay 1
    Put #1, , Results()
Next How
Close #1

Cls , 12
Print "File of database done! Ready to start demo."
Print "Please press a key to start..."
Sleep
Return
' END of initialization GOSUB----------------------------------

'----------Loading data from file of database into RAM-------------
ReadStudents:
'reading students from the file
Cls , 3
Print " Reading file for Students"
Get #1, , HowMuch
For How = 1 To HowMuch Step 1
    Get #1, , Students()
    GoSub ShowStudentRecord
    _Delay 1
Next How
Return

ReadAssignment:
' reading assignments from the file
Cls , 1
Print " Reading file for Assignments"
Get #1, , HowMuch
For How = 1 To HowMuch Step 1
    Get #1, , Assignments()
    GoSub ShowAssignmentsRecord
    _Delay 1
Next How

ReadResults:
' reading results from the file
Cls , 2
Print " Reading file for Results"
Get #1, , HowMuch
For How = 1 To HowMuch Step 1
    Get #1, , Results()
    GoSub ShowResultsRecord
    _Delay 1
Next How
Return

'----OUTPUT GOSUB routines ---- to modify for own need
ShowStudentRecord:
Locate 1, 1: Print Students(1).PinYinName; Space$(10)
Locate , 1: Print Students(1).FirstName; Space$(10)
Locate , 1: Print Students(1).MiddleName; Space$(10)
Locate , 1: Print Students(1).LastName; Space$(10)
Locate , 1: Print Students(1).Year, Students(1).Month, Students(1).Day; Space$(10)
Locate , 1: Print "Housecolor: "; Students(1).HouseColor; Space$(10)
Locate , 1: Print "Mom data: "; _Trim$(Students(1).MomName); "/"; _Trim$(Students(1).MomPhone); "/"; _Trim$(Students(1).MomEmail); Space$(10)
Locate , 1: Print "Dad data: "; _Trim$(Students(1).DadName); "/"; _Trim$(Students(1).DadPhone); "/"; _Trim$(Students(1).DadEmail); Space$(10)
Locate , 1: Print "UID of student: "; Students(1).UID
Return


ShowAssignmentsRecord:
Locate 1, 1: Print Assignments(1).UID; Space$(10)
Locate , 1: Print Assignments(1).ARName; Space$(10)
Locate , 1: Print Assignments(1).ADName; Space$(10)
Locate , 1: Print Assignments(1).AType; Space$(10)
Locate , 1: Print Assignments(1).ACat; Space$(10)
Locate , 1: Print "Housecolor: "; Assignments(1).AColor; Space$(10)
Locate , 1: Print "Code: "; Assignments(1).ACode; Space$(10)
Locate , 1: Print "Points: "; Assignments(1).APts
Return

ShowResultsRecord:
Locate 1, 1: Print Results(1).UIDm
Locate , 1: Print Results(1).UIDs
Locate , 1: Print Results(1).MPts
Locate , 1: Print Results(1).Flags
Locate , 1: Print Results(1).Flags2
Locate , 1: Print Results(1).Notes
Return

'--------------------DATA set for database file-----------------
StudentsData:
Data RDJ,Robert,Downing,Junior,2000,2,22,12345600,Julia Concepts,333222111,JConcepts@Yahoo.com,Peter Downing,111222333,PeterD@aol.com,1
Data PJM,Paulus,June,Marcus,1999,3,23,89765909,Maria Capello,444111222,MariaCapello@microsoft.com,Mickie Costello,333222333,Mi_Costello@amazon.com,2
Data TMA,Terrie,Mike,Anderson,2001,12,25,45398758,Stephany Johnson,888999777,StepJo@BBC.com,Frank Boulevard,888777666,FrankBoulevard@microsoft.com,3
Data AJW,Amy,Johnson,Watson,2000,01,04,87543324,Donna Walker,666555333,DonWalk@cisco.com,Walter Bros Julian,888222111,WaltBro@amazon.com,4
Data ERT,Emily,Rose,Tinder,2003,4,15,19045689,Angie Longman,333000999,AngieL@tabloid.com,Donald Foster,444888999,DonaldFoster@cisco.com,5
Data UAB,Ully,Aktick,Brandson,2002,06,09,65498732,Jane Murdock,444555666,JMurdock23@aol.com,Ted Wineger,333444555,TedWineger@cisco.com,6
Data WAS,Wendy,Allison,Singer,2004,6,12,78488922,Melissa Naom,999333999,MeliNaom@yahoo.it,Albert Stone,444000999,ASt456@microsoft.com,7
Data MCS,Molly,Connor,Smith,2001,7,5,54365476,Emily Sandman,099900111,EmilyS@aol.com,Bob Miller,555222111,BMiller567@microsoft.com,8
Data RDJ,Ronny,Dudson,jansenn,2003,8,15,81264554,Jenny Portman,123123123,Jportman@BBC.com,Al Fisherman,678678678,AlFisherman@aol.com,9
Data NK,Nina,Killer,,2000,6,12,65439876,Pauline Arson,567567567,PArson@life.com,Andy Wiley,890890890,Andywiley@micro.com,10
Data "END"

AssignmentData:
Data 1,Mathematical,Math,2,Subject,16,0,20
Data 2,Scientific test,Science,8,Unit,1,0,20
Data 3,English language,English,4,Unit,2,0,20
Data 4,Psycologist test,Psycotest,16,Subject,32,0,20
Data "END"


ResultsData:
Data 1,4,15,0,0,Good Job
Data 1,10,10,0,0,Medium Job
Data 1,2,1,0,0,the worst Job
Data 1,3,5,0,0,Bad Job
Data 1,8,11,0,0,Good Job
Data 1,6,20,0,0,Excellent Job
Data 2,4,15,0,0,Good Job
Data 2,10,8,0,0,Medium Job
Data 2,2,4,0,0,Bad Job
Data 2,3,5,0,0,Bad Job
Data 2,8,11,0,0,Good Job
Data 2,6,20,0,0,Excellent Job
Data 2,9,15,0,0,Good Job
Data 2,1,10,0,0,Medium Job
Data 2,5,1,0,0,the worst Job
Data 2,7,5,0,0,Bad Job
Data 3,8,11,0,0,Good Job
Data 3,6,20,0,0,Excellent Job
Data 3,4,15,0,0,Good Job
Data 3,10,10,0,0,Medium Job
Data 3,2,1,0,0,the worst Job
Data 3,3,5,0,0,Bad Job
Data 3,7,11,0,0,Good Job
Data 3,5,20,0,0,Excellent Job
Data 3,9,15,0,0,Good Job
Data 3,1,10,0,0,Medium Job
Data 4,2,1,0,0,the worst Job
Data 4,3,5,0,0,Bad Job
Data 4,8,11,0,0,Good Job
Data 4,6,20,0,0,Excellent Job
Data 4,4,15,0,0,Good Job
Data 4,10,10,0,0,Medium Job
Data 4,5,1,0,0,the worst Job
Data 4,7,5,0,0,Bad Job
Data 4,9,11,0,0,Good Job
Data "END"

it follows step 2
Reply
#2
Step 2:
building a raw menu and output for showing data

Code: (Select All)
_Title "GradeBook step 2"
$NoPrefix
Option Explicit
Option ExplicitArray
'-------------------------------------------------------
Type NameListType 'Used for the student name database
    PinYinName As String * 20
    FirstName As String * 20
    MiddleName As String * 20
    LastName As String * 20
    Year As Integer
    Month As Integer
    Day As Integer
    HouseColor As String * 8
    MomName As String * 30
    MomPhone As String * 20 'Saved as string to support symbols and international prefixes
    MomEmail As String * 38
    DadName As String * 30
    DadPhone As String * 20
    DadEmail As String * 38
    UID As Integer
End Type

Type MasterAssignmentType 'Each entry needs to be defined before use with slave
    UID As Integer ' UID for distinguish among different assignments made in the same date and class or set of students
    ARName As String * 20 'Assignment report name
    ADName As String * 10 'Assignment display name (short name)
    AType As Unsigned Byte 'Assignment Type (Completeion, formative, summative, etc.)
    ACat As String * 20 'Assignment Category (subject, unit, etc)
    AColor As Unsigned Byte 'Color coding assignment headers and for grouping for reports
    ACode As Unsigned Byte 'Reserved
    APts As Unsigned Integer 'Total points allowed
End Type

Type SlaveAssignmentType 'Each student would require one with use with master
    UIDm As Integer 'UID shows which MasterAssignment has been used
    UIDs As Integer 'UID will match the student name list to match results, negative UID means deleted and we will ignore it on display and reports
    MPts As Unsigned Integer 'Points earned for each particular students
    Flags As Unsigned Byte 'See below for codes
    Flags2 As Unsigned Byte ' Reserved
    Notes As String * 512 'Comments for a student's work
End Type

'====================Flag codes====================
'1   - Late (Turned in late)                      |
'2   - Absent on due date (ignore due date)       |
'4   - Incomplete (turned in but not done)        |
'8   - Missing (Not turned in)                    |
'16  - Excused/Exempt                             |
'32  - Ignore score internally for avg, etc.      |
'64  - Remove from reports (ignore externally)    |
'128 - Reserved                                   |
'==================================================
' end Data Type definition-------------------------------------

Dim Max As Integer, HowMuch As Long, How As Integer
Max = 1
HowMuch = 0

Dim Students(1 To Max) As NameListType, Assignments(1 To Max) As MasterAssignmentType, Results(1 To Max) As SlaveAssignmentType

GoSub initFilerecords

Open "DatabaseDemo2.txt" For Binary As #1
Cls , 14
Print "Now reading Students..."
GoSub ReadStudents
Print " press a key to continue..."
Sleep
Cls , 13
Print "Now reading Assignments..."
GoSub ReadAssignment
Print " press a key to continue..."
Sleep
Cls , 12
Print "Now reading Results..."
GoSub ReadResults
Close #1
Print " press a key to continue, ESC to quit..."
Sleep
Cls , 2
' here start main window of Gradebook database
Dim choice$
choice$ = " "
While choice$ = " "

    Cls , 1
    Call MWindow(2, 2, 78, 23, " <GradeBook Menu> ")
    Locate 4, 4: Print " Press ESCape to quit";
    Locate 6, 4: Print " Press  S for Students List ";
    Locate 8, 4: Print " Press A for Assignment List ";
    Locate 10, 4: Print " Press R for Results List ";

    choice$ = LCase$(InKey$)
    If choice$ = Chr$(27) Then
        Cls , 0:
        Print "Quitting"
        Exit While
    ElseIf choice$ = "a" Then
        Cls , 2
        Print "Assignments: "
    ElseIf choice$ = "s" Then
        Cls , 5
        Print "Students: "
    ElseIf choice$ = "r" Then
        Cls , 6
        Print "Result: "
    End If
    Locate 18, 4: Print "press any key to continue...";
    Locate 20, 4: Print choice$;
    If Len(choice$) > 0 Then While InKey$ = "": Wend

    _Limit 10
    choice$ = " "
Wend
End '<-------- end of program

' Initialization GOSUB creates file of database  reading internal data
initFilerecords:
Open "DatabaseDemo2.txt" For Binary As #1 ' here database file has been created
' writing Students in the file
HowMuch = 10
ReDim Preserve Students(1 To HowMuch) As NameListType
Put #1, , HowMuch
Restore StudentsData
Locate 24, 1: Print " Filling file"
For How = 1 To HowMuch Step 1
    Read Students(How).PinYinName, Students(How).FirstName, Students(How).MiddleName, Students(How).LastName, Students(How).Year, Students(How).Month, Students(How).Day, Students(How).HouseColor, Students(How).MomName, Students(How).MomPhone, Students(How).MomEmail, Students(How).DadName, Students(How).DadPhone, Students(How).DadEmail, Students(How).UID
    'GoSub ShowStudentRecord
    '_Delay 1
Next How
Put #1, , Students()

'write assignments in the file
Cls , 5
HowMuch = 4
ReDim Preserve Assignments(1 To HowMuch) As MasterAssignmentType

Restore AssignmentData
Put #1, , HowMuch
For How = 1 To HowMuch Step 1
    Read Assignments(How).UID, Assignments(How).ARName, Assignments(How).ADName, Assignments(How).AType, Assignments(How).ACat, Assignments(How).AColor, Assignments(How).ACode, Assignments(How).APts
    'GoSub ShowAssignmentsRecord
    '_Delay 1
Next How
Put #1, , Assignments()

'write results in the file
Cls , 4
HowMuch = 35
Restore ResultsData
ReDim Preserve Results(1 To HowMuch) As SlaveAssignmentType
Put #1, , HowMuch
For How = 1 To HowMuch Step 1
    Read Results(How).UIDm, Results(How).UIDs, Results(How).MPts, Results(How).Flags, Results(How).Flags2, Results(How).Notes
    'GoSub ShowResultsRecord
    '_Delay 1
Next How
Put #1, , Results()
Close #1

Cls , 12
Print "File of database done! Ready to start demo."
Print "Please press a key to start..."
Sleep
Return
' END of initialization GOSUB----------------------------------

'----------Loading data from file of database into RAM-------------
ReadStudents:
'reading students from the file
Cls , 3
Print " Reading file for Students"
Get #1, , HowMuch
ReDim Students(1 To HowMuch) As NameListType
Get #1, , Students()
'For How = 1 To HowMuch Step 1
'    GoSub ShowStudentRecord
'_Delay 1
'Next How
Return

ReadAssignment:
' reading assignments from the file
Cls , 1
Print " Reading file for Assignments"
Get #1, , HowMuch
ReDim Assignments(1 To HowMuch) As MasterAssignmentType
Get #1, , Assignments()
'For How = 1 To HowMuch Step 1
'GoSub ShowAssignmentsRecord
'_Delay 1
'Next How
Return

ReadResults:
' reading results from the file
Cls , 2
Print " Reading file for Results"
Get #1, , HowMuch
ReDim Results(1 To HowMuch) As SlaveAssignmentType
Get #1, , Results()
'For How = 1 To HowMuch Step 1
'GoSub ShowResultsRecord
'_Delay 1
'Next How
Return

'----OUTPUT GOSUB routines ---- to modify for own need
ShowStudentRecord:
Locate 2, 1: Print Space$(80);
Locate 2, 1: Print Trim$(Students(How).PinYinName); Space$(5); Trim$(Students(How).FirstName); Space$(5); Trim$(Students(How).MiddleName); Space$(5); Trim$(Students(How).LastName);
Locate 4, 1: Print Space$(40);
Locate 4, 1: Print "Birthday: "; Students(How).Year; " "; Students(How).Month; " "; Students(How).Day;
Locate 6, 1: Print "Housecolor: "; Students(How).HouseColor; Space$(10)
Locate 8, 1: Print "Mom data: "; Trim$(Students(How).MomName); "/"; Trim$(Students(1).MomPhone); "/"; Trim$(Students(1).MomEmail); Space$(10)
Locate 10, 1: Print "Dad data: "; Trim$(Students(How).DadName); "/"; Trim$(Students(1).DadPhone); "/"; Trim$(Students(1).DadEmail); Space$(10)
Locate 12, 1: Print "UID of student: "; Students(How).UID
Return


ShowAssignmentsRecord:
Locate 1, 1: Print Assignments(How).UID; Space$(10)
Locate , 1: Print Assignments(How).ARName; Space$(10)
Locate , 1: Print Assignments(How).ADName; Space$(10)
Locate , 1: Print Assignments(How).AType; Space$(10)
Locate , 1: Print Assignments(How).ACat; Space$(10)
Locate , 1: Print "Housecolor: "; Assignments(How).AColor; Space$(10)
Locate , 1: Print "Code: "; Assignments(How).ACode; Space$(10)
Locate , 1: Print "Points: "; Assignments(How).APts
Return

ShowResultsRecord:
Locate 1, 1: Print Results(How).UIDm
Locate , 1: Print Results(How).UIDs
Locate , 1: Print Results(How).MPts
Locate , 1: Print Results(How).Flags
Locate , 1: Print Results(How).Flags2
Locate , 1: Print Results(How).Notes
Return

'--------------------DATA set for database file-----------------
StudentsData:
Data RDJ,Robert,Downing,Junior,2000,2,22,12345600,Julia Concepts,333222111,JConcepts@Yahoo.com,Peter Downing,111222333,PeterD@aol.com,1
Data PJM,Paulus,June,Marcus,1999,3,23,89765909,Maria Capello,444111222,MariaCapello@microsoft.com,Mickie Costello,333222333,Mi_Costello@amazon.com,2
Data TMA,Terrie,Mike,Anderson,2001,12,25,45398758,Stephany Johnson,888999777,StepJo@BBC.com,Frank Boulevard,888777666,FrankBoulevard@microsoft.com,3
Data AJW,Amy,Johnson,Watson,2000,01,04,87543324,Donna Walker,666555333,DonWalk@cisco.com,Walter Bros Julian,888222111,WaltBro@amazon.com,4
Data ERT,Emily,Rose,Tinder,2003,4,15,19045689,Angie Longman,333000999,AngieL@tabloid.com,Donald Foster,444888999,DonaldFoster@cisco.com,5
Data UAB,Ully,Aktick,Brandson,2002,06,09,65498732,Jane Murdock,444555666,JMurdock23@aol.com,Ted Wineger,333444555,TedWineger@cisco.com,6
Data WAS,Wendy,Allison,Singer,2004,6,12,78488922,Melissa Naom,999333999,MeliNaom@yahoo.it,Albert Stone,444000999,ASt456@microsoft.com,7
Data MCS,Molly,Connor,Smith,2001,7,5,54365476,Emily Sandman,099900111,EmilyS@aol.com,Bob Miller,555222111,BMiller567@microsoft.com,8
Data RDJ,Ronny,Dudson,jansenn,2003,8,15,81264554,Jenny Portman,123123123,Jportman@BBC.com,Al Fisherman,678678678,AlFisherman@aol.com,9
Data NK,Nina,Killer,,2000,6,12,65439876,Pauline Arson,567567567,PArson@life.com,Andy Wiley,890890890,Andywiley@micro.com,10
Data "END"

AssignmentData:
Data 1,Mathematical,Math,2,Subject,16,0,20
Data 2,Scientific test,Science,8,Unit,1,0,20
Data 3,English language,English,4,Unit,2,0,20
Data 4,Psycologist test,Psycotest,16,Subject,32,0,20
Data "END"


ResultsData:
Data 1,4,15,0,0,Good Job
Data 1,10,10,0,0,Medium Job
Data 1,2,1,0,0,the worst Job
Data 1,3,5,0,0,Bad Job
Data 1,8,11,0,0,Good Job
Data 1,6,20,0,0,Excellent Job
Data 2,4,15,0,0,Good Job
Data 2,10,8,0,0,Medium Job
Data 2,2,4,0,0,Bad Job
Data 2,3,5,0,0,Bad Job
Data 2,8,11,0,0,Good Job
Data 2,6,20,0,0,Excellent Job
Data 2,9,15,0,0,Good Job
Data 2,1,10,0,0,Medium Job
Data 2,5,1,0,0,the worst Job
Data 2,7,5,0,0,Bad Job
Data 3,8,11,0,0,Good Job
Data 3,6,20,0,0,Excellent Job
Data 3,4,15,0,0,Good Job
Data 3,10,10,0,0,Medium Job
Data 3,2,1,0,0,the worst Job
Data 3,3,5,0,0,Bad Job
Data 3,7,11,0,0,Good Job
Data 3,5,20,0,0,Excellent Job
Data 3,9,15,0,0,Good Job
Data 3,1,10,0,0,Medium Job
Data 4,2,1,0,0,the worst Job
Data 4,3,5,0,0,Bad Job
Data 4,8,11,0,0,Good Job
Data 4,6,20,0,0,Excellent Job
Data 4,4,15,0,0,Good Job
Data 4,10,10,0,0,Medium Job
Data 4,5,1,0,0,the worst Job
Data 4,7,5,0,0,Bad Job
Data 4,9,11,0,0,Good Job
Data "END"

Sub MWindow (Ax As Integer, Ay As Integer, Bx As Integer, By As Integer, Wtitle As String)
    Dim Count As Integer
    Locate Ay, Ax
    Print Space$(Bx - Ax + 1);
    Locate Ay, Ax
    Print String$(Bx - Ax + 1, "Í");
    Locate Ay, Ax:
    Print "É";
    Locate Ay, Bx:
    Print "»";
    For Count = 1 To (By - Ay - 1)
        Locate Ay + Count, Ax
        Print Space$(Bx - Ax + 1);
        Locate Ay + Count, Ax: Print "º";
        Locate Ay + Count, Bx: Print "º";
    Next Count
    Locate By, Ax: Print Space$(Bx - Ax + 1);
    Locate By, Ax
    Print String$(Bx - Ax + 1, "Í");
    Locate By, Ax: Print "È";
    Locate By, Bx: Print "¼";
    Locate Ay, ((Bx - Ax + 1) / 2) - (Len(Wtitle) / 2)
    Print Wtitle;
End Sub

this demo shows only different colored output for the different arrays with data
Reply
#3
Step 3:
showing data in the colored window making a first simple linking among the arrays

Code: (Select All)
_Title "GradeBook step 3"
$NoPrefix
Option Explicit
Option ExplicitArray
'-------------------------------------------------------
Type NameListType 'Used for the student name database
    PinYinName As String * 20
    FirstName As String * 20
    MiddleName As String * 20
    LastName As String * 20
    Year As Integer
    Month As Integer
    Day As Integer
    HouseColor As String * 8
    MomName As String * 30
    MomPhone As String * 20 'Saved as string to support symbols and international prefixes
    MomEmail As String * 38
    DadName As String * 30
    DadPhone As String * 20
    DadEmail As String * 38
    UID As Integer
End Type

Type MasterAssignmentType 'Each entry needs to be defined before use with slave
    UID As Integer ' UID for distinguish among different assignments made in the same date and class or set of students
    ARName As String * 20 'Assignment report name
    ADName As String * 10 'Assignment display name (short name)
    AType As Unsigned Byte 'Assignment Type (Completeion, formative, summative, etc.)
    ACat As String * 20 'Assignment Category (subject, unit, etc)
    AColor As Unsigned Byte 'Color coding assignment headers and for grouping for reports
    ACode As Unsigned Byte 'Reserved
    APts As Unsigned Integer 'Total points allowed
End Type

Type SlaveAssignmentType 'Each student would require one with use with master
    UIDm As Integer 'UID shows which MasterAssignment has been used
    UIDs As Integer 'UID will match the student name list to match results, negative UID means deleted and we will ignore it on display and reports
    MPts As Unsigned Integer 'Points earned for each particular students
    Flags As Unsigned Byte 'See below for codes
    Flags2 As Unsigned Byte ' Reserved
    Notes As String * 512 'Comments for a student's work
End Type

'====================Flag codes====================
'1   - Late (Turned in late)                      |
'2   - Absent on due date (ignore due date)       |
'4   - Incomplete (turned in but not done)        |
'8   - Missing (Not turned in)                    |
'16  - Excused/Exempt                             |
'32  - Ignore score internally for avg, etc.      |
'64  - Remove from reports (ignore externally)    |
'128 - Reserved                                   |
'==================================================
' end Data Type definition-------------------------------------

Dim Max As Integer, HowMuch As Long, How As Integer
Max = 1
HowMuch = 0

Dim Students(1 To Max) As NameListType, Assignments(1 To Max) As MasterAssignmentType, Results(1 To Max) As SlaveAssignmentType

GoSub initFilerecords

Open "DatabaseDemo2.txt" For Binary As #1
Cls , 14
Print "Now reading Students..."
GoSub ReadStudents
Print " press a key to continue..."
Sleep 2
Cls , 13
Print "Now reading Assignments..."
GoSub ReadAssignment
Print " press a key to continue..."
Sleep 2
Cls , 12
Print "Now reading Results..."
GoSub ReadResults
Close #1
Print " press a key to continue, ESC to quit..."
Sleep 2
Cls , 2
' here start main window of Gradebook database
Dim choice$
choice$ = " "
While choice$ = " "

    Cls , 1
    Call MWindow(2, 2, 78, 23, " <GradeBook Menu> ")
    Locate 4, 4: Print " Press ESCape to quit";
    Locate 6, 4: Print " Press  S for Students List ";
    Locate 8, 4: Print " Press A for Assignment List ";
    Locate 10, 4: Print " Press R for Results List ";

    choice$ = LCase$(InKey$)
    If choice$ = Chr$(27) Then
        Cls , 0:
        Print "Quitting"
        Exit While
    ElseIf choice$ = "a" Then
        Cls , 2
        Print "Assignments: "
        GoSub ShowList
    ElseIf choice$ = "s" Then
        Cls , 5
        Print "Students: "
        GoSub ShowList
    ElseIf choice$ = "r" Then
        Cls , 6
        Print "Result: "
        GoSub ShowList
    End If

    '    Locate 20, 4: Print choice$;
    If Len(choice$) > 0 Then While InKey$ = "": Wend

    _Limit 10
    choice$ = " "
Wend
End '<-------- end of program

' Initialization GOSUB creates file of database  reading internal data
initFilerecords:
Open "DatabaseDemo2.txt" For Binary As #1 ' here database file has been created
' writing Students in the file
HowMuch = 10
ReDim Preserve Students(1 To HowMuch) As NameListType
Put #1, , HowMuch
Restore StudentsData
Locate 24, 1: Print " Filling file"
For How = 1 To HowMuch Step 1
    Read Students(How).PinYinName, Students(How).FirstName, Students(How).MiddleName, Students(How).LastName, Students(How).Year, Students(How).Month, Students(How).Day, Students(How).HouseColor, Students(How).MomName, Students(How).MomPhone, Students(How).MomEmail, Students(How).DadName, Students(How).DadPhone, Students(How).DadEmail, Students(How).UID
    'GoSub ShowStudentRecord
    '_Delay 1
Next How
Put #1, , Students()

'write assignments in the file
Cls , 5
HowMuch = 4
ReDim Preserve Assignments(1 To HowMuch) As MasterAssignmentType

Restore AssignmentData
Put #1, , HowMuch
For How = 1 To HowMuch Step 1
    Read Assignments(How).UID, Assignments(How).ARName, Assignments(How).ADName, Assignments(How).AType, Assignments(How).ACat, Assignments(How).AColor, Assignments(How).ACode, Assignments(How).APts
    'GoSub ShowAssignmentsRecord
    '_Delay 1
Next How
Put #1, , Assignments()

'write results in the file
Cls , 4
HowMuch = 35
Restore ResultsData
ReDim Preserve Results(1 To HowMuch) As SlaveAssignmentType
Put #1, , HowMuch
For How = 1 To HowMuch Step 1
    Read Results(How).UIDm, Results(How).UIDs, Results(How).MPts, Results(How).Flags, Results(How).Flags2, Results(How).Notes
    'GoSub ShowResultsRecord
    '_Delay 1
Next How
Put #1, , Results()
Close #1

Cls , 12
Print "File of database done! Ready to start demo."
Print "Please press a key to start..."
Sleep
Return
' END of initialization GOSUB----------------------------------

'----------Loading data from file of database into RAM-------------
ReadStudents:
'reading students from the file
Cls , 3
Print " Reading file for Students"
Get #1, , HowMuch
ReDim Students(1 To HowMuch) As NameListType
Get #1, , Students()
'For How = 1 To HowMuch Step 1
'    GoSub ShowStudentRecord
'_Delay 1
'Next How
Return

ReadAssignment:
' reading assignments from the file
Cls , 1
Print " Reading file for Assignments"
Get #1, , HowMuch
ReDim Assignments(1 To HowMuch) As MasterAssignmentType
Get #1, , Assignments()
'For How = 1 To HowMuch Step 1
'GoSub ShowAssignmentsRecord
'_Delay 1
'Next How
Return

ReadResults:
' reading results from the file
Cls , 2
Print " Reading file for Results"
Get #1, , HowMuch
ReDim Results(1 To HowMuch) As SlaveAssignmentType
Get #1, , Results()
'For How = 1 To HowMuch Step 1
'GoSub ShowResultsRecord
'_Delay 1
'Next How
Return

'----OUTPUT GOSUB routines ---- to modify for own need
ShowList:
Select Case choice$
    Case "a"
        HowMuch = UBound(Assignments)
        For How = 1 To HowMuch Step 1
            Locate , 4
            Print Assignments(How).UID
            Locate , 4
            Print Assignments(How).ADName; " "; Assignments(How).ARName
        Next How

    Case "r"
        HowMuch = UBound(Results)
        For How = 1 To HowMuch Step 1
            Locate , 4
            Print Assignments(Results(How).UIDm).ADName; " ";
            Print Trim$(Students(Results(How).UIDs).PinYinName); Space$(5); Trim$(Students(Results(How).UIDs).FirstName); Space$(5); Trim$(Students(Results(How).UIDs).MiddleName); Space$(5); Trim$(Students(Results(How).UIDs).LastName);
            Print " "; Results(How).MPts
            If How Mod 15 = 0 Then
                Locate 24, 4: Print "press any key to continue...";
                Sleep 4
                Cls , 6
            End If
        Next How

    Case "s"
        HowMuch = UBound(Students)
        For How = 1 To HowMuch Step 1
            Locate , 4
            Print Students(How).UID
            Locate , 4
            Print Trim$(Students(How).PinYinName); Space$(5); Trim$(Students(How).FirstName); Space$(5); Trim$(Students(How).MiddleName); Space$(5); Trim$(Students(How).LastName)
        Next How
End Select
Locate 24, 4: Print "press any key to continue...";
Return

ShowStudentRecord:
Locate 2, 1: Print Space$(80);
Locate 2, 1: Print Trim$(Students(How).PinYinName); Space$(5); Trim$(Students(How).FirstName); Space$(5); Trim$(Students(How).MiddleName); Space$(5); Trim$(Students(How).LastName);
Locate 4, 1: Print Space$(40);
Locate 4, 1: Print "Birthday: "; Students(How).Year; " "; Students(How).Month; " "; Students(How).Day;
Locate 6, 1: Print "Housecolor: "; Students(How).HouseColor; Space$(10)
Locate 8, 1: Print "Mom data: "; Trim$(Students(How).MomName); "/"; Trim$(Students(1).MomPhone); "/"; Trim$(Students(1).MomEmail); Space$(10)
Locate 10, 1: Print "Dad data: "; Trim$(Students(How).DadName); "/"; Trim$(Students(1).DadPhone); "/"; Trim$(Students(1).DadEmail); Space$(10)
Locate 12, 1: Print "UID of student: "; Students(How).UID
Return


ShowAssignmentsRecord:
Locate 1, 1: Print Assignments(How).UID; Space$(10)
Locate , 1: Print Assignments(How).ARName; Space$(10)
Locate , 1: Print Assignments(How).ADName; Space$(10)
Locate , 1: Print Assignments(How).AType; Space$(10)
Locate , 1: Print Assignments(How).ACat; Space$(10)
Locate , 1: Print "Housecolor: "; Assignments(How).AColor; Space$(10)
Locate , 1: Print "Code: "; Assignments(How).ACode; Space$(10)
Locate , 1: Print "Points: "; Assignments(How).APts
Return

ShowResultsRecord:
Locate 1, 1: Print Results(How).UIDm
Locate , 1: Print Results(How).UIDs
Locate , 1: Print Results(How).MPts
Locate , 1: Print Results(How).Flags
Locate , 1: Print Results(How).Flags2
Locate , 1: Print Results(How).Notes
Return

'--------------------DATA set for database file-----------------
StudentsData:
Data RDJ,Robert,Downing,Junior,2000,2,22,12345600,Julia Concepts,333222111,JConcepts@Yahoo.com,Peter Downing,111222333,PeterD@aol.com,1
Data PJM,Paulus,June,Marcus,1999,3,23,89765909,Maria Capello,444111222,MariaCapello@microsoft.com,Mickie Costello,333222333,Mi_Costello@amazon.com,2
Data TMA,Terrie,Mike,Anderson,2001,12,25,45398758,Stephany Johnson,888999777,StepJo@BBC.com,Frank Boulevard,888777666,FrankBoulevard@microsoft.com,3
Data AJW,Amy,Johnson,Watson,2000,01,04,87543324,Donna Walker,666555333,DonWalk@cisco.com,Walter Bros Julian,888222111,WaltBro@amazon.com,4
Data ERT,Emily,Rose,Tinder,2003,4,15,19045689,Angie Longman,333000999,AngieL@tabloid.com,Donald Foster,444888999,DonaldFoster@cisco.com,5
Data UAB,Ully,Aktick,Brandson,2002,06,09,65498732,Jane Murdock,444555666,JMurdock23@aol.com,Ted Wineger,333444555,TedWineger@cisco.com,6
Data WAS,Wendy,Allison,Singer,2004,6,12,78488922,Melissa Naom,999333999,MeliNaom@yahoo.it,Albert Stone,444000999,ASt456@microsoft.com,7
Data MCS,Molly,Connor,Smith,2001,7,5,54365476,Emily Sandman,099900111,EmilyS@aol.com,Bob Miller,555222111,BMiller567@microsoft.com,8
Data RDJ,Ronny,Dudson,jansenn,2003,8,15,81264554,Jenny Portman,123123123,Jportman@BBC.com,Al Fisherman,678678678,AlFisherman@aol.com,9
Data NK,Nina,Killer,,2000,6,12,65439876,Pauline Arson,567567567,PArson@life.com,Andy Wiley,890890890,Andywiley@micro.com,10
Data "END"

AssignmentData:
Data 1,Mathematical,Math,2,Subject,16,0,20
Data 2,Scientific test,Science,8,Unit,1,0,20
Data 3,English language,English,4,Unit,2,0,20
Data 4,Psycologist test,Psycotest,16,Subject,32,0,20
Data "END"


ResultsData:
Data 1,4,15,0,0,Good Job
Data 1,10,10,0,0,Medium Job
Data 1,2,1,0,0,the worst Job
Data 1,3,5,0,0,Bad Job
Data 1,8,11,0,0,Good Job
Data 1,6,20,0,0,Excellent Job
Data 2,4,15,0,0,Good Job
Data 2,10,8,0,0,Medium Job
Data 2,2,4,0,0,Bad Job
Data 2,3,5,0,0,Bad Job
Data 2,8,11,0,0,Good Job
Data 2,6,20,0,0,Excellent Job
Data 2,9,15,0,0,Good Job
Data 2,1,10,0,0,Medium Job
Data 2,5,1,0,0,the worst Job
Data 2,7,5,0,0,Bad Job
Data 3,8,11,0,0,Good Job
Data 3,6,20,0,0,Excellent Job
Data 3,4,15,0,0,Good Job
Data 3,10,10,0,0,Medium Job
Data 3,2,1,0,0,the worst Job
Data 3,3,5,0,0,Bad Job
Data 3,7,11,0,0,Good Job
Data 3,5,20,0,0,Excellent Job
Data 3,9,15,0,0,Good Job
Data 3,1,10,0,0,Medium Job
Data 4,2,1,0,0,the worst Job
Data 4,3,5,0,0,Bad Job
Data 4,8,11,0,0,Good Job
Data 4,6,20,0,0,Excellent Job
Data 4,4,15,0,0,Good Job
Data 4,10,10,0,0,Medium Job
Data 4,5,1,0,0,the worst Job
Data 4,7,5,0,0,Bad Job
Data 4,9,11,0,0,Good Job
Data "END"

Sub MWindow (Ax As Integer, Ay As Integer, Bx As Integer, By As Integer, Wtitle As String)
    Dim Count As Integer
    Locate Ay, Ax
    Print Space$(Bx - Ax + 1);
    Locate Ay, Ax
    Print String$(Bx - Ax + 1, "Í");
    Locate Ay, Ax:
    Print "É";
    Locate Ay, Bx:
    Print "»";
    For Count = 1 To (By - Ay - 1)
        Locate Ay + Count, Ax
        Print Space$(Bx - Ax + 1);
        Locate Ay + Count, Ax: Print "º";
        Locate Ay + Count, Bx: Print "º";
    Next Count
    Locate By, Ax: Print Space$(Bx - Ax + 1);
    Locate By, Ax
    Print String$(Bx - Ax + 1, "Í");
    Locate By, Ax: Print "È";
    Locate By, Bx: Print "¼";
    Locate Ay, ((Bx - Ax + 1) / 2) - (Len(Wtitle) / 2)
    Print Wtitle;
End Sub

the next step will be to access and Edit/Erase to each single schede of Student/Assignment/Results.
Reply
#4
Just got around seeing this...

It is nice to see that the file system I devised wtih feedback from the community does indeed work. I am hoping to put V4 out soon. I have been busy rewriting it from the ground up. The code got too messy, too much off-the-cuff programming. Cutting out all files, besides the executable, but 2 (and really, every computer has arial.ttf, so I could just pass the one font file but I will include both as *good practice*.) This verison will be much better documented and easier to follow the code.

I just want to get back to where I was, getting ready for the gradebook part. Lot more $Include files though: Qprint, Circles, Base64, and who knows what else I will need later.

Thanks for sharing this, put a smile on my face, and a warmth in my heart, or that may just be the Friday beer talking  Big Grin

A sneak peek:


[Image: image.png]
Reply
#5
Hi Nasacow

briefing about your ideas, file database following your directives, interface for users.

fine to see that you like this development of your UDT and database in one file.
I found necessary to add UID fields into UDT structure for AssignmentMaster (UID)   and AssignmentSlave (UIDm, UIDs).

following the demo image of PowerTeacher GradeBook (PowerTeacher GradeBook) to catch the kind of data to manage  with this kind of application, I advice these fields must be added to your original UDT set of data: for grouping students in Class there is HouseColor (string * 8) in Student UDT and Acolor (unsigned Byte) in AssignmentMaster. This way need a good planification creating a code to store both string and unsigned byte.
Thinking about a class with max 24 students and a group of minimum 4 students (max 6 groups in a class), doubling the amount of data to manage with the purpuse to let future enlargment of stack of data to manage (max 48 students  with max 12 groups in a class).
... for my level of knowledge about storing in one byte different information using math and bitdata I got an headache and no practical solution... so I prefer to modify Housecolor into a  string and the same for Acolor so both student UDT and MasterAssignment UDT have the same field that shows which are the class and the group color.

The student UDT need add these fields:  Gender, Grade Scale, Grade Level, Student email, Student phone
The MasterAssignment UDT need add these fields: Weight score, Extra Score, Total score = extra Score + (Possible Score * Weight Score), date of assignment, description, IncludeInFinalGrade.
Moreover we need another  UDT for class with these fields: Course name, Term, Start date, End date, Course number,  Section Number, Periods/Days, Grade Scale, Room, Custom display, Description.

The interface for user can be developed into TUI or GUI. We need a window, some listbox, panels, button menu .

Well, after these developments , we must thinking about Reports.
Reply
#6
So here the step4
I added the new fields, I modified the fields unable to bring easily the important data.

Here the code:
Code: (Select All)
_Title "GradeBook step 4"
$NoPrefix
Option Explicit
Option ExplicitArray
'-------------------------------------------------------


' pushed out for flexible use


Type Dated
    Year As Integer
    Month As Integer
    Day As Integer
End Type

' created as added UDT to manage SchoolClass category
Type classes
    CourseName As String
    Term As String 'this brings the values for starting year and ending year
    StartDate As Dated
    EndDate As Dated

End Type

Type NameListType 'Used for the student name database
    PinYinName As String * 20
    FirstName As String * 20
    MiddleName As String * 20
    LastName As String * 20
    BirdDate As Dated '  it groups the 3 element of date
    StudEmail As String * 38 ' new field for PowerTeacher GradeBook
    StudPhone As String * 12 ' new field for PowerTeacher GradeBook
    HouseColor As String * 20 'modified from string * 8 to string * 20 (Nameclass *11)-(Namegroup *8)
    Gender As String * 1 ' new field for PowerTeacher GradeBook  Male or Female  M/F
    GradeLevel As Integer ' new field for PowerTeacher GradeBook
    GradeScale As Integer ' new field for PowerTeacher GradeBook
    MomName As String * 30
    MomPhone As String * 20 'Saved as string to support symbols and international prefixes
    MomEmail As String * 38
    DadName As String * 30
    DadPhone As String * 20
    DadEmail As String * 38
    UID As Integer
End Type

Type MasterAssignmentType 'Each entry needs to be defined before use with slave
    UID As Integer ' UID for distinguish among different assignments made in the same date and class or set of students
    ARName As String * 20 'Assignment report name
    ADName As String * 10 'Assignment display name (short name)
    AType As Unsigned Byte 'Assignment Type (Completeion, formative, summative, etc.)
    ACat As String * 20 'Assignment Category (subject, unit, etc)
    AColor As String * 20 ' Unsigned Byte 'Color coding assignment headers and for grouping for reports
    ACode As Unsigned Byte 'Reserved
    APts As Unsigned Integer 'Total points allowed= AEPts + (APPts * AWPts)
    AWPts As Unsigned Byte ' weight of each point versus point 1.0 global score ' new field for PowerTeacher GradeBook
    APPts As Unsigned Integer 'possible points getting from the assignment   ' new field for PowerTeacher GradeBook
    AEPts As Unsigned Integer ' Extra point getting from assignment  ' new field for PowerTeacher GradeBook
    ADate As Dated ' new field for PowerTeacher GradeBook
    AIncludeInFinalGrade As Byte ' new field for PowerTeacher GradeBook
    ADescription As String * 100 ' new field for PowerTeacher GradeBook
End Type

Type SlaveAssignmentType 'Each student would require one with use with master
    UIDm As Integer 'UID shows which MasterAssignment has been used
    UIDs As Integer 'UID will match the student name list to match results, negative UID means deleted and we will ignore it on display and reports
    MPts As Unsigned Integer 'Points earned for each particular students
    Flags As Unsigned Byte 'See below for codes
    Flags2 As Unsigned Byte ' Reserved
    Notes As String * 512 'Comments for a student's work
End Type

'====================Flag codes====================
'1   - Late (Turned in late)                      |
'2   - Absent on due date (ignore due date)       |
'4   - Incomplete (turned in but not done)        |
'8   - Missing (Not turned in)                    |
'16  - Excused/Exempt                             |
'32  - Ignore score internally for avg, etc.      |
'64  - Remove from reports (ignore externally)    |
'128 - Reserved                                   |
'==================================================
' end Data Type definition-------------------------------------

Dim Max As Integer, HowMuch As Long, How As Integer
Max = 1
HowMuch = 0

Dim Students(1 To Max) As NameListType, Assignments(1 To Max) As MasterAssignmentType, Results(1 To Max) As SlaveAssignmentType

GoSub initFilerecords

Open "DatabaseDemo2.txt" For Binary As #1
Cls , 14
Print "Now reading Students..."
GoSub ReadStudents
Print " press a key to continue..."
Sleep 2
Cls , 13
Print "Now reading Assignments..."
GoSub ReadAssignment
Print " press a key to continue..."
Sleep 2
Cls , 12
Print "Now reading Results..."
GoSub ReadResults
Close #1
Print " press a key to continue, ESC to quit..."
Sleep 2
Cls , 2
' here start main window of Gradebook database
Dim choice$
choice$ = " "
While choice$ = " "

    Cls , 1
    Call MWindow(2, 2, 78, 23, " <GradeBook Menu> ")
    Locate 4, 4: Print " Press ESCape to quit";
    Locate 6, 4: Print " Press  S for Students List ";
    Locate 8, 4: Print " Press A for Assignment List ";
    Locate 10, 4: Print " Press R for Results List ";

    choice$ = LCase$(InKey$)
    If choice$ = Chr$(27) Then
        Cls , 0:
        Print "Quitting"
        Exit While
    ElseIf choice$ = "a" Then
        Cls , 2
        Print "Assignments: "
        GoSub ShowList
    ElseIf choice$ = "s" Then
        Cls , 5
        Print "Students: "
        GoSub ShowList
    ElseIf choice$ = "r" Then
        Cls , 6
        Print "Result: "
        GoSub ShowList
    End If

    '    Locate 20, 4: Print choice$;
    If Len(choice$) > 0 Then While InKey$ = "": Wend

    _Limit 10
    choice$ = " "
Wend
End '<-------- end of program

' Initialization GOSUB creates file of database  reading internal data
initFilerecords:
Open "DatabaseDemo2.txt" For Binary As #1 ' here database file has been created
' writing Students in the file
HowMuch = 10
ReDim Preserve Students(1 To HowMuch) As NameListType
Put #1, , HowMuch
Restore StudentsData
Locate 24, 1: Print " Filling file"
For How = 1 To HowMuch Step 1
    Read Students(How).PinYinName, Students(How).FirstName, Students(How).MiddleName, Students(How).LastName, Students(How).BirdDate.Year, Students(How).BirdDate.Month, Students(How).BirdDate.Day, Students(How).HouseColor, Students(How).MomName, Students(How).MomPhone, Students(How).MomEmail, Students(How).DadName, Students(How).DadPhone, Students(How).DadEmail, Students(How).UID
    'GoSub ShowStudentRecord
    '_Delay 1
Next How
Put #1, , Students()

'write assignments in the file
Cls , 5
HowMuch = 4
ReDim Preserve Assignments(1 To HowMuch) As MasterAssignmentType

Restore AssignmentData
Put #1, , HowMuch
For How = 1 To HowMuch Step 1
    Read Assignments(How).UID, Assignments(How).ARName, Assignments(How).ADName, Assignments(How).AType, Assignments(How).ACat, Assignments(How).AColor, Assignments(How).ACode, Assignments(How).APts
    'GoSub ShowAssignmentsRecord
    '_Delay 1
Next How
Put #1, , Assignments()

'write results in the file
Cls , 4
HowMuch = 35
Restore ResultsData
ReDim Preserve Results(1 To HowMuch) As SlaveAssignmentType
Put #1, , HowMuch
For How = 1 To HowMuch Step 1
    Read Results(How).UIDm, Results(How).UIDs, Results(How).MPts, Results(How).Flags, Results(How).Flags2, Results(How).Notes
    'GoSub ShowResultsRecord
    '_Delay 1
Next How
Put #1, , Results()
Close #1

Cls , 12
Print "File of database done! Ready to start demo."
Print "Please press a key to start..."
Sleep
Return
' END of initialization GOSUB----------------------------------

'----------Loading data from file of database into RAM-------------
ReadStudents:
'reading students from the file
Cls , 3
Print " Reading file for Students"
Get #1, , HowMuch
ReDim Students(1 To HowMuch) As NameListType
Get #1, , Students()
'For How = 1 To HowMuch Step 1
'    GoSub ShowStudentRecord
'_Delay 1
'Next How
Return

ReadAssignment:
' reading assignments from the file
Cls , 1
Print " Reading file for Assignments"
Get #1, , HowMuch
ReDim Assignments(1 To HowMuch) As MasterAssignmentType
Get #1, , Assignments()
'For How = 1 To HowMuch Step 1
'GoSub ShowAssignmentsRecord
'_Delay 1
'Next How
Return

ReadResults:
' reading results from the file
Cls , 2
Print " Reading file for Results"
Get #1, , HowMuch
ReDim Results(1 To HowMuch) As SlaveAssignmentType
Get #1, , Results()
'For How = 1 To HowMuch Step 1
'GoSub ShowResultsRecord
'_Delay 1
'Next How
Return

'----OUTPUT GOSUB routines ---- to modify for own need
ShowList:
Select Case choice$
    Case "a"
        HowMuch = UBound(Assignments)
        For How = 1 To HowMuch Step 1
            Locate , 4
            Print Assignments(How).UID
            Locate , 4
            Print Assignments(How).ADName; " "; Assignments(How).ARName
        Next How

    Case "r"
        HowMuch = UBound(Results)
        For How = 1 To HowMuch Step 1
            Locate , 4
            Print Assignments(Results(How).UIDm).ADName; " ";
            Print Trim$(Students(Results(How).UIDs).PinYinName); Space$(5); Trim$(Students(Results(How).UIDs).FirstName); Space$(5); Trim$(Students(Results(How).UIDs).MiddleName); Space$(5); Trim$(Students(Results(How).UIDs).LastName);
            Print " "; Results(How).MPts
            If How Mod 15 = 0 Then
                Locate 24, 4: Print "press any key to continue...";
                Sleep 4
                Cls , 6
            End If
        Next How

    Case "s"
        HowMuch = UBound(Students)
        For How = 1 To HowMuch Step 1
            Locate , 4
            Print Students(How).UID
            Locate , 4
            Print Trim$(Students(How).PinYinName); Space$(5); Trim$(Students(How).FirstName); Space$(5); Trim$(Students(How).MiddleName); Space$(5); Trim$(Students(How).LastName)
        Next How
End Select
Locate 24, 4: Print "press any key to continue...";
Return

ShowStudentRecord:
Locate 2, 1: Print Space$(80);
Locate 2, 1: Print Trim$(Students(How).PinYinName); Space$(5); Trim$(Students(How).FirstName); Space$(5); Trim$(Students(How).MiddleName); Space$(5); Trim$(Students(How).LastName);
Locate 4, 1: Print Space$(40);
Locate 4, 1: Print "Birthday: "; Students(How).BirdDate.Year; " "; Students(How).BirdDate.Month; " "; Students(How).BirdDate.Day;
Locate 6, 1: Print "Housecolor: "; Students(How).HouseColor; Space$(10)
Locate 8, 1: Print "Mom data: "; Trim$(Students(How).MomName); "/"; Trim$(Students(1).MomPhone); "/"; Trim$(Students(1).MomEmail); Space$(10)
Locate 10, 1: Print "Dad data: "; Trim$(Students(How).DadName); "/"; Trim$(Students(1).DadPhone); "/"; Trim$(Students(1).DadEmail); Space$(10)
Locate 12, 1: Print "UID of student: "; Students(How).UID
Return


ShowAssignmentsRecord:
Locate 1, 1: Print Assignments(How).UID; Space$(10)
Locate , 1: Print Assignments(How).ARName; Space$(10)
Locate , 1: Print Assignments(How).ADName; Space$(10)
Locate , 1: Print Assignments(How).AType; Space$(10)
Locate , 1: Print Assignments(How).ACat; Space$(10)
Locate , 1: Print "Housecolor: "; Assignments(How).AColor; Space$(10)
Locate , 1: Print "Code: "; Assignments(How).ACode; Space$(10)
Locate , 1: Print "Points: "; Assignments(How).APts
Return

ShowResultsRecord:
Locate 1, 1: Print Results(How).UIDm
Locate , 1: Print Results(How).UIDs
Locate , 1: Print Results(How).MPts
Locate , 1: Print Results(How).Flags
Locate , 1: Print Results(How).Flags2
Locate , 1: Print Results(How).Notes
Return

'--------------------DATA set for database file-----------------
StudentsData:
Data RDJ,Robert,Downing,Junior,2000,2,22,12345600,Julia Concepts,333222111,JConcepts@Yahoo.com,Peter Downing,111222333,PeterD@aol.com,1
Data PJM,Paulus,June,Marcus,1999,3,23,89765909,Maria Capello,444111222,MariaCapello@microsoft.com,Mickie Costello,333222333,Mi_Costello@amazon.com,2
Data TMA,Terrie,Mike,Anderson,2001,12,25,45398758,Stephany Johnson,888999777,StepJo@BBC.com,Frank Boulevard,888777666,FrankBoulevard@microsoft.com,3
Data AJW,Amy,Johnson,Watson,2000,01,04,87543324,Donna Walker,666555333,DonWalk@cisco.com,Walter Bros Julian,888222111,WaltBro@amazon.com,4
Data ERT,Emily,Rose,Tinder,2003,4,15,19045689,Angie Longman,333000999,AngieL@tabloid.com,Donald Foster,444888999,DonaldFoster@cisco.com,5
Data UAB,Ully,Aktick,Brandson,2002,06,09,65498732,Jane Murdock,444555666,JMurdock23@aol.com,Ted Wineger,333444555,TedWineger@cisco.com,6
Data WAS,Wendy,Allison,Singer,2004,6,12,78488922,Melissa Naom,999333999,MeliNaom@yahoo.it,Albert Stone,444000999,ASt456@microsoft.com,7
Data MCS,Molly,Connor,Smith,2001,7,5,54365476,Emily Sandman,099900111,EmilyS@aol.com,Bob Miller,555222111,BMiller567@microsoft.com,8
Data RDJ,Ronny,Dudson,jansenn,2003,8,15,81264554,Jenny Portman,123123123,Jportman@BBC.com,Al Fisherman,678678678,AlFisherman@aol.com,9
Data NK,Nina,Killer,,2000,6,12,65439876,Pauline Arson,567567567,PArson@life.com,Andy Wiley,890890890,Andywiley@micro.com,10
Data "END"

AssignmentData:
Data 1,Mathematical,Math,2,Subject,16,0,20
Data 2,Scientific test,Science,8,Unit,1,0,20
Data 3,English language,English,4,Unit,2,0,20
Data 4,Psycologist test,Psycotest,16,Subject,32,0,20
Data "END"


ResultsData:
Data 1,4,15,0,0,Good Job
Data 1,10,10,0,0,Medium Job
Data 1,2,1,0,0,the worst Job
Data 1,3,5,0,0,Bad Job
Data 1,8,11,0,0,Good Job
Data 1,6,20,0,0,Excellent Job
Data 2,4,15,0,0,Good Job
Data 2,10,8,0,0,Medium Job
Data 2,2,4,0,0,Bad Job
Data 2,3,5,0,0,Bad Job
Data 2,8,11,0,0,Good Job
Data 2,6,20,0,0,Excellent Job
Data 2,9,15,0,0,Good Job
Data 2,1,10,0,0,Medium Job
Data 2,5,1,0,0,the worst Job
Data 2,7,5,0,0,Bad Job
Data 3,8,11,0,0,Good Job
Data 3,6,20,0,0,Excellent Job
Data 3,4,15,0,0,Good Job
Data 3,10,10,0,0,Medium Job
Data 3,2,1,0,0,the worst Job
Data 3,3,5,0,0,Bad Job
Data 3,7,11,0,0,Good Job
Data 3,5,20,0,0,Excellent Job
Data 3,9,15,0,0,Good Job
Data 3,1,10,0,0,Medium Job
Data 4,2,1,0,0,the worst Job
Data 4,3,5,0,0,Bad Job
Data 4,8,11,0,0,Good Job
Data 4,6,20,0,0,Excellent Job
Data 4,4,15,0,0,Good Job
Data 4,10,10,0,0,Medium Job
Data 4,5,1,0,0,the worst Job
Data 4,7,5,0,0,Bad Job
Data 4,9,11,0,0,Good Job
Data "END"

Sub MWindow (Ax As Integer, Ay As Integer, Bx As Integer, By As Integer, Wtitle As String)
    Dim Count As Integer
    Locate Ay, Ax
    Print Space$(Bx - Ax + 1);
    Locate Ay, Ax
    Print String$(Bx - Ax + 1, "Í");
    Locate Ay, Ax:
    Print "É";
    Locate Ay, Bx:
    Print "»";
    For Count = 1 To (By - Ay - 1)
        Locate Ay + Count, Ax
        Print Space$(Bx - Ax + 1);
        Locate Ay + Count, Ax: Print "º";
        Locate Ay + Count, Bx: Print "º";
    Next Count
    Locate By, Ax: Print Space$(Bx - Ax + 1);
    Locate By, Ax
    Print String$(Bx - Ax + 1, "Í");
    Locate By, Ax: Print "È";
    Locate By, Bx: Print "¼";
    Locate Ay, ((Bx - Ax + 1) / 2) - (Len(Wtitle) / 2)
    Print Wtitle;
End Sub

for now it works as the previous because I need a random generator routine for filling the database or a file with these new items.
Moreover to give a more professional output I need  listbox, panels, button menu, while windows exists already.
Reply
#7
(04-12-2023, 10:39 AM)TempodiBasic Wrote: So here the step4
I added the new fields, I modified the fields unable to bring easily the important data.

Here the code:
Code: (Select All)
_Title "GradeBook step 4"
$NoPrefix
Option Explicit
Option ExplicitArray
'-------------------------------------------------------


' pushed out for flexible use


Type Dated
    Year As Integer
    Month As Integer
    Day As Integer
End Type

' created as added UDT to manage SchoolClass category
Type classes
    CourseName As String
    Term As String 'this brings the values for starting year and ending year
    StartDate As Dated
    EndDate As Dated

End Type

Type NameListType 'Used for the student name database
    PinYinName As String * 20
    FirstName As String * 20
    MiddleName As String * 20
    LastName As String * 20
    BirdDate As Dated '  it groups the 3 element of date
    StudEmail As String * 38 ' new field for PowerTeacher GradeBook
    StudPhone As String * 12 ' new field for PowerTeacher GradeBook
    HouseColor As String * 20 'modified from string * 8 to string * 20 (Nameclass *11)-(Namegroup *8)
    Gender As String * 1 ' new field for PowerTeacher GradeBook  Male or Female  M/F
    GradeLevel As Integer ' new field for PowerTeacher GradeBook
    GradeScale As Integer ' new field for PowerTeacher GradeBook
    MomName As String * 30
    MomPhone As String * 20 'Saved as string to support symbols and international prefixes
    MomEmail As String * 38
    DadName As String * 30
    DadPhone As String * 20
    DadEmail As String * 38
    UID As Integer
End Type

Type MasterAssignmentType 'Each entry needs to be defined before use with slave
    UID As Integer ' UID for distinguish among different assignments made in the same date and class or set of students
    ARName As String * 20 'Assignment report name
    ADName As String * 10 'Assignment display name (short name)
    AType As Unsigned Byte 'Assignment Type (Completeion, formative, summative, etc.)
    ACat As String * 20 'Assignment Category (subject, unit, etc)
    AColor As String * 20 ' Unsigned Byte 'Color coding assignment headers and for grouping for reports
    ACode As Unsigned Byte 'Reserved
    APts As Unsigned Integer 'Total points allowed= AEPts + (APPts * AWPts)
    AWPts As Unsigned Byte ' weight of each point versus point 1.0 global score ' new field for PowerTeacher GradeBook
    APPts As Unsigned Integer 'possible points getting from the assignment   ' new field for PowerTeacher GradeBook
    AEPts As Unsigned Integer ' Extra point getting from assignment  ' new field for PowerTeacher GradeBook
    ADate As Dated ' new field for PowerTeacher GradeBook
    AIncludeInFinalGrade As Byte ' new field for PowerTeacher GradeBook
    ADescription As String * 100 ' new field for PowerTeacher GradeBook
End Type

Type SlaveAssignmentType 'Each student would require one with use with master
    UIDm As Integer 'UID shows which MasterAssignment has been used
    UIDs As Integer 'UID will match the student name list to match results, negative UID means deleted and we will ignore it on display and reports
    MPts As Unsigned Integer 'Points earned for each particular students
    Flags As Unsigned Byte 'See below for codes
    Flags2 As Unsigned Byte ' Reserved
    Notes As String * 512 'Comments for a student's work
End Type

'====================Flag codes====================
'1   - Late (Turned in late)                      |
'2   - Absent on due date (ignore due date)       |
'4   - Incomplete (turned in but not done)        |
'8   - Missing (Not turned in)                    |
'16  - Excused/Exempt                             |
'32  - Ignore score internally for avg, etc.      |
'64  - Remove from reports (ignore externally)    |
'128 - Reserved                                   |
'==================================================
' end Data Type definition-------------------------------------

Dim Max As Integer, HowMuch As Long, How As Integer
Max = 1
HowMuch = 0

Dim Students(1 To Max) As NameListType, Assignments(1 To Max) As MasterAssignmentType, Results(1 To Max) As SlaveAssignmentType

GoSub initFilerecords

Open "DatabaseDemo2.txt" For Binary As #1
Cls , 14
Print "Now reading Students..."
GoSub ReadStudents
Print " press a key to continue..."
Sleep 2
Cls , 13
Print "Now reading Assignments..."
GoSub ReadAssignment
Print " press a key to continue..."
Sleep 2
Cls , 12
Print "Now reading Results..."
GoSub ReadResults
Close #1
Print " press a key to continue, ESC to quit..."
Sleep 2
Cls , 2
' here start main window of Gradebook database
Dim choice$
choice$ = " "
While choice$ = " "

    Cls , 1
    Call MWindow(2, 2, 78, 23, " <GradeBook Menu> ")
    Locate 4, 4: Print " Press ESCape to quit";
    Locate 6, 4: Print " Press  S for Students List ";
    Locate 8, 4: Print " Press A for Assignment List ";
    Locate 10, 4: Print " Press R for Results List ";

    choice$ = LCase$(InKey$)
    If choice$ = Chr$(27) Then
        Cls , 0:
        Print "Quitting"
        Exit While
    ElseIf choice$ = "a" Then
        Cls , 2
        Print "Assignments: "
        GoSub ShowList
    ElseIf choice$ = "s" Then
        Cls , 5
        Print "Students: "
        GoSub ShowList
    ElseIf choice$ = "r" Then
        Cls , 6
        Print "Result: "
        GoSub ShowList
    End If

    '    Locate 20, 4: Print choice$;
    If Len(choice$) > 0 Then While InKey$ = "": Wend

    _Limit 10
    choice$ = " "
Wend
End '<-------- end of program

' Initialization GOSUB creates file of database  reading internal data
initFilerecords:
Open "DatabaseDemo2.txt" For Binary As #1 ' here database file has been created
' writing Students in the file
HowMuch = 10
ReDim Preserve Students(1 To HowMuch) As NameListType
Put #1, , HowMuch
Restore StudentsData
Locate 24, 1: Print " Filling file"
For How = 1 To HowMuch Step 1
    Read Students(How).PinYinName, Students(How).FirstName, Students(How).MiddleName, Students(How).LastName, Students(How).BirdDate.Year, Students(How).BirdDate.Month, Students(How).BirdDate.Day, Students(How).HouseColor, Students(How).MomName, Students(How).MomPhone, Students(How).MomEmail, Students(How).DadName, Students(How).DadPhone, Students(How).DadEmail, Students(How).UID
    'GoSub ShowStudentRecord
    '_Delay 1
Next How
Put #1, , Students()

'write assignments in the file
Cls , 5
HowMuch = 4
ReDim Preserve Assignments(1 To HowMuch) As MasterAssignmentType

Restore AssignmentData
Put #1, , HowMuch
For How = 1 To HowMuch Step 1
    Read Assignments(How).UID, Assignments(How).ARName, Assignments(How).ADName, Assignments(How).AType, Assignments(How).ACat, Assignments(How).AColor, Assignments(How).ACode, Assignments(How).APts
    'GoSub ShowAssignmentsRecord
    '_Delay 1
Next How
Put #1, , Assignments()

'write results in the file
Cls , 4
HowMuch = 35
Restore ResultsData
ReDim Preserve Results(1 To HowMuch) As SlaveAssignmentType
Put #1, , HowMuch
For How = 1 To HowMuch Step 1
    Read Results(How).UIDm, Results(How).UIDs, Results(How).MPts, Results(How).Flags, Results(How).Flags2, Results(How).Notes
    'GoSub ShowResultsRecord
    '_Delay 1
Next How
Put #1, , Results()
Close #1

Cls , 12
Print "File of database done! Ready to start demo."
Print "Please press a key to start..."
Sleep
Return
' END of initialization GOSUB----------------------------------

'----------Loading data from file of database into RAM-------------
ReadStudents:
'reading students from the file
Cls , 3
Print " Reading file for Students"
Get #1, , HowMuch
ReDim Students(1 To HowMuch) As NameListType
Get #1, , Students()
'For How = 1 To HowMuch Step 1
'    GoSub ShowStudentRecord
'_Delay 1
'Next How
Return

ReadAssignment:
' reading assignments from the file
Cls , 1
Print " Reading file for Assignments"
Get #1, , HowMuch
ReDim Assignments(1 To HowMuch) As MasterAssignmentType
Get #1, , Assignments()
'For How = 1 To HowMuch Step 1
'GoSub ShowAssignmentsRecord
'_Delay 1
'Next How
Return

ReadResults:
' reading results from the file
Cls , 2
Print " Reading file for Results"
Get #1, , HowMuch
ReDim Results(1 To HowMuch) As SlaveAssignmentType
Get #1, , Results()
'For How = 1 To HowMuch Step 1
'GoSub ShowResultsRecord
'_Delay 1
'Next How
Return

'----OUTPUT GOSUB routines ---- to modify for own need
ShowList:
Select Case choice$
    Case "a"
        HowMuch = UBound(Assignments)
        For How = 1 To HowMuch Step 1
            Locate , 4
            Print Assignments(How).UID
            Locate , 4
            Print Assignments(How).ADName; " "; Assignments(How).ARName
        Next How

    Case "r"
        HowMuch = UBound(Results)
        For How = 1 To HowMuch Step 1
            Locate , 4
            Print Assignments(Results(How).UIDm).ADName; " ";
            Print Trim$(Students(Results(How).UIDs).PinYinName); Space$(5); Trim$(Students(Results(How).UIDs).FirstName); Space$(5); Trim$(Students(Results(How).UIDs).MiddleName); Space$(5); Trim$(Students(Results(How).UIDs).LastName);
            Print " "; Results(How).MPts
            If How Mod 15 = 0 Then
                Locate 24, 4: Print "press any key to continue...";
                Sleep 4
                Cls , 6
            End If
        Next How

    Case "s"
        HowMuch = UBound(Students)
        For How = 1 To HowMuch Step 1
            Locate , 4
            Print Students(How).UID
            Locate , 4
            Print Trim$(Students(How).PinYinName); Space$(5); Trim$(Students(How).FirstName); Space$(5); Trim$(Students(How).MiddleName); Space$(5); Trim$(Students(How).LastName)
        Next How
End Select
Locate 24, 4: Print "press any key to continue...";
Return

ShowStudentRecord:
Locate 2, 1: Print Space$(80);
Locate 2, 1: Print Trim$(Students(How).PinYinName); Space$(5); Trim$(Students(How).FirstName); Space$(5); Trim$(Students(How).MiddleName); Space$(5); Trim$(Students(How).LastName);
Locate 4, 1: Print Space$(40);
Locate 4, 1: Print "Birthday: "; Students(How).BirdDate.Year; " "; Students(How).BirdDate.Month; " "; Students(How).BirdDate.Day;
Locate 6, 1: Print "Housecolor: "; Students(How).HouseColor; Space$(10)
Locate 8, 1: Print "Mom data: "; Trim$(Students(How).MomName); "/"; Trim$(Students(1).MomPhone); "/"; Trim$(Students(1).MomEmail); Space$(10)
Locate 10, 1: Print "Dad data: "; Trim$(Students(How).DadName); "/"; Trim$(Students(1).DadPhone); "/"; Trim$(Students(1).DadEmail); Space$(10)
Locate 12, 1: Print "UID of student: "; Students(How).UID
Return


ShowAssignmentsRecord:
Locate 1, 1: Print Assignments(How).UID; Space$(10)
Locate , 1: Print Assignments(How).ARName; Space$(10)
Locate , 1: Print Assignments(How).ADName; Space$(10)
Locate , 1: Print Assignments(How).AType; Space$(10)
Locate , 1: Print Assignments(How).ACat; Space$(10)
Locate , 1: Print "Housecolor: "; Assignments(How).AColor; Space$(10)
Locate , 1: Print "Code: "; Assignments(How).ACode; Space$(10)
Locate , 1: Print "Points: "; Assignments(How).APts
Return

ShowResultsRecord:
Locate 1, 1: Print Results(How).UIDm
Locate , 1: Print Results(How).UIDs
Locate , 1: Print Results(How).MPts
Locate , 1: Print Results(How).Flags
Locate , 1: Print Results(How).Flags2
Locate , 1: Print Results(How).Notes
Return

'--------------------DATA set for database file-----------------
StudentsData:
Data RDJ,Robert,Downing,Junior,2000,2,22,12345600,Julia Concepts,333222111,JConcepts@Yahoo.com,Peter Downing,111222333,PeterD@aol.com,1
Data PJM,Paulus,June,Marcus,1999,3,23,89765909,Maria Capello,444111222,MariaCapello@microsoft.com,Mickie Costello,333222333,Mi_Costello@amazon.com,2
Data TMA,Terrie,Mike,Anderson,2001,12,25,45398758,Stephany Johnson,888999777,StepJo@BBC.com,Frank Boulevard,888777666,FrankBoulevard@microsoft.com,3
Data AJW,Amy,Johnson,Watson,2000,01,04,87543324,Donna Walker,666555333,DonWalk@cisco.com,Walter Bros Julian,888222111,WaltBro@amazon.com,4
Data ERT,Emily,Rose,Tinder,2003,4,15,19045689,Angie Longman,333000999,AngieL@tabloid.com,Donald Foster,444888999,DonaldFoster@cisco.com,5
Data UAB,Ully,Aktick,Brandson,2002,06,09,65498732,Jane Murdock,444555666,JMurdock23@aol.com,Ted Wineger,333444555,TedWineger@cisco.com,6
Data WAS,Wendy,Allison,Singer,2004,6,12,78488922,Melissa Naom,999333999,MeliNaom@yahoo.it,Albert Stone,444000999,ASt456@microsoft.com,7
Data MCS,Molly,Connor,Smith,2001,7,5,54365476,Emily Sandman,099900111,EmilyS@aol.com,Bob Miller,555222111,BMiller567@microsoft.com,8
Data RDJ,Ronny,Dudson,jansenn,2003,8,15,81264554,Jenny Portman,123123123,Jportman@BBC.com,Al Fisherman,678678678,AlFisherman@aol.com,9
Data NK,Nina,Killer,,2000,6,12,65439876,Pauline Arson,567567567,PArson@life.com,Andy Wiley,890890890,Andywiley@micro.com,10
Data "END"

AssignmentData:
Data 1,Mathematical,Math,2,Subject,16,0,20
Data 2,Scientific test,Science,8,Unit,1,0,20
Data 3,English language,English,4,Unit,2,0,20
Data 4,Psycologist test,Psycotest,16,Subject,32,0,20
Data "END"


ResultsData:
Data 1,4,15,0,0,Good Job
Data 1,10,10,0,0,Medium Job
Data 1,2,1,0,0,the worst Job
Data 1,3,5,0,0,Bad Job
Data 1,8,11,0,0,Good Job
Data 1,6,20,0,0,Excellent Job
Data 2,4,15,0,0,Good Job
Data 2,10,8,0,0,Medium Job
Data 2,2,4,0,0,Bad Job
Data 2,3,5,0,0,Bad Job
Data 2,8,11,0,0,Good Job
Data 2,6,20,0,0,Excellent Job
Data 2,9,15,0,0,Good Job
Data 2,1,10,0,0,Medium Job
Data 2,5,1,0,0,the worst Job
Data 2,7,5,0,0,Bad Job
Data 3,8,11,0,0,Good Job
Data 3,6,20,0,0,Excellent Job
Data 3,4,15,0,0,Good Job
Data 3,10,10,0,0,Medium Job
Data 3,2,1,0,0,the worst Job
Data 3,3,5,0,0,Bad Job
Data 3,7,11,0,0,Good Job
Data 3,5,20,0,0,Excellent Job
Data 3,9,15,0,0,Good Job
Data 3,1,10,0,0,Medium Job
Data 4,2,1,0,0,the worst Job
Data 4,3,5,0,0,Bad Job
Data 4,8,11,0,0,Good Job
Data 4,6,20,0,0,Excellent Job
Data 4,4,15,0,0,Good Job
Data 4,10,10,0,0,Medium Job
Data 4,5,1,0,0,the worst Job
Data 4,7,5,0,0,Bad Job
Data 4,9,11,0,0,Good Job
Data "END"

Sub MWindow (Ax As Integer, Ay As Integer, Bx As Integer, By As Integer, Wtitle As String)
    Dim Count As Integer
    Locate Ay, Ax
    Print Space$(Bx - Ax + 1);
    Locate Ay, Ax
    Print String$(Bx - Ax + 1, "Í");
    Locate Ay, Ax:
    Print "É";
    Locate Ay, Bx:
    Print "»";
    For Count = 1 To (By - Ay - 1)
        Locate Ay + Count, Ax
        Print Space$(Bx - Ax + 1);
        Locate Ay + Count, Ax: Print "º";
        Locate Ay + Count, Bx: Print "º";
    Next Count
    Locate By, Ax: Print Space$(Bx - Ax + 1);
    Locate By, Ax
    Print String$(Bx - Ax + 1, "Í");
    Locate By, Ax: Print "È";
    Locate By, Bx: Print "¼";
    Locate Ay, ((Bx - Ax + 1) / 2) - (Len(Wtitle) / 2)
    Print Wtitle;
End Sub

for now it works as the previous because I need a random generator routine for filling the database or a file with these new items.
Moreover to give a more professional output I need  listbox, panels, button menu, while windows exists already.

I am glad I saw this! You have some great ideas that I overlooked when planning the Master assignment file. I have added your ideas into the UDT. Since we are both looking at it, I am wondering if there is anything you can think?

Code: (Select All)
'Assignments for all students, populates the top of the gradebook
TYPE MasterAssignmentType
    ARName AS STRING * 20 'Assignment report name
    ADName AS STRING * 10 'Assignment display name (short name)
    AType AS UNSIGNED BYTE 'Assignment Type (Completeion, formative, summative, etc.)
    ACat AS STRING * 20 'Assignment Category (subject, unit, etc)
    AColor AS UNSIGNED BYTE 'Color coding assignment headers and for grouping for reports
    ACode AS UNSIGNED BYTE 'Reserved
    APts AS UNSIGNED INTEGER 'Total points allowed
    AWght AS UNSIGNED INTEGER 'For weighted assignments/100 = 100%
    Month AS INTEGER
    Day AS INTEGER
    Year AS INTEGER
    AID AS INTEGER64 'Unique assignment ID
    ADetails AS STRING * 4096 'Space to write instructions for an assignment sheet to print.
END TYPE

I am looking forward to seeing how you will manage your user interface!
Reply




Users browsing this thread: 1 Guest(s)