For classroom like GitHub #5091

Open
opened 2025-11-02 06:14:06 -06:00 by GiteaMirror · 30 comments
Owner

Originally created by @sycured on GitHub (Mar 20, 2020).

Hi,
Do you plan to permit an usage like https://classroom.github.com/ ?

It'll be very good to have the possibility to create assignments and students to have their repositories created automatically when applying to the assignment.

For doing this like action (ci/cd, whatever), just having a webhook auto-assigned is perfect.

Regards

Originally created by @sycured on GitHub (Mar 20, 2020). Hi, Do you plan to permit an usage like https://classroom.github.com/ ? It'll be very good to have the possibility to create assignments and students to have their repositories created automatically when applying to the assignment. For doing this like action (ci/cd, whatever), just having a webhook auto-assigned is perfect. Regards
GiteaMirror added the type/proposal label 2025-11-02 06:14:06 -06:00
Author
Owner

@lunny commented on GitHub (Mar 21, 2020):

Sounds interesting.

@lunny commented on GitHub (Mar 21, 2020): Sounds interesting.
Author
Owner

@lafriks commented on GitHub (Mar 21, 2020):

If you have used it, could you write up task list that need to be implemented in Gitea?

@lafriks commented on GitHub (Mar 21, 2020): If you have used it, could you write up task list that need to be implemented in Gitea?
Author
Owner
@sycured commented on GitHub (Mar 21, 2020): Hi, I took some screenshot when I created a classroom and look workflow for individual assignment: https://imgur.com/a/9ZdGkLB Links to examples about autograding: - https://github.com/education/autograding-example-java - https://github.com/education/autograding-example-node - https://github.com/education/autograding-example-python - https://github.com/education/autograding-example-c - https://github.com/education/autograding-example-cpp
Author
Owner

@lunny commented on GitHub (Mar 22, 2020):

I haven't used that but I think it should have the features.

  • A classroom could be binding to an organization.
  • Owners could create some assignments.
  • Owners could add students as members.
  • Students could view assignments and create a repository link to an assigment.
  • Students could pull and push codes from the assignment repository.
  • Owners could add review on the assignment repositories.

We could create three tables, classroom, assignment and student_assignment.

type Classroom struct {
    ID int64
    Name string
    OrgID int64
    StudentTeamID int64
    CreatorID int64
}

type Assignment struct {
    ID int64
    ClassroomID int64
    Name string
}

type StudentAssignment struct {
    ID int64
    AssignmentID int64
    StudentUserID int64
    RepoID int64
    Status AssignmentStatus
}
@lunny commented on GitHub (Mar 22, 2020): I haven't used that but I think it should have the features. - A classroom could be binding to an organization. - Owners could create some assignments. - Owners could add students as members. - Students could view assignments and create a repository link to an assigment. - Students could pull and push codes from the assignment repository. - Owners could add review on the assignment repositories. We could create three tables, `classroom`, `assignment` and `student_assignment`. ```go type Classroom struct { ID int64 Name string OrgID int64 StudentTeamID int64 CreatorID int64 } type Assignment struct { ID int64 ClassroomID int64 Name string } type StudentAssignment struct { ID int64 AssignmentID int64 StudentUserID int64 RepoID int64 Status AssignmentStatus } ```
Author
Owner

@sycured commented on GitHub (Mar 22, 2020):

I haven't used it, just created a classroom to take screenshots.

So yes, a classroom is owned by an organization.

About running test and autograding, I think that adding score to StudentAssignment and having an API endpoint for our CI/CD to update that score could be great.

Another big deal, it's implementing LTI (https://github.com/education/classroom/issues/2350 & http://www.imsglobal.org/activity/learning-tools-interoperability) this can be useful.

Another thing is Group Assignment: https://imgur.com/a/Z6MiMOq

@sycured commented on GitHub (Mar 22, 2020): I haven't used it, just created a classroom to take screenshots. So yes, a classroom is owned by an organization. About running test and autograding, I think that adding `score` to `StudentAssignment` and having an API endpoint for our CI/CD to update that score could be great. Another big deal, it's implementing LTI (https://github.com/education/classroom/issues/2350 & http://www.imsglobal.org/activity/learning-tools-interoperability) this can be useful. Another thing is Group Assignment: https://imgur.com/a/Z6MiMOq
Author
Owner

@lafriks commented on GitHub (Mar 22, 2020):

How are tests added for scoring?

@lafriks commented on GitHub (Mar 22, 2020): How are tests added for scoring?
Author
Owner

@lafriks commented on GitHub (Mar 22, 2020):

Also maybe this should be made as sepperate project and integrated in Gitea using API

@lafriks commented on GitHub (Mar 22, 2020): Also maybe this should be made as sepperate project and integrated in Gitea using API
Author
Owner

@sycured commented on GitHub (Mar 22, 2020):

On GitHub it's like using GitHub Actions to run tests...
But using CI/CD can be a lot better if we can interact like that:

student apply for assignment 1:

  1. create repo using our start repo (like a fork or better like a copy/fake fork)
  2. Add webhook to our CI/CD job
  3. When push on master -> send to CI/CD
    We run the job, take repository username/repositoryname, run test and when finished, curl -XPOST final score sur l'api de gitea
  4. If scoring is >= $requiredminimalscore, green, show score and repository locked to read-only
    If not, red show score and repository still open to push

Big problem, attach the score to each commit because it's the only way for students to look it and can read an automatic status about tests (comment inside commit)

We won't open CI/CD platform to students

@sycured commented on GitHub (Mar 22, 2020): On GitHub it's like using GitHub Actions to run tests... But using CI/CD can be a lot better if we can interact like that: student apply for assignment 1: 1. create repo using our start repo (like a fork or better like a copy/fake fork) 2. Add webhook to our CI/CD job 3. When push on master -> send to CI/CD We run the job, take repository username/repositoryname, run test and when finished, curl -XPOST final score sur l'api de gitea 4. If scoring is >= $requiredminimalscore, green, show score and repository locked to read-only If not, red show score and repository still open to push Big problem, attach the score to each commit because it's the only way for students to look it and can read an automatic status about tests (comment inside commit) We won't open CI/CD platform to students
Author
Owner

@lafriks commented on GitHub (Mar 22, 2020):

Yes but how to score as tests only have failed/success how to know how many tests there were and how much of them actually failed and how much there is in total

@lafriks commented on GitHub (Mar 22, 2020): Yes but how to score as tests only have failed/success how to know how many tests there were and how much of them actually failed and how much there is in total
Author
Owner

@sycured commented on GitHub (Mar 22, 2020):

In my case, it's one suitcase:
For examples:

  • Haskell: stack test
    Run 1500 tests across the project
    Process: git clone git@git.school.tld:students/assignmentrepo . and stack test

  • Python: pytest
    Run 250 tests across the project
    Process: git clone git@git.school.tld:students/assignmentrepo . and pytest

The output of each can be redirected to a file or just parsed and we had it to the commit as a comment.

For example if we hide all lines before 829, the end is clear: https://travis-ci.com/github/sycured/streaming_calc_haskell/jobs/298983826#L829

I've no failure in that example but it's very clear

@sycured commented on GitHub (Mar 22, 2020): In my case, it's one suitcase: For examples: - Haskell: `stack test` Run 1500 tests across the project Process: `git clone git@git.school.tld:students/assignmentrepo .` and `stack test` - Python: `pytest` Run 250 tests across the project Process: `git clone git@git.school.tld:students/assignmentrepo .` and `pytest` The output of each can be redirected to a file or just parsed and we had it to the commit as a comment. For example if we hide all lines before 829, the end is clear: https://travis-ci.com/github/sycured/streaming_calc_haskell/jobs/298983826#L829 I've no failure in that example but it's very clear
Author
Owner

@techknowlogick commented on GitHub (Mar 22, 2020):

As Gitea is not looking at building a CI itself, we do have a status API, and so this would be perfect for a separate application that reports status back to Gitea.

@techknowlogick commented on GitHub (Mar 22, 2020): As Gitea is not looking at building a CI itself, we do have a status API, and so this would be perfect for a separate application that reports status back to Gitea.
Author
Owner

@sycured commented on GitHub (Mar 22, 2020):

I take the example all time of using a CI/CD and push back to gitea, I use Zuul and DroneCI at this time so no problem if we can push back status, score and comment on the commit do the ping to CI/CD

@sycured commented on GitHub (Mar 22, 2020): I take the example all time of using a CI/CD and push back to gitea, I use Zuul and DroneCI at this time so no problem if we can push back status, score and comment on the commit do the ping to CI/CD
Author
Owner

@lafriks commented on GitHub (Mar 22, 2020):

Is tests and ci instructions saved in same student repo or it is pulled from somewhere else?

@lafriks commented on GitHub (Mar 22, 2020): Is tests and ci instructions saved in same student repo or it is pulled from somewhere else?
Author
Owner

@lafriks commented on GitHub (Mar 22, 2020):

If they are how to prevent student from changing them?

@lafriks commented on GitHub (Mar 22, 2020): If they are how to prevent student from changing them?
Author
Owner

@sycured commented on GitHub (Mar 22, 2020):

Impossible for student to see it, it's on server side ;)
we load a container image (podman) that students can't access

@sycured commented on GitHub (Mar 22, 2020): Impossible for student to see it, it's on server side ;) we load a container image (podman) that students can't access
Author
Owner

@lafriks commented on GitHub (Mar 22, 2020):

Ok but ci instructions like .travisci.yml or .drone.yml would still be in students git repo?

@lafriks commented on GitHub (Mar 22, 2020): Ok but ci instructions like .travisci.yml or .drone.yml would still be in students git repo?
Author
Owner

@sycured commented on GitHub (Mar 22, 2020):

Absolutely no because it's server side

@sycured commented on GitHub (Mar 22, 2020): Absolutely no because it's server side
Author
Owner

@lafriks commented on GitHub (Mar 22, 2020):

I'm just thinking how than travis gets instructions than as they need to be in git repo? 🤔

Sorry for so many questions, just trying to understand whole process

@lafriks commented on GitHub (Mar 22, 2020): I'm just thinking how than travis gets instructions than as they need to be in git repo? :thinking: Sorry for so many questions, just trying to understand whole process
Author
Owner

@sycured commented on GitHub (Mar 22, 2020):

I won't use Travis CI for this thing… We have a CI/CD like Jenkins/Bamboo where all instructions are saved server-side so no file in repository like CircleCI or Travis CI or DroneCI

It's the same thing about Classroom for GitHub where they ask for a repository including all the tests scripts and process:

Excepted that you're not implementing a CI/CD in gitea, it's better to use our solution

@sycured commented on GitHub (Mar 22, 2020): I won't use Travis CI for this thing… We have a CI/CD like Jenkins/Bamboo where all instructions are saved server-side so no file in repository like CircleCI or Travis CI or DroneCI It's the same thing about Classroom for GitHub where they ask for a repository including all the tests scripts and process: - https://github.com/education/autograding-example-java - https://github.com/education/autograding-example-node - https://github.com/education/autograding-example-python - https://github.com/education/autograding-example-c - https://github.com/education/autograding-example-cpp Excepted that you're not implementing a CI/CD in gitea, it's better to use our solution
Author
Owner

@lafriks commented on GitHub (Mar 22, 2020):

Ok, than we need to think out a way how to use drone ci for this

@lafriks commented on GitHub (Mar 22, 2020): Ok, than we need to think out a way how to use drone ci for this
Author
Owner

@sycured commented on GitHub (Mar 22, 2020):

why not considering it like a webhook and students can't modify/change it ?

@sycured commented on GitHub (Mar 22, 2020): why not considering it like a webhook and students can't modify/change it ?
Author
Owner

@lafriks commented on GitHub (Mar 22, 2020):

Webhook itself is not the problem, problem is that at least Drone CI supports repository instructions to be in repository as file.
btw does students need to submit their task as PR or just as commits?

@lafriks commented on GitHub (Mar 22, 2020): Webhook itself is not the problem, problem is that at least Drone CI supports repository instructions to be in repository as file. btw does students need to submit their task as PR or just as commits?
Author
Owner

@sycured commented on GitHub (Mar 22, 2020):

They commit on their repositories, nothing more.

For Drone and similar, I think, we need like GitHub:

  • 1 repo that is the base repo for student repo
  • 1 repo used by CI/CD to pull tests/process

Workflow:

  1. Instance a docker
  2. git pull git@git.school.tld:organization(or classroom)/repotest-for-assignment1 .
  3. rm -rf .git
  4. git pull git@git.school.tld:stduentid/assignment1 .
  5. Launch test
@sycured commented on GitHub (Mar 22, 2020): They commit on their repositories, nothing more. For Drone and similar, I think, we need like GitHub: - 1 repo that is the base repo for student repo - 1 repo used by CI/CD to pull tests/process Workflow: 1. Instance a docker 2. `git pull git@git.school.tld:organization(or classroom)/repotest-for-assignment1 .` 3. `rm -rf .git` 4. `git pull git@git.school.tld:stduentid/assignment1 .` 3. Launch test
Author
Owner

@techknowlogick commented on GitHub (Mar 22, 2020):

If you don't want them to edit webhooks you could use global webhooks and connect that to whichever CI system you use, that allows them to have full admin over their repo w/o being able to edit webhooks.

@techknowlogick commented on GitHub (Mar 22, 2020): If you don't want them to edit webhooks you could use global webhooks and connect that to whichever CI system you use, that allows them to have full admin over their repo w/o being able to edit webhooks.
Author
Owner

@lafriks commented on GitHub (Mar 22, 2020):

I don't think students need to have admin rights over repo. They should have only write rights, so that they can not mess with automation and integration processes. Anyway for drone ci integration to work only way is to have .drone.yml file in repository IMHO. We could probably implement branch protection to have wilcard filter field to not allow editing files that match that filter.

@lafriks commented on GitHub (Mar 22, 2020): I don't think students need to have admin rights over repo. They should have only write rights, so that they can not mess with automation and integration processes. Anyway for drone ci integration to work only way is to have `.drone.yml` file in repository IMHO. We could probably implement branch protection to have wilcard filter field to not allow editing files that match that filter.
Author
Owner

@sycured commented on GitHub (Mar 23, 2020):

I don't think students need to have admin rights over repo.

The only way is the possibility for the classroom/organization to create repository for their students inside classroom's/organization's repositories and not anymore inside student's repositories.

What's the best way?
Because the most safe is a repository owned by classroom/organization and adding student as contributor.

IRL: student's code sent for assignment still is owned by student so it's better to have the reposity in student's repositories

Big question for student side: how can we remove full owner rights on the repository inside their account?

@sycured commented on GitHub (Mar 23, 2020): > I don't think students need to have admin rights over repo. The only way is the possibility for the classroom/organization to create repository for their students inside classroom's/organization's repositories and not anymore inside student's repositories. What's the best way? Because the most safe is a repository owned by classroom/organization and adding student as contributor. IRL: student's code sent for assignment still is owned by student so it's better to have the reposity in student's repositories Big question for student side: how can we remove full owner rights on the repository inside their account?
Author
Owner

@lafriks commented on GitHub (Mar 23, 2020):

We could probably work something out for this like adding field for custom admin user for user repository

@lafriks commented on GitHub (Mar 23, 2020): We could probably work something out for this like adding field for custom admin user for user repository
Author
Owner

@lafriks commented on GitHub (Mar 23, 2020):

Ok, I have implemented protected file patter option in branch protection in PR #10806

@lafriks commented on GitHub (Mar 23, 2020): Ok, I have implemented protected file patter option in branch protection in PR #10806
Author
Owner

@sycured commented on GitHub (Jun 18, 2020):

Any ETA?

@sycured commented on GitHub (Jun 18, 2020): Any ETA?
Author
Owner

@lafriks commented on GitHub (Jun 18, 2020):

I have started prototype but no eta at the moment

@lafriks commented on GitHub (Jun 18, 2020): I have started prototype but no eta at the moment
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#5091