Skip to main content

Create a group assignment

You can create a collaborative assignment for teams of students who participate in your course.

Who can use this feature

Organization owners who are admins for a classroom can create and manage group assignments for a classroom. 有关教室管理员的详细信息,请参阅“关于教室管理”。

About group assignments

小组作业是在 GitHub Classroom 为学生组提供的合作课程。 Students can work together on a group assignment in a shared repository, like a team of professional developers.

When a student accepts a group assignment, the student can create a new team or join an existing team. GitHub Classroom saves the teams for an assignment as a set. You can name the set of teams for a specific assignment when you create the assignment, and you can reuse that set of teams for a later assignment.

对于每个组的作业,GitHub Classroom 自动为团队创建一个单独的共享仓库进行访问。 这个仓库可以是空的,您也可以从模板仓库创建这个仓库,加入启动代码、文档、测试和其他资源。 仓库属于您在 GitHub 上的组织帐户,GitHub Classroom 授予学生在接受作业时创建或加入的团队访问权限。

每项作业都有标题和可选的截止日期。 您可以选择 GitHub Classroom 创建的仓库的可见性,并选择访问权限。 您还可以对作业自动评分,并创建专用空间与学生讨论作业。

You can decide how many teams one assignment can have, and how many members each team can have. Each team that a student creates for an assignment is a team within your organization on GitHub. The visibility of the team is secret. Teams that you create on GitHub will not appear in GitHub Classroom. For more information, see "About teams."

For a video demonstration of the creation of a group assignment, see "Basics of setting up GitHub Classroom."

你可以在你拥有管理员访问权限的任何其他教室(包括不同组织中的教室)中重用现有作业。 有关详细信息,请参阅“重用作业”。

Prerequisites

您必须先创建一个课堂才能创建作业。 有关详细信息,请参阅“管理教室”。

Creating an assignment

  1. 登录 GitHub Classroom
  2. 导航到教室。
  3. “作业”选项卡中,创建作业。
    • 如果这是你的首个作业,请单击“创建作业”。 创建你的首个作业
    • 否则,单击“新建作业”。 “新建作业”按钮

Setting up the basics for an assignment

Name your assignment, decide whether to assign a deadline, define teams, and choose the visibility of assignment repositories.

Naming an assignment

For a group assignment, GitHub Classroom names repositories by the repository prefix and the name of the team. By default, the repository prefix is the assignment title. For example, if you name an assignment "assignment-1" and the team's name on GitHub is "student-team", the name of the assignment repository for members of the team will be assignment-1-student-team.

输入作业的标题。 (可选)单击 以编辑前缀。

Assignment title and prefix

Assigning a deadline for an assignment

(可选)您可以为作业分配一个截止日期。 在“Deadline (optional)(截止日期 [可选])”下,单击文本字段,然后使用日期选择器指定截止日期。

Date picker for assignment deadline

Choosing an assignment type

Under "Individual or group assignment", select the drop-down menu, then click Group assignment. You can't change the assignment type after you create the assignment. If you'd rather create an individual assignment, see "Create an individual assignment."

Defining teams for an assignment

If you've already created a group assignment for the classroom, you can reuse a set of teams for the new assignment. To create a new set with the teams that your students create for the assignment, type the name for the set. Optionally, type the maximum number of team members and total teams.

Tips:

  • We recommend including details about the set of teams in the name for the set. For example, if you want to use the set of teams for one assignment, name the set after the assignment. If you want to reuse the set throughout a semester or course, name the set after the semester or course.

  • If you'd like to assign students to a specific team, give your students a name for the team and provide a list of members.

Parameters for the teams participating in a group assignment

Choosing a visibility for assignment repositories

作业的仓库可以是公开或私有的。 如果您使用私有仓库,只有学生或团队可以查看您提供的反馈。

您也可以决定是否授予学生对作业仓库的管理员权限。 如果学生应该能够执行作业仓库的管理任务,则授予管理员权限。 有关详细信息,请参阅“关于存储库”和“组织的存储库角色”。

在“Repository visibility(仓库可见性)”下,选择可见性。 (可选)选择“授予学生对其存储库的管理员权限”。

Visibility options for assignment repositories

完成后,单击“继续”以配置起始代码和作业的开发环境。

'Continue' button

Adding starter code and configuring a development environment

(可选)决定是提供空仓库还是启动代码,并为您的学生预配置开发环境。

Choosing a template repository

By default, a new assignment will create an empty repository for each team that a student creates. 您可以选择一个模板仓库作为作业的启动代码。 有关模板存储库的详细信息,请参阅“创建模板存储库”。

注意:模板存储库必须属于组织或是在 GitHub 上的公共存储库。

在“添加模板存储库,以为学生提供起始代码”下,选择“选择存储库”下拉菜单,然后键入搜索查询。 在结果列表中,单击您想要用于启动代码的模板仓库。

Using the 'Select a repository' drop-down menu to find a template repository to use as starter code for an assignment

Choosing an integrated development environment (IDE)

您可以选择性地配置作业来使用集成开发环境 (IDE)。 IDE 允许您的学生编写代码、运行程序和协作, 而无需在学生的计算机上安装 Git 和完整的开发工具链。 如果您为作业选择 IDE,学生仍然可以在本地查看并使用必要软件在计算机上运行代码。 For more information, see "Integrate GitHub Classroom with an IDE."

可选择使用 GitHub Codespaces} 配置作业,以便学生通过一键式设置访问基于浏览器的 Visual Studio Code 环境。 有关详细信息,请参阅“将 GitHub Codespaces 与 GitHub Classroom 配合使用”。

要为作业选择 IDE,请选择 Add an editor(添加编辑器)下拉菜单,然后单击您希望学生使用的 IDE。

Using the 'Select an online IDE' drop-down menu to click an online IDE for the assignment

完成后,单击“继续”为项目配置自动评分和反馈。

'Continue' button

Providing feedback

Optionally, you can automatically grade assignments and create a space for discussing each submission with the team.

Testing assignments automatically

You can use autograding to automatically check a student's work for an assignment on GitHub Classroom. You configure tests for an assignment, and the tests run immediately every time a student pushes to an assignment repository on GitHub.com. The student can view the test results, make changes, and push to see new results. 有关详细信息,请参阅“使用自动升级”。

在“添加自动评分测试”下,选择“添加测试”下拉菜单,然后单击想要使用的评分方法。 有关详细信息,请参阅“分级方法”。

Using the 'Add test' drop-down menu to click a grading method

定义测试案例的参数,如名称、命令、输入、输出、超时和点。 完成后,单击“保存测试用例”。

'Save test case' button for an autograding test

你可以在“添加测试”下拉菜单中添加更多测试,并且可通过 编辑或删除现有测试。

Pencil and trash icons to edit or delete an autograding test

Creating a pull request for feedback

您可以自动创建拉取请求,以在其中提供反馈并回答学生有关作业的问题。 有关拉取请求中更改的审阅的详细信息,请参阅“审阅拉取请求中的更改”。

要创建拉取请求以就反馈进行讨论,请选择“启用反馈拉取请求”。

Checkbox for 'Enable feedback pull requests'

若要创建分配,请单击“创建分配”。

'Create assignment' button

Inviting students to an assignment

默认情况下, GitHub Classroom 会为您创建的每个作业启用邀请 URL。 当邀请 URL 启用时,学生可以接受并提交作业。 您可以在 LMS、课程主页或您发布作业的任何地方与您的学生分享 URL。 如果学生已接受课堂作业,学生也可以在 GitHub Classroom 上导航到作业。

警告:请注意共享邀请 URL 的位置。 任何拥有作业邀请 URL 的人都可以接受邀请并将 GitHub 上的个人帐户与你的名册中的标识符相关联。

You can see the teams that are working on or have submitted an assignment in the Teams tab for the assignment. 若要防止学生接受或提交作业,可以在“编辑作业”视图中更改“作业状态”。 当作业处于“活动”状态时,学生将能够使用邀请链接接受该作业。 当它处于“非活动”状态时,此链接将不再有效。

Group assignment

Monitoring students' progress

The assignment overview page displays information about your assignment acceptances and team progress. You may have different summary information based on the configurations of your assignments.

  • Total teams: The number of teams that have been created.
  • Rostered students: The number of students on the Classroom's roster.
  • Students not on a team: The number of students on the Classroom roster who have not yet joined a team.
  • Accepted teams: The number of teams who have accepted this assignment.
  • Assignment submissions: The number of teams that have submitted the assignment. Submission is triggered at the assignment deadline.
  • Passing teams: The number of teams that are currently passing the autograding tests for this assignment.

Next steps

  • After you create the assignment and your students form teams, team members can start work on the assignment using Git and GitHub's features. Students can clone the repository, push commits, manage branches, create and review pull requests, address merge conflicts, and discuss changes with issues. Both you and the team can review the commit history for the repository. For more information, see "Getting started with GitHub," "Repositories," "Using Git," and "Collaborating with issues and pull requests," and the free course on resolving merge conflicts from GitHub Skills.

  • When a team finishes an assignment, you can review the files in the repository, or you can review the history and visualizations for the repository to better understand how the team collaborated. For more information, see "Visualizing repository data with graphs."

  • You can provide feedback for an assignment by commenting on individual commits or lines in a pull request. For more information, see "Commenting on a pull request" and "Opening an issue from code." For more information about creating saved replies to provide feedback for common errors, see "About saved replies."

Further reading