split checker from token-validator
This commit is contained in:
parent
685dc0b0ea
commit
0c661f36f6
20 changed files with 634 additions and 748 deletions
|
@ -2,6 +2,8 @@ package main
|
|||
|
||||
import (
|
||||
"github.com/julienschmidt/httprouter"
|
||||
|
||||
"git.nemunai.re/lectures/adlin/libadlin"
|
||||
)
|
||||
|
||||
func init() {
|
||||
|
@ -9,7 +11,7 @@ func init() {
|
|||
}
|
||||
|
||||
func computeGrades(_ httprouter.Params, _ []byte) (interface{}, error) {
|
||||
if stds, err := getStudents(); err != nil {
|
||||
if stds, err := adlin.GetStudents(); err != nil {
|
||||
return nil, err
|
||||
} else {
|
||||
res := map[string]map[string]float32{}
|
||||
|
@ -20,7 +22,7 @@ func computeGrades(_ httprouter.Params, _ []byte) (interface{}, error) {
|
|||
"TP2": 0,
|
||||
}
|
||||
|
||||
if states, err := std.getStatesByChallenge(); err != nil {
|
||||
if states, err := std.GetStatesByChallenge(); err != nil {
|
||||
return nil, err
|
||||
} else {
|
||||
for _, st := range states {
|
||||
|
|
Reference in a new issue