-
Notifications
You must be signed in to change notification settings - Fork 0
Content quiz performance #97
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
nononovia
wants to merge
17
commits into
main
Choose a base branch
from
Content_quiz_performance
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
984369b
Content quiz anaylsis code competed
Rick-Feng-u 0c2dc4a
Create __init__.py
Rick-Feng-u 1e7dc72
Merge branch 'main' into Content_quiz_performance
Rick-Feng-u c8a508c
Update analysis_on_content_quiz.py
Rick-Feng-u 78b015b
Merge branch 'main' into Content_quiz_performance
Rick-Feng-u fb8a0e1
write util function for checking if a file is a reading log.
nononovia aafaf3f
make analysis_on_content_quiz.py use util function to calculate conte…
nononovia 6c3969b
clean up code for analysis_on_content_quiz.py
nononovia bc793c3
Merge remote-tracking branch 'origin/num-attempts-update' into Conten…
nononovia a16399e
Merge remote-tracking branch 'origin/outlier-removal' into Content_qu…
nononovia 8ef8d5f
refractor how grade and attempts are graphed
nononovia 08fc3e0
fix bug in how the first attempt average is calculated for content quiz.
nononovia 7b5309b
After discussion with opey, all overall calculations are compound cal…
nononovia 92d1ad9
pr changes
nononovia 31f8cd5
Merge branch 'main' into Content_quiz_performance
nononovia 304a410
Merge branch 'main' into Content_quiz_performance
nononovia 1ebbc64
Merge remote-tracking branch 'origin/Content_quiz_performance' into C…
nononovia File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| from util import ReadingLogsData | ||
| from scripts import content_quiz_attempts_analysis, content_quiz_grade_analysis | ||
|
|
||
| if __name__ == '__main__': | ||
| reading_logs_data = ReadingLogsData() | ||
| reading_dict, quiz_dict = reading_logs_data.get_parsed_reading_log_data() | ||
| content_quiz_attempts_analysis(quiz_dict) | ||
| content_quiz_grade_analysis(quiz_dict) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
124 changes: 124 additions & 0 deletions
124
scripts/content_quiz_analysis/analysis_on_content_quiz.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,124 @@ | ||
| import matplotlib.pyplot as plt | ||
| import numpy as np | ||
| from util import ReadingLogsData | ||
| from schemas import CourseSchema | ||
|
|
||
|
|
||
| def content_quiz_attempts_analysis(content_quiz_dict): | ||
| r = ReadingLogsData() | ||
|
|
||
| page_content_quiz_attempt_mean = [] | ||
| page_content_quiz_attempt_std = [] | ||
| content_quiz_attempt_pages = [] | ||
|
|
||
| module_content_quiz_attempt_mean = [] | ||
| module_content_quiz_attempt_std = [] | ||
| content_quiz_attempt_modules = [] | ||
|
|
||
| module_paragraphs_dict = r.get_module_paragraphs_dict() | ||
| for module_num, page_dict in module_paragraphs_dict.items(): | ||
| for page_num, page_data in page_dict.items(): | ||
| if not CourseSchema.page_is_valid(module_num, page_num): | ||
| continue | ||
|
|
||
| # set up for per page analysis | ||
| page_attempt = r.page_content_quiz_num_attempts(module_num, page_num) | ||
| if page_attempt is not None: | ||
| content_quiz_attempt_pages.append(str(module_num)+"-"+str(page_num)) | ||
| page_content_quiz_attempt_mean.append(page_attempt[0]) | ||
| page_content_quiz_attempt_std.append(page_attempt[1]) | ||
|
|
||
| # set up for per module analysis | ||
| module_attempt = r.module_content_quiz_num_attempts(module_num) | ||
| if module_attempt is not None: | ||
| content_quiz_attempt_modules.append(str(module_num)) | ||
| module_content_quiz_attempt_mean.append(module_attempt[0]) | ||
| module_content_quiz_attempt_std.append(module_attempt[1]) | ||
|
|
||
| # Per page graph | ||
| page_content_quiz_attempt_std.append(np.mean(page_content_quiz_attempt_mean)) | ||
| page_content_quiz_attempt_mean.append(np.std(page_content_quiz_attempt_mean)) | ||
| content_quiz_attempt_pages.append('Overall') | ||
|
|
||
| plt.scatter(content_quiz_attempt_pages, page_content_quiz_attempt_mean) | ||
| plt.errorbar(content_quiz_attempt_pages, page_content_quiz_attempt_mean, yerr=page_content_quiz_attempt_std, | ||
| fmt='o', ecolor="skyblue", elinewidth=0.5) | ||
| plt.xticks(fontsize=5) | ||
| plt.xlabel("Module_number-Page_number") | ||
| plt.ylabel("Number of attempts") | ||
| plt.title("Mean and Standard Deviation of Extra Attempts for Each Content Quiz") | ||
| plt.show() | ||
|
|
||
| # Per module graph | ||
| module_content_quiz_attempt_mean.append(np.mean(module_content_quiz_attempt_mean)) | ||
| module_content_quiz_attempt_std.append(np.std(module_content_quiz_attempt_mean)) | ||
| content_quiz_attempt_modules.append('Overall') | ||
|
|
||
| plt.scatter(content_quiz_attempt_modules, module_content_quiz_attempt_mean) | ||
| plt.errorbar(content_quiz_attempt_modules, module_content_quiz_attempt_mean, yerr=module_content_quiz_attempt_std, | ||
| fmt='o', ecolor="skyblue", elinewidth=0.5) | ||
| plt.xticks(fontsize=5) | ||
| plt.xlabel("Module_number") | ||
| plt.ylabel("Number of attempts") | ||
| plt.title("Mean and Standard Deviation of Extra Attempts for Each Module") | ||
| plt.show() | ||
|
|
||
|
|
||
| def content_quiz_grade_analysis(content_quiz_dict): | ||
| r = ReadingLogsData() | ||
|
|
||
| page_content_quiz_grade_mean = [] | ||
| page_content_quiz_grade_std = [] | ||
| content_quiz_grade_pages = [] | ||
|
|
||
| module_content_quiz_grade_mean = [] | ||
| module_content_quiz_grade_std = [] | ||
| content_quiz_grade_modules = [] | ||
|
|
||
| module_paragraphs_dict = r.get_module_paragraphs_dict() | ||
| for module_num, page_dict in module_paragraphs_dict.items(): | ||
| for page_num, page_data in page_dict.items(): | ||
| if not CourseSchema.page_is_valid(module_num, page_num): | ||
| continue | ||
|
|
||
| # set up for per page analysis | ||
| page_grade = r.page_content_quiz_first_attempt_grade(module_num=module_num, page_num=page_num) | ||
| if page_grade is not None: | ||
| content_quiz_grade_pages.append(str(module_num) + "-" + str(page_num)) | ||
| page_content_quiz_grade_mean.append(page_grade[0]) | ||
| page_content_quiz_grade_std.append(page_grade[1]) | ||
|
|
||
| # set up for per module analysis | ||
| module_grade = r.module_content_quiz_first_attempt_grade(module_num) | ||
| if module_grade is not None: | ||
| content_quiz_grade_modules.append(str(module_num)) | ||
| module_content_quiz_grade_mean.append(module_grade[0]) | ||
| module_content_quiz_grade_std.append(module_grade[1]) | ||
|
|
||
| # Per page graph | ||
| page_content_quiz_grade_mean.append(np.mean(page_content_quiz_grade_mean)) | ||
| page_content_quiz_grade_std.append(np.std(page_content_quiz_grade_mean)) | ||
| content_quiz_grade_pages.append('Overall') | ||
|
|
||
| plt.scatter(content_quiz_grade_pages, page_content_quiz_grade_mean) | ||
| plt.errorbar(content_quiz_grade_pages, page_content_quiz_grade_mean, yerr=page_content_quiz_grade_std, | ||
| fmt='o', ecolor="skyblue", elinewidth=0.5) | ||
| plt.xticks(fontsize=5) | ||
| plt.xlabel("Module_number-Page_number") | ||
| plt.ylabel("Number of grades") | ||
| plt.title("Mean and Standard Deviation of First Attempt Grade for Each Content Quiz") | ||
| plt.show() | ||
|
|
||
| # Per module graph | ||
| module_content_quiz_grade_mean.append(np.mean(module_content_quiz_grade_mean)) | ||
| module_content_quiz_grade_std.append(np.std(module_content_quiz_grade_mean)) | ||
| content_quiz_grade_modules.append('Overall') | ||
|
|
||
| plt.scatter(content_quiz_grade_modules, module_content_quiz_grade_mean) | ||
| plt.errorbar(content_quiz_grade_modules, module_content_quiz_grade_mean, yerr=module_content_quiz_grade_std, | ||
| fmt='o', ecolor="skyblue", elinewidth=0.5) | ||
| plt.xticks(fontsize=5) | ||
| plt.xlabel("Module_number") | ||
| plt.ylabel("First attempt grades") | ||
| plt.title("Mean and Standard Deviation of First Attempt Grade for Each Module") | ||
| plt.show() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -4,6 +4,7 @@ | |
| from .const import KEY_PATH, MODULE_PARAGRAPHS_OUTPUT_FILEPATH, CACHE_FOLDER | ||
| from .canvas_api import setup_submissions_filepath, get_quiz_id_from_file_name, DateTimeEncoder | ||
| from .data_cleaner import keep_latest_survey_attempt | ||
| from .util import normalize | ||
| from .plots import set_plot_settings | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. it's dangerous to auto-format |
||
| from .reading_logs import ReadingLogsData | ||
| from .plots import set_plot_settings | ||
| from .util import normalize | ||
|
nononovia marked this conversation as resolved.
|
||
|
|
||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.