From 7906d7a9b9f32757cf164c68ba31f606e363cbf3 Mon Sep 17 00:00:00 2001 From: leo Date: Mon, 7 Mar 2022 21:09:41 -0800 Subject: [PATCH] Pre-demo prepwork. Format dates nicely, add two example submissions (#85) --- example/bad/bad.tar.gz | Bin 0 -> 454 bytes example/bad/main.go | 36 ++++++++++++++++++++++++++++++++ example/good/good.tar.gz | Bin 0 -> 451 bytes example/{ => good}/main.go | 0 example/grade_assignment_one.sh | 6 +++++- frontend/src/Assignment.tsx | 14 ++++++++++--- frontend/src/api.ts | 2 +- 7 files changed, 53 insertions(+), 5 deletions(-) create mode 100644 example/bad/bad.tar.gz create mode 100644 example/bad/main.go create mode 100644 example/good/good.tar.gz rename example/{ => good}/main.go (100%) diff --git a/example/bad/bad.tar.gz b/example/bad/bad.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..5190619f1b1c9d66682fae3f649666061351e4d3 GIT binary patch literal 454 zcmV;%0XhC3iwFP!000001MSjLYuhjo0ARmbzv8MV2aGGVP6`3e2vztxE>nqOJ z{CdrJ7FX(elL33vt`?II!U1GjzWfkg+y6(6qP-Wrgdx5Mgj`<2{v?J`ORyaX@YB~p zd9SR2V8KofS}nZ4AVdwLbpZ;J({2bf4%Vlu53aT5$1+u>kE<&}y2-S2jba7ANgkvR z$G8vM1}HD#)}BNOU%pFQLa*Y~>Uat9J37%1BF&U(t#h(X#bU|oQ_LQ;DV8$T=TWOr zJZ3I|mUMMs+q+mj7p^zckg73~s}8g@h4t0W^?n8Kfv299pc0PIz;YYaE?D&#dEhZu zo*zq)ZtnbrpjaaXT{K{np0np;>bHoiX+L)|OwPpFnZ(cBlt?)rns^s~G!1aZ=Knsu zU3vw#vQtKdbSgisyO-Z+OnC;Wy?iCS6G|`PB%Q)3%qQ@1_hC=x9@5gG-rl9^ls?aP w4f|mXzaBE2$=`l^5kd$dgb+dqA%qY@2qA 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 0000000000000000000000000000000000000000..f8a86e8cf5d37b222aecd1e5cdad23043a9f9009 GIT binary patch literal 451 zcmV;!0X+U6iwFP!000001MSjZYuhjo0C2xrpW><~2aIbqZVMS61e(W-zbci27D!qPY^{ zTCAI9onfSDZZfFfbgIP^qVxcnQ7_+w*Y^KYqdY#yUcrFx0b`e!usg|NGzwe?62kO# z&>?7NAv$oAhog}pTrj4G(fJ4k%Xv3Mj*AQF7@|Kq`(ruPw#Vp-v2L=*xks^r-z<+R z!~^cbrUfoaxN|32LWs_m@a4O5CG;8t&fp>9cl5F!WRzGIyH%gCa5T19I#i!Wqhs+@ zv;8H%Sz*>2J zC_(vo=ogZ(M@qVA!D=&C&&M=xfzh;|dle^d@$Ag-GY=(G&Br0$;g7ZjQP=Z-pI setShowUploadSubmissionModal(true)}> ➕ Add a submission - ) : ( - console.log("download")}> + ( navigate(`/results/${k.id}`)}> {data?.professor && {k.owner}} - {k.date} + + {new Date(Date.parse(k.date)).toLocaleString("en-us", { + year: "numeric", + weekday: "long", + day: "2-digit", + month: "2-digit", + hour: "2-digit", + minute: "2-digit", + })} + {k.pointsEarned} ))} diff --git a/frontend/src/api.ts b/frontend/src/api.ts index 92e1b60..dbbde5b 100644 --- a/frontend/src/api.ts +++ b/frontend/src/api.ts @@ -194,7 +194,7 @@ export interface AssignmentData { submissions: Array<{ id: string; owner: string; - date: Date; + date: string; pointsEarned: number; }>;