AshleyLuEllen / AttendanceReportGenerator

1 stars 0 forks source link

JSON format support for settings file (perhaps support both based on file extension?) #4

Open ZekNikZ opened 3 years ago

ZekNikZ commented 3 years ago

Example: settings.json

Could even be combined with #3, as seen below. master_report_columns specifies a list of custom columns to add to the end of the master sheet. The key (e.g., "Exam 1") would be the column name and the value (the object) specifies the filtering and reducing criteria.

I would recommend using filter, map, and a reducer of some sort (either with the reduce function or calling sum or len individually).

Use any convenient date format

{
    "leader_email": "Matthew_McCaskill1@baylor.edu",
    "session_types": {
        "SI Session": {
            "abbreviation": "SI",
            "start_time": "05:30:00 PM",
            "end_time": "07:00:00 PM",
            "credits": 1,
            "required_mins_for_credit": 45
        },
        "Online Office Hour": {
            "abbreviation": "OH",
            "start_time": "02:00:00 PM",
            "end_time": "03:00:00 PM",
            "credits": 1,
            "required_mins_for_credit": 1
        },
        "Test #1 Review Session": {
            "abbreviation": "TR",
            "start_time": "05:30:00 PM",
            "end_time": "07:30:00 PM",
            "credits": 0,
            "required_mins_for_credit": null
        },
        "Test #2 Review Session": {
            "abbreviation": "TR",
            "start_time": "05:30:00 PM",
            "end_time": "07:30:00 PM",
            "credits": 0,
            "required_mins_for_credit": null
        },
        "Test #3 Review Session": {
            "abbreviation": "TR",
            "start_time": "05:30:00 PM",
            "end_time": "07:30:00 PM",
            "credits": 0,
            "required_mins_for_credit": null
        },
        "Test #4 Review Session": {
            "abbreviation": "TR",
            "start_time": "05:30:00 PM",
            "end_time": "07:30:00 PM",
            "credits": 0,
            "required_mins_for_credit": null
        }
    },
    "master_report_columns": {
        "Exam 1": {
            "start_date": "2020-10-10",
            "end_date": "2020-10-20",
            "type": "sum",
            "session_types": [
                "SI Session",
                "Online Office Hour"
            ]
        },
        "Exam 2": {
            "start_date": "2020-10-10",
            "end_date": "2020-10-20",
            "type": "sum",
            "session_types": [
                "SI Session",
                "Online Office Hour"
            ]
        },
        "Exam 3": {
            "start_date": "2020-10-10",
            "end_date": "2020-10-20",
            "type": "sum",
            "session_types": [
                "SI Session",
                "Online Office Hour"
            ]
        },
        "Exam 4": {
            "start_date": "2020-10-10",
            "end_date": "2020-10-20",
            "type": "sum",
            "session_types": [
                "SI Session",
                "Online Office Hour"
            ]
        },
        "Total Credits": {
            "start_date": "2020-10-10",
            "end_date": "2020-10-20",
            "type": "sum",
            "session_types": [
                "SI Session",
                "Online Office Hour"
            ]
        },
        "Total Attendance": {
            "start_date": "2020-10-10",
            "end_date": "2020-10-20",
            "type": "count",
            "session_types": [
                "SI Session",
                "Online Office Hour",
                "Test #1 Review Session",
                "Test #2 Review Session",
                "Test #3 Review Session",
                "Test #4 Review Session"
            ]
        }
    }
}
AshleyLuEllen commented 3 years ago

I am a bit confused about what this is for, could you give me some more information about it?

I am currently implementing a json file that allows for some information for stats. (Where the student email and number of attendances are listed in a csv file)

This is the format for the json file:


{
  "stat1":{
    "file_name": "",
    "startDate": "",
    "endDate": "",
    "includeSI": true,
    "includeOH": true,
    "includeTR": false,
    "qualifiedOnly": true,
    "requiredCount": 0
  }
} ```

Is this close to what you are looking for?