diff --git a/example/bad/bad.tar.gz b/example/bad/bad.tar.gz new file mode 100644 index 0000000..5190619 Binary files /dev/null and b/example/bad/bad.tar.gz differ diff --git a/example/bad/main.go b/example/bad/main.go new file mode 100644 index 0000000..f09bb6e --- /dev/null +++ b/example/bad/main.go @@ -0,0 +1,36 @@ +package main + +// Example of a submission to our class! + +import ( + "fmt" + "os" + "strconv" + "strings" +) + +func main() { + test_str := "1, Doxa, Theo, gia, ola, ta, pragmata, incorrect" + fmt.Println(strings.Split(test_str, ",")[0:]) + + argnum := 0 + if len(os.Args) > 1 { + argnum, _ = strconv.Atoi(os.Args[1]) + _, err := strconv.Atoi(os.Args[1]) + if err != nil { + print(err) + return + } + } + + if a := argnum; a == 100 { + fmt.Println("2 Definition worked") + } else { + fmt.Println("2 Definition failed") + } + + text := "NAME" + if text[4:] == "" { + fmt.Println("3 Empty") + } +} diff --git a/example/good/good.tar.gz b/example/good/good.tar.gz new file mode 100644 index 0000000..f8a86e8 Binary files /dev/null and b/example/good/good.tar.gz differ diff --git a/example/main.go b/example/good/main.go similarity index 100% rename from example/main.go rename to example/good/main.go diff --git a/example/grade_assignment_one.sh b/example/grade_assignment_one.sh index 4c9561d..45a15a9 100755 --- a/example/grade_assignment_one.sh +++ b/example/grade_assignment_one.sh @@ -38,7 +38,7 @@ else fi # Pretending to do more work... -sleep 5 +sleep 1 OUTPUT_1="[1 Doxa ston Theo gia ola ta pragmata]" OUTPUT_2_WORKED="2 Definition worked" @@ -55,6 +55,8 @@ else echo "SCORE 0.2 0\n" fi +sleep 1 + echo "4" echo "HIDDEN" echo "NAME Correct output on failure" @@ -76,6 +78,8 @@ else echo "SCORE 0.2 0\n" fi +sleep 1 + echo "6" echo "NAME Empty substring" if [ "$(go run main.go | grep 3)" = "$OUTPUT_3" ]; then diff --git a/frontend/src/Assignment.tsx b/frontend/src/Assignment.tsx index 842f17e..9c84ba4 100644 --- a/frontend/src/Assignment.tsx +++ b/frontend/src/Assignment.tsx @@ -79,10 +79,9 @@ export default function Assignment() {