robota_common_errors package¶
Subpackages¶
Submodules¶
robota_common_errors.analysis module¶
An example of a simple data analysis script that might be run on the JSON output of common_error_collection.py.
robota_common_errors.common_error_collection module¶
- class robota_common_errors.common_error_collection.CommonErrorReport(course: str, year: str, team_name: str, error_name: str, detail_titles: List[str], error_details: List[List[str]], num_occurrences: int)[source]¶
Bases:
object
- course: str¶
- detail_titles: List[str]¶
- error_details: List[List[str]]¶
- error_name: str¶
- num_occurrences: int¶
- team_name: str¶
- year: str¶
- robota_common_errors.common_error_collection.output_to_json(file_name: str, common_error_reports: List[CommonErrorReport])[source]¶
robota_common_errors.common_error_functions module¶
These functions specifically test the common errors.
- robota_common_errors.common_error_functions.commit_unnecessary_files(data_source: DataServer, common_error: CommonError) CommonError [source]¶
Certain files shouldn’t be committed to a Git repo, and should probably be specified in a .gitignore file
- robota_common_errors.common_error_functions.committing_comments(data_source: DataServer, common_error: CommonError) CommonError [source]¶
Students often commit commented out code which is bad. This function checks the diffs for any java style commenting syntax.
- robota_common_errors.common_error_functions.committing_conflict_markup(data_source: DataServer, common_error: CommonError) CommonError [source]¶
Conflicts should be resolved before committing. Any commit conflict markup which gets committed shows that the conflict has not been properly resolved.
- robota_common_errors.common_error_functions.confusing_branch_names(data_source: DataServer, common_error: CommonError) CommonError [source]¶
Some branch names are obviously confusing and should be avoided. e.g. a local branch called origin/branch would have a remote tracking branch called origin/origin/branch
- robota_common_errors.common_error_functions.get_comment_line_number(diff, line_num_in_diff)[source]¶
Return starting line number of hunk which contains line_num_in_diff
- robota_common_errors.common_error_functions.get_commit_diffs(commits: List[Commit], data_source: DataServer) Dict[Commit, List[Diff]] [source]¶
Get the diffs for each commit in commits.
While it would be fewer API calls to do a diff of all commits at once, the API refuses to return the diff if it is too big. This means doing it one commit at a time is safer.
- robota_common_errors.common_error_functions.get_line_num_in_diff(diff_up_to_match: Diff, match: Match)[source]¶
Return line number in diff of a regex match object
- robota_common_errors.common_error_functions.get_subject_errors(message: str) List[str] [source]¶
Detect errors with the subject line of git commit messages.
- Parameters
message – Commit message
- Returns
List of detected problems.
- robota_common_errors.common_error_functions.good_commit_messages(data_source: DataServer, common_error: CommonError) CommonError [source]¶
Git commit messages should have a standardised formatting.
- robota_common_errors.common_error_functions.merge_remote_branch(data_source: DataServer, common_error: CommonError) CommonError [source]¶
Identify cases where students have merged a remote tracking branch. They should be pulling before making local commits or rebasing their local branch onto the remote branch.
- robota_common_errors.common_error_functions.repeated_revert(data_source: DataServer, common_error: CommonError) CommonError [source]¶
Identify cases where students have repeatedly attempted to revert commits. This is often because they think that a commit revert is like an undo command.
- robota_common_errors.common_error_functions.wrong_use_of_estimate(data_source: DataServer, common_error: CommonError) CommonError [source]¶
Identify cases where students have misused the /estimate command when trying to record time estimates for a gitlab issue.
- robota_common_errors.common_error_functions.wrong_use_of_spend(data_source: DataServer, common_error: CommonError) CommonError [source]¶
Identify cases where students have misused the /spend command when trying to record time spent working on a gitlab issue.
- robota_common_errors.common_error_functions.wrong_way_merge(data_source: DataServer, common_error: CommonError) CommonError [source]¶
Identify cases where students have merged develop into their feature branch rather than the feature branch into master.
robota_common_errors.common_errors module¶
Common errors are suboptimal student behaviors that occur regularly. If a common error is identified, feedback is given on how to correct it or avoid it in future.
Common errors are much like Tasks except they are not assigned any credit.
- class robota_common_errors.common_errors.CommonError(common_error: dict)[source]¶
Bases:
object
Representation of a common error that could be identified
- Variables
name – The name of the common error.
marking_function – The name of the function used to assess the common error.
description – A textual description of the common error.
detail_titles – Titles of a table to be printed on the marking report.
error_details – Rows of a table to be printed on the marking report.
- robota_common_errors.common_errors.assess_common_errors(data_source: DataServer, common_errors: List[CommonError]) List[CommonError] [source]¶
Go through all of the possible common errors, running the assessment function for each one.
- robota_common_errors.common_errors.get_error_descriptions(robota_config: dict) List[CommonError] [source]¶
Get the textual description of common errors to identify.
- robota_common_errors.common_errors.validate_data_sources(data_source: DataServer, common_error: CommonError)[source]¶
Check the data sources that are available from the DataServer.
robota_common_errors.report module¶
Generates a HTML report of common errors for a git repo.
- robota_common_errors.report.count_errors(common_errors: List[CommonError]) int [source]¶
Count how many different common error types were detected.
- robota_common_errors.report.identify_common_errors(robota_config: dict, start: datetime, end: datetime) List[CommonError] [source]¶
The main function which gets the common errors.
- robota_common_errors.report.output_html_report(common_errors: List[CommonError], data_source_info: dict, common_error_summary: dict, output_dir: str)[source]¶
- robota_common_errors.report.run_html_error_report(start: str, end: str, config_path: str, output_dir: str, substitution_variables: dict)[source]¶
Get common errors and output them in the form of a HTML report.
- robota_common_errors.report.summarise_common_errors(common_errors: List[CommonError])[source]¶
- robota_common_errors.report.summarise_data_sources(robota_config: dict, start: datetime, end: datetime) dict [source]¶
- robota_common_errors.report.update_template(common_errors: List[CommonError], data_source_info: dict, common_error_summary: dict)[source]¶
Produce the HTML report by writing the marking results to a HTML template.
- Parameters
common_errors – A list of common errors and feedback on them.
data_source_info – A dictionary of information about the data sources that were used.
common_error_summary – A dictionary of stats about the common errors that is printed in the report.