pygtracker package¶
Submodules¶
pygtracker.pygtracker module¶
-
class
pygtracker.pygtracker.GradeTracker¶ Bases:
objectA grade tracker to help UBC MDS lecturers to manage, analyze and adjust students’ grades
-
courses¶ The dataframe containing component weights for each course.
- Type
DataFrame
-
grades¶ The dataframe containing grades for each student in each course.
- Type
DataFrame
-
calculate_final_grade(course_ids)¶ Calculate final grade for all students in a course
- Parameters
course_ids (list of str) – The ids of the courses to calculate the average grade for all students.
- Returns
- A dataframe containing final grades for all students in a course:
course_id: str student_id: str grade: float
- Return type
DataFrame
-
courses= None¶
-
generate_course_statistics(course_ids)¶ Calculate the summary statistics for specified courses including mean, median and quantiles.
- Parameters
course_ids (list of str) – A list including all course IDs for which the summary statistics are calculated for.
- Returns
A dataframe containing the summary statistics for specified courses:
course_id: str mean: float 1st-quantile: float median: float 3rd-quantile: float
- Return type
DataFrame
-
grades= None¶
-
rank_courses(method='mean', descending=True)¶ Calculate students’ course grades to rank courses in ascending or descending order by a specified method.
- Parameters
method ({"mean", "1st-quantile", "median", "3rd-quantile"},) – `default “mean” The method applied to rank the courses.
descending (bool, default True) – A boolean value to decide if the rank should be in descending or ascending order.
- Returns
- A dataframe containing the rank for specified courses:
course_id: str grade: float
- Return type
DataFrame
-
rank_students(course_id='all', n=3, ascending=False)¶ Calculate the average grade for a specified number of students and ranks them in ascending/descending order for a specific course or for the entire program completed thus far.
- Parameters
course_id (str, default "all") – The course id for which the ranking is calculated for. Default will provide the ranking for the entire program completed thus far.
n (int, default 3) – The number of students to rank.
ascending (bool, default True) – A boolean value to decide if the rank should be in descending or ascending order.
- Returns
- A dataframe containing the rank of students by average grade:
student_id: str rank: float grade: float
- Return type
DataFrame
-
record_grades(df)¶ Record grades for students for a specified course and its assessments.
- Parameters
df (DataFrame) –
- A tidy dataframe:
course_id: str student_id: str assessment_id: str grade: float
- Returns
- Return type
None
-
register_courses(df)¶ Read and store the input dataframe as a pandas DataFrame.
- Parameters
df (DataFrame) –
- A tidy dataframe:
course_id: str assessment_id: str, ex: lab1, quiz1 weight: float, ex: 0.2
All assessment components for a course must sum up to 1.
- Returns
- Return type
None
-
suggest_grade_adjustment(course_id, benchmark_course=90, benchmark_lab=85, benchmark_quiz=85)¶ Suggest grade adjustment for a particular course based on predefined benchmarks to make sure the final grade meets or exceeds these benchmarks.
- Parameters
course_id (str) – The id of the course to be adjusted.
benchmark_course (float, default 90) – The benchmark of which the average grade for the whole course must meet or exceed.
benchmark_lab (float, default 85) – The benchmark of which the average grade for each lab must meet or exceed.
benchmark_quiz (float, default 85) – The benchmark of which the average grade for each quiz must meet or exceed.
- Returns
A dataframe containing newly adjusted grades for students in a course:
student_id: str assessment1: float assessment2: float …
- Return type
DataFrame
-
-
pygtracker.pygtracker.check_in_mds(ids, mds_list)¶ a helper function to check if the input(s) are MDS assessments or courses.