-
Notifications
You must be signed in to change notification settings - Fork 292
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
Development
: Add script to create large courses locally
#9252
Development
: Add script to create large courses locally
#9252
Conversation
WalkthroughThe changes introduce several new Python scripts and README.md files designed to automate the setup and management of educational courses, users, and programming exercises. These scripts facilitate tasks such as user creation, course establishment, user enrollment, and programming exercise management. Additionally, updates to existing scripts enhance type safety and clarity, while the README files provide detailed guidance on installation, configuration, and usage. Changes
Sequence Diagram(s)sequenceDiagram
participant Admin
participant MainScript
participant AuthService
participant UserService
participant CourseService
participant ExerciseService
Admin->>MainScript: Start Course Setup
MainScript->>AuthService: Authenticate Admin
AuthService-->>MainScript: Auth Success
MainScript->>UserService: Create Users
UserService-->>MainScript: Users Created
MainScript->>CourseService: Create Course
CourseService-->>MainScript: Course Created
MainScript->>UserService: Enroll Users
UserService-->>MainScript: Users Enrolled
MainScript->>ExerciseService: Create Programming Exercise
ExerciseService-->>MainScript: Exercise Created
MainScript->>UserService: Add Participation
UserService-->>MainScript: Participation Added
MainScript->>UserService: Commit Changes
UserService-->>MainScript: Changes Committed
Possibly related issues
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
Documentation and Community
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 30
...ripts/local-course-scripts/large-course-with-programming-exercise-sumbissions-setup/login.py
Outdated
Show resolved
Hide resolved
...ripts/local-course-scripts/large-course-with-programming-exercise-sumbissions-setup/login.py
Outdated
Show resolved
Hide resolved
...ripts/local-course-scripts/large-course-with-programming-exercise-sumbissions-setup/login.py
Outdated
Show resolved
Hide resolved
...ripts/local-course-scripts/large-course-with-programming-exercise-sumbissions-setup/login.py
Outdated
Show resolved
Hide resolved
...ripts/local-course-scripts/large-course-with-programming-exercise-sumbissions-setup/login.py
Outdated
Show resolved
Hide resolved
...cripts/local-course-scripts/large-course-with-programming-exercise-sumbissions-setup/Main.py
Outdated
Show resolved
Hide resolved
...cripts/local-course-scripts/large-course-with-programming-exercise-sumbissions-setup/Main.py
Outdated
Show resolved
Hide resolved
...cripts/local-course-scripts/large-course-with-programming-exercise-sumbissions-setup/Main.py
Outdated
Show resolved
Hide resolved
...ocal-course-scripts/large-course-with-programming-exercise-sumbissions-setup/createCourse.py
Outdated
Show resolved
Hide resolved
...ocal-course-scripts/large-course-with-programming-exercise-sumbissions-setup/createCourse.py
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 5
Outside diff range comments (1)
supporting_scripts/local-course-scripts/large-course-with-programming-exercise-sumbissions-setup/README.md (1)
Line range hint
22-74
: Add blank lines around headings, fix unordered list indentation issues, and remove trailing punctuation in headings.The section should be formatted correctly to improve readability. Remove trailing punctuation in headings.
Apply this diff to add blank lines around headings, fix unordered list indentation issues, and remove trailing punctuation in headings:
## Usage ### Running the Main Script -The main script orchestrates the entire process, from user creation to course setup, and finally user participation in programming exercises. To run the script: +The main script orchestrates the entire process, from user creation to course setup, and finally user participation in programming exercises. To run the script: -#### 1.Open the project in IntelliJ. -#### 2.Locate the main.py file in the project directory. -#### 3.Run main.py: +#### 1. Open the project in IntelliJ +#### 2. Locate the main.py file in the project directory +#### 3. Run main.py - You can use the play button within IntelliJ (if Python is configured properly) to run the script. - If you want to change the amount of students created, you can modify the `students` variable in the config.ini file. - If you want to change the amount of commits each student should perform in the example exercise, you can modify the `comments` variable in the config.ini file. - This will automatically perform all the necessary steps: + - You can use the play button within IntelliJ (if Python is configured properly) to run the script. + - If you want to change the number of students created, you can modify the `students` variable in the config.ini file. + - If you want to change the number of commits each student should perform in the example exercise, you can modify the `comments` variable in the config.ini file. + - This will automatically perform all the necessary steps: -1. Authenticate as admin. -2. Create users. -3. Create a course. -4. Add users to the course. -5. Create a programming exercise. -6. Add participation and commit for each user. + 1. Authenticate as admin. + 2. Create users. + 3. Create a course. + 4. Add users to the course. + 5. Create a programming exercise. + 6. Add participation and commit for each user.Tools
LanguageTool
[style] ~3-~3: Specify a number, remove phrase, or simply use “many” or “numerous”
Context: ...s or quickly initializing a course with a large number of students. ## Setup ### 1. Install Pyt...(LARGE_NUMBER_OF)
[typographical] ~11-~11: To join two clauses or introduce examples, consider using an em dash.
Context: ...Python support in IntelliJ: - Go toFile > Project Structure > Facets > Add - Python
. - Add a Python environment ...(DASH_RULE)
[typographical] ~13-~13: To join two clauses or introduce examples, consider using an em dash.
Context: ...d a module in IntelliJ by navigating toFile > Project Structure > Modules > Add - Python
. ### 2. Configure the Environme...(DASH_RULE)
[uncategorized] ~36-~36: ‘Amount of’ should usually only be used with uncountable or mass nouns. Consider using “number” if this is not the case.
Context: ...e script. - If you want to change the amount of students created, you can modify the...(AMOUNTOF_TO_NUMBEROF)
[style] ~38-~38: You have already used this phrasing in nearby sentences. Consider replacing it to add variety to your writing.
Context: ...able in the config.ini file. - If you want to change the amount of commits each stude...(REP_WANT_TO_VB)
Markdownlint
11-11: Expected: 2; Actual: 4
Unordered list indentation(MD007, ul-indent)
12-12: Expected: 2; Actual: 4
Unordered list indentation(MD007, ul-indent)
13-13: Expected: 2; Actual: 4
Unordered list indentation(MD007, ul-indent)
7-7: Expected: 1; Actual: 0; Below
Headings should be surrounded by blank lines(MD022, blanks-around-headings)
15-15: Expected: 1; Actual: 0; Below
Headings should be surrounded by blank lines(MD022, blanks-around-headings)
28-28: Punctuation: '.'
Trailing punctuation in heading(MD026, no-trailing-punctuation)
30-30: Punctuation: '.'
Trailing punctuation in heading(MD026, no-trailing-punctuation)
32-32: Punctuation: ':'
Trailing punctuation in heading(MD026, no-trailing-punctuation)
19-19: null
Fenced code blocks should be surrounded by blank lines(MD031, blanks-around-fences)
8-8: null
Lists should be surrounded by blank lines(MD032, blanks-around-lists)
16-16: null
Lists should be surrounded by blank lines(MD032, blanks-around-lists)
...ipts/local-course-scripts/large-course-with-programming-exercise-sumbissions-setup/README.md
Outdated
Show resolved
Hide resolved
...cripts/local-course-scripts/large-course-with-programming-exercise-sumbissions-setup/Main.py
Outdated
Show resolved
Hide resolved
...cripts/local-course-scripts/large-course-with-programming-exercise-sumbissions-setup/Main.py
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 4
...ipts/local-course-scripts/large-course-with-programming-exercise-sumbissions-setup/README.md
Outdated
Show resolved
Hide resolved
...ipts/local-course-scripts/large-course-with-programming-exercise-sumbissions-setup/README.md
Outdated
Show resolved
Hide resolved
...ipts/local-course-scripts/large-course-with-programming-exercise-sumbissions-setup/README.md
Outdated
Show resolved
Hide resolved
...ipts/local-course-scripts/large-course-with-programming-exercise-sumbissions-setup/README.md
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good overall, left two inline comments:
...cripts/local-course-scripts/large-course-with-programming-exercise-sumbissions-setup/Main.py
Outdated
Show resolved
Hide resolved
...al-course-scripts/large-course-with-programming-exercise-sumbissions-setup/deleteStudents.py
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Apart the from the mentioned unused import code lgtm
...al-course-scripts/large-course-with-programming-exercise-sumbissions-setup/deleteStudents.py
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Additionally:
- Add type hints at least to all functions (parameter and return type).
- Make the creation of a programming exercise (Step 5) optional, so that we can also use it on an existing programming exercise.
...cripts/local-course-scripts/large-course-with-programming-exercise-sumbissions-setup/Main.py
Outdated
Show resolved
Hide resolved
...al-course-scripts/large-course-with-programming-exercise-sumbissions-setup/createStudents.py
Outdated
Show resolved
Hide resolved
...cripts/local-course-scripts/large-course-with-programming-exercise-sumbissions-setup/Main.py
Outdated
Show resolved
Hide resolved
...ocal-course-scripts/large-course-with-programming-exercise-sumbissions-setup/createCourse.py
Outdated
Show resolved
Hide resolved
...ocal-course-scripts/large-course-with-programming-exercise-sumbissions-setup/createCourse.py
Outdated
Show resolved
Hide resolved
...cripts/local-course-scripts/large-course-with-programming-exercise-sumbissions-setup/Main.py
Outdated
Show resolved
Hide resolved
...cripts/large-course-with-programming-exercise-sumbissions-setup/manageProgrammingExercise.py
Outdated
Show resolved
Hide resolved
...cripts/local-course-scripts/large-course-with-programming-exercise-sumbissions-setup/Main.py
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 17
supporting_scripts/course-scripts/quick-course-setup/delete_students.py
Outdated
Show resolved
Hide resolved
supporting_scripts/course-scripts/quick-course-setup/manage_programming_exercise.py
Outdated
Show resolved
Hide resolved
supporting_scripts/course-scripts/quick-course-setup/manage_programming_exercise.py
Outdated
Show resolved
Hide resolved
supporting_scripts/course-scripts/quick-course-setup/large_course_main.py
Outdated
Show resolved
Hide resolved
supporting_scripts/course-scripts/quick-course-setup/large_course_main.py
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Really nice and helpful scripts 👍 I added two small suggestions
supporting_scripts/course-scripts/quick-course-setup/create_users.py
Outdated
Show resolved
Hide resolved
…-setup-with-programming-exercise-setup' into feature/general/add-large-course-setup-with-programming-exercise-setup
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 5
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested locally, all scripts work for me and the description seems clear and understandable to me
Thank you for taking the time for the adjustments! 🙏
What I tested
- setup as described
- executing all scripts
- course creation scripts work
- large course participation generation works
- deletion of users from participation generation does not interfere with other course settings
supporting_scripts/course-scripts/quick-course-setup/config.ini
Outdated
Show resolved
Hide resolved
e17b335
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Re-approve (test) after minor configuration changes since #9252 (review)
76813ba
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reapprove after minor changes since #9252 (review)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code lgtm, thanks for adding the suggestions 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for implementing the code changes 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reapprove Code 👍
General
: Add script to create large courses locallyDevelopment
: Add script to create large courses locally
Great addition, thank you. For a follow-up: can we also allow to create large courses on test servers? |
Checklist
General
Motivation and Context
Recently, new Performance Guidelines were introduced. To help developers adhere to these guidelines, this script allows them to locally create a large course with a significant number of students, student participations, and submissions. This enables developers to test their pull requests (PRs) with large datasets according to their specific needs.
Description
large_course_main.py allows you to run the script.
If you want to change the amount of students created, you can modify the
students
variable in the config.ini file.If you want to change the amount of commits each student should perform in the example exercise, you can modify the
commits
variable in the config.ini file.If you want to change the amount of programming exercises created, you can modify the
exercises
variable in the config.ini file.This will automatically perform all the necessary steps:
Authenticate as admin.
Create students.
Create a course.
Add users to the course.
Create a programming exercise.
Add participation and commit for each student.
The provided ReadMe can also be used to get further details if necessary.
Steps for Testing (This PR can only be tested locally)
Prerequisites:
Review Progress
Performance Review
Code Review
Manual Tests
Summary by CodeRabbit
Summary by CodeRabbit
New Features
Documentation