short

package
v0.6.6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 6, 2024 License: AGPL-3.0 Imports: 15 Imported by: 0

Documentation

Overview

short provides the core functionality for managing and grading coding modules. It handles initialization, grading, result uploading, and module lifecycle management.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EndModule

func EndModule(module Module.Module, config Config) (err error)

EndModule grades all repositories in a module and removes write access for all participants.

  • module: the module object containing the exercises
  • config: the configuration object containing participants' information

func GradeModule

func GradeModule(module Module.Module, repoID string, updateDatabase bool) (err error)

GradeModule grades the exercises in a module for a specific student repository.

  • module: the module object containing the exercises
  • repoID: the ID of the student's repository

Returns an error if the grading process fails.

func StartModule

func StartModule(module Module.Module, config Config) (err error)

StartModule creates a new repository for each participant, gives them write access, and uploads the module's subject to the repository.

  • module: the module object containing the exercises
  • config: the configuration object containing participants' information

Types

type Config

type Config struct {
	StartDate    time.Time
	EndDate      time.Time
	Participants []Participant
}

func GetConfig

func GetConfig() (*Config, error)

Reads the configuration from CONFIG_PATH.

Returns a Config object containing the information set in your json.

See https://github.com/42-Short/shortinette/README.md for details on .env configuration.

type Participant

type Participant struct {
	GithubUserName string
	IntraLogin     string
}

type Short

type Short struct {
	Name     string                   // Name is the display name of the Short.
	Modules  map[string]Module.Module // Modules is a map of module names to their corresponding Module structs.
	TestMode ITestMode.ITestMode      // TestMode determines how the submission testing will be triggered.
}

Short represents the main structure for managing a coding module, including the module's name, its exercises, and the test mode to use.

func NewShort

func NewShort(name string, modules map[string]Module.Module, testMode ITestMode.ITestMode) Short

NewShort returns a Short object, which serves as the wrapper for the entire Short configuration.

  • name: the display name of your Short
  • modules: a map of strings to Module.Module objects, used for quicker lookups during grading
  • testMode: a ITestMode object, determining how the submission testing will be triggered

func (*Short) Start added in v0.1.3

func (short *Short) Start()

func (*Short) StartModule added in v0.4.9

func (short *Short) StartModule(module string) (err error)

Start begins the module lifecycle by starting the module and running the test mode.

  • module: the name of the module to be started

Directories

Path Synopsis
Interface for creation of test modes, such as WebhookTestMode.
Interface for creation of test modes, such as WebhookTestMode.
webhook
webhook provides functionality to monitor GitHub webhook events and trigger grading of student submissions based on push events to the main branch.
webhook provides functionality to monitor GitHub webhook events and trigger grading of student submissions based on push events to the main branch.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL