autograde

package
v0.0.0-...-d3289b9 Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2022 License: BSD-3-Clause Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ENDPOINT = "http://ec2-3-92-132-35.compute-1.amazonaws.com"
)

Functions

func AddTestCase

func AddTestCase(file string, args []string) error

AddTestCase: adds a test case to the end of the file

func CommentPreprocessing

func CommentPreprocessing(original string) string

CommentPreprocessing: eliminates single-line & multi-line comments

func CreatePyFile

func CreatePyFile(code, filename string) string

CreatePyFile: creates a temp python file

func RemovePyFile

func RemovePyFile(filename string)

RemovePyFile: remove python file

func RunCode

func RunCode(file, validate string) (string, bool)

RunCode: run a python file in golang

Types

type Question

type Question struct {
	Qid        string `json:"qid"`
	Code       string `json:"code"`
	Constraint string `json:"constraint"`
}

type Ret

type Ret struct {
	NameCorrect bool     `json:"namecorrect"` // if function name is correct
	Output      []string `json:"output"`      // output[i: i in range(tests)]
	Pass        []bool   `json:"pass"`        // pass[i: i in range(tests)]
	Constraint  bool     `json:"constraint"`
}

func FullGrade

func FullGrade(q Question) Ret

FullGrade: does all the autograde stuff

Jump to

Keyboard shortcuts

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