Course Information Module Document¶
- class OpenLA.course_information.CourseInformation(course_id=None, files_dir=None, event_stream_file=None, lecture_material_file=None, lecture_time_file=None, quiz_score_file=None, grade_point_file=None, event_stream_df=None, lecture_material_df=None, lecture_time_df=None, quiz_score_df=None, grade_point_df=None)[source]¶
Bases:
object
- load_eventstream()[source]¶
Load event stream and return the instance of EventStream class.
- Returns
The instance of EventStream
- Return type
- event_stream_df()[source]¶
Load DataFrame about event stream.
- Returns
DataFrame about event stream
- Return type
pandas.DataFrame
- lecture_material_df()[source]¶
Load DataFrame about contents id, lecture week using the contents, and the number of pages in the contents.
- Returns
DataFrame about lecture material (contents)
- Return type
pandas.DataFrame
- lecture_time_df()[source]¶
Load DataFrame about lecture week, the lecture start time, and the lecture end time.
- Returns
DataFrame about lecture time
- Return type
pandas.DataFrame
- quiz_score_df()[source]¶
Load DataFrame about user id and quiz score.
- Returns
DataFrame about quiz score
- Return type
pandas.DataFrame
- grade_point_df()[source]¶
Load DataFrame about user id and grade point.
- Returns
DataFrame about quiz score
- Return type
pandas.DataFrame
- contents_id()[source]¶
Get the contents ids in this course.
- Returns
List of contents ids in this course
- Return type
list[str]
- lecture_week()[source]¶
Get the week number lectures conducted in this course
- Returns
List of lecture weeks in this course
- Return type
list[int]
- num_users()[source]¶
Get the number of users in this course.
- Returns
Number of users in this course
- Return type
int
- user_id()[source]¶
Get unique user ids in this course.
- Returns
List of user ids in this course
- Return type
list[str]
- user_score(user_id=None)[source]¶
Get user(s) final score in this course.
- Parameters
user_id (str or List[str] or None) – user id or list of user ids to get score data.
- Returns
The quiz score of the user(s).
If the arguments “user_id” is given as a list, the function returns list of quiz scores.
Else if “user_id” is None, the function returns all users score.
- Return type
float or List[float]
- user_grade(user_id=None)[source]¶
Get user(s) final grade in this course.
- Parameters
user_id (str or List[str] or None) – user id or list of user ids to get grade data.
- Returns
The grade point of the user(s).
If the arguments “user_id” is given as a list, the function returns list of grade point.
Else if “user_id” is None, the function returns all users score.
- Return type
str or list[str]
- grade_distribution()[source]¶
Get grade distribution in this course.
- Returns
DataFrame of grade distribution. (index: ‘grade’, columns:[‘count’, ‘proportion’])
- Return type
pandas.DataFrame
- users_in_selected_score(users_list=None, bottom=None, top=None)[source]¶
Get user id(s) who got the score between selected scores.
- Parameters
users_list (list[str] or None) – list of user_ids. The return users are selected from users in this list. If this list is None, the users are selected from all users in this course.
bottom (int or float or None) – the bottom score for extraction
top (int or float or None) – the top score for extraction
- Returns
List of user ids who got the score between “bottom” and “top”.
If the argument “bottom” is None, extract all users whose scores are under “top”.
If the argument “top” is None, extract all users whose scores are above “bottom”.
- Return type
list[str]
- users_in_selected_grade(users_list=None, grade=None)[source]¶
Get user id(s) who got the selected grade.
- Parameters
users_list (list[str] or None) – list of user_ids. The return users are selected from users in this list. If this list is None, the users are selected from all users in this course.
bottom (int or float or None) – the bottom score for extraction
top (int or float or None) – the top score for extraction
- Returns
List of user ids who got the grade(s) indicated by the argument ‘grade’
- Return type
list[str]
- contents_id_to_lecture_week(contents_id)[source]¶
Get the week number of the lecture(s) using the content(s) of the argument “contents_id”.
- Parameters
contents_id (str or list[str]) – The contents id or list of contents ids.
- Returns
The lecture week corresponding to the “contents_id”.
If the argument “contents_id” is given as a list, the function returns list of lecture weeks.
- Return type
int or list[int]
- lecture_week_to_contents_id(lecture_week)[source]¶
Get the content(s) id used in the lecture of the argument “lecture_week”.
- Parameters
lecture_week (int or list[int]) – The lecture week or list of lecture weeks
- Returns
The contents id corresponding to the lecture week(s).
If there is more than one relevant contents id, the function returns a list with them.
- Return type
str or list[str]
- num_pages_of_contents(contents_id)[source]¶
Get the number of pages of the content(s) with the argument “contents_id”.
- Parameters
contents_id (str or list[str]) – contents id or list of contents ids
- Returns
The number of pages of the lecture material.
If the argument “contents_id” is given as a list, the function returns list of number of pages.
- Return type
int or list[int]
- lecture_start_time(lecture_week)[source]¶
Get the start time of the lecture(s) of the argument “lecture_week”.
- Parameters
lecture_week (int or list[int]) – lecture week or list of lecture weeks to get lecture start time.
- Returns
The start time of the lecture in the lecture week.
If the argument “lecture_week” is given as a list, the function returns list of start times.
- Return type
pandas.Timestamp or list of pandas.Timestamp
- lecture_end_time(lecture_week)[source]¶
Get the end time of the lecture(s) of the argument “lecture_week”.
- Parameters
lecture_week (int or list[int]) – lecture week or list of lecture weeks to get lecture end time.
- Returns
The end time of the lecture in the lecture week.
If the argument “lecture_week” is given as a list, the function returns list of end times.
- Return type
pandas.Timestamp or list of pandas.Timestamp
- OpenLA.course_information.start_analysis(course_id=None, files_dir=None, event_stream_file=None, lecture_material_file=None, lecture_time_file=None, quiz_score_file=None, grade_point_file=None, event_stream_df=None, lecture_material_df=None, lecture_time_df=None, quiz_score_df=None, grade_point_df=None)[source]¶
Get CourseInformation instance and EventStream instance simultaneously. For any given data source, the file path will take priority over the DataFrame if both arguments are passed.
- Parameters
course_id (str or None) – The id of the course to process.
files_dir (str or None) – The directory which has “Course_xxx_EventStream.csv”, “Course_xxx_LectureMaterial.csv”, “Course_xxx_LectureTime.csv”, and “Course_xxx_QuizScore.csv (xxx is course id).
event_stream_file (str or None) – If you want to specify the file path directly, use this argument.
lecture_material_file (str or None) – If you want to specify the file path directly, use this argument.
lecture_time_file (str or None) – If you want to specify the file path directly, use this argument.
quiz_score_file (str or None) – If you want to specify the file path directly, use this argument.
event_stream_df (pandas.DataFrame or None) – If you want to pass a DataFrame directly, use this argument.
lecture_material_df (pandas.DataFrame or None) – If you want to pass a DataFrame directly, use this argument.
lecture_time_df (pandas.DataFrame or None) – If you want to pass a DataFrame directly, use this argument.
quiz_score_df (pandas.DataFrame or None) – If you want to pass a DataFrame directly, use this argument.
grade_point_df (pandas.DataFrame or None) – If you want to pass a DataFrame directly, use this argument.
- Returns
course_info - Instances of class “CourseInformation”
event_stream - Instances of class “EventStream”