Giter Site home page Giter Site logo

classroom-grading-template's Introduction

介绍

该项目可用于快速部署一个 classroom 排行榜网站

其是根据 Github Classroom 里同学们的提交记录,结合 github pages 来生成一个排行网站,可以查看当前每一个作业的完成情况,搜索到自己和其他学生的排名,方便大家更快的了解到课堂的整体进度,提高同学们的参与度,督促自己的成长和进步。

shortcut

如何快速部署

1. Fork 项目

注意在 fork 时,需要将下面的 Owner 设置为 classroom 所在的组织下。

fork

2. 添加环境变量

由于 action 在部署执行过程中会获取作业的最新数据,而更新的方式需要调用 Github APIclassroom 的相关接口,因此需要配置以下两个变量获取访问接口的权限。

2.1 设置 AUTH_TOKEN

a. 首先获取组织中任意 Owner 成员的 Personal access tokens (详细参考)

pat

b. 回到项目 setting 中, 把上一步获取的 Personal access tokens 配置给 action 的环境变量 AUTH_TOKEN

pat

2.2 设置 SESSION_TOKEN

该变量的值是取登录到 classroom.github.com 网站中的 cookie._github_classroom_session 字段

pat

3 打开 workflow 开关

因为项目的 action 中有一个执行定时任务的 workflow, 需要手动开启。 该任务每小时会刷新一次排行榜数据。

fork

为什么需要手动打开 workflow

4. 配置 gh-pages

项目的 setting 中进行 pages 设置

fork

5. 修改配置

将 fork 的项目 clone 到本地,修改 classroom.config.json

    {
        "org": "组织-必填",
        "classrooms": [
            {
            "name": "教室名称-必填",
            "assignments": [ "作业一", "作业二" ],
            "studentBlacklist": ["黑名单"]
            }
        ],
        "website": {
            "title": "LOGO标题"
        }
    }

配置字段说明

字段 描述 类型 是否必填
org classroom 所在组织 string
classrooms 教室 类型[]
website 站点元信息 类型

classroom 字段类型

字段 描述 类型 是否必填
name 教室名称, 必须与实际信息一致,注意要求完整名称,包括 id,看下图说明 string
assignments 需要展示的作业排行榜,必须与实际信息一致 类型[]
studentBlacklist 黑名单,用于过滤不参加排名的的学生

assignment 字段类型

字段 描述 类型 是否必填
- 列出教室中参与排名的作业 string[] 或 Option[]

assignment 配置参数类型

类似于babel的插件化配置, 项目也支持对教室的 assignment 进行参数化配置。

比如目前项目支持按分支维度进行更细分地排行。

{
  "assignments": ["learning-rust", { "branches": ["lab0", "lab1"] }]
}
字段 描述 类型 是否必填
branches 列出仓库中参与排行的分支 string[]
... - - -

website 字段类型

字段 描述 是否必填
title 网站 logo 处名称
... 根据需要可后期开放其他字段 -

完整的 classroom 名称

config

部署

修改完配置后 push 到 main 分支,会自动触发执行 action,等待几分钟后,便可以访问自己的排行榜页面了。

同时该项目设置了定时更新数据任务,每小时会执行一次,执行结束后,自动刷新页面内容.

classroom-grading-template's People

Contributors

july-12 avatar yfblock avatar

Forkers

os-lecture

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.