From 56b88f0c5a7297aef3636c0f69c31e1b3f7147ae Mon Sep 17 00:00:00 2001 From: bigJIU <1572204178@qq.com> Date: Thu, 3 Nov 2022 23:16:45 +0800 Subject: [PATCH] FIX Server Rep --- .idea/workspace.xml | 35 +++++++++++++++++++++++++++----- __pycache__/main.cpython-39.pyc | Bin 2915 -> 3067 bytes data/questionare.csv | 13 ++++++++++++ main.py | 12 +++++++++-- reps/127.0.0.1.txt | 0 reps/127.0.0.1lvl3066.txt | 0 reps/127.0.0.1lvl6966.txt | 1 + reps/127.0.0.1lvl7966.txt | 1 + templates/data.js | 2 +- 9 files changed, 56 insertions(+), 8 deletions(-) create mode 100644 reps/127.0.0.1.txt create mode 100644 reps/127.0.0.1lvl3066.txt create mode 100644 reps/127.0.0.1lvl6966.txt create mode 100644 reps/127.0.0.1lvl7966.txt diff --git a/.idea/workspace.xml b/.idea/workspace.xml index 44f6878..b218814 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -3,11 +3,9 @@ - - - + + + + + + + @@ -105,7 +114,7 @@ - + @@ -123,7 +132,23 @@ + + + + + file://$PROJECT_DIR$/main.py + 73 + + + file://$PROJECT_DIR$/main.py + 82 + + + + - + \ No newline at end of file diff --git a/__pycache__/main.cpython-39.pyc b/__pycache__/main.cpython-39.pyc index aa95f995171ac0be99260bdb090b1edf10d49f92..4e6a81438bcc0a5809ab361a9765e1aa65cc8218 100644 GIT binary patch delta 812 zcmX|;&rcIk5XaxV?(cR>DTTJQg@U3iA}T^6(RhI<2csmAn7n9eWj3{?i~71~VoFFX zdLxnS$s4_T()8lZ_&<26N8?pJwpCozKjh_v^>V->hA=ZHv)Z_`bRM`_L}! z%>iS`5SmP!co0A_Z*ngtVi2-eQ}I-xdYaHYUFe=649^rMFjsXgR8T$OBJRdIOe9bf zHtHgYh8RFoq}=$?AX;6(I41U42SnP9HwMwhBo5R#rVjQv4q`e=4MoL6RGh)#h-4x% zLL`g1hzv(0Ph=De5gCa{kw^*0B9e`^7{_D{XakOAoQQZX;*KQTZI}xy7!T917w47#`O0F!zA(^4*xv+oxUHQIF@VzU~`s)`oChEz5k9q>Ahf&(o`S!hh7(nWNv8X*$j; zbM4;xM)`Ktb0vL0JBC>~6>_EK`V)>NRSIM_G^Nnw$n=$Fz2*1S*0W}vT-|rQ;JscL zlMW>vMJC7zOS-L{rhg}_gnAzu!56(aev4AA3>n5PFu;N&WFQ?Xr3`Yu_eY-rxE~bE zJS+r@=4V(6ewjDbIa=TbSFEAQQ1y*U#jDo0E0qlg`YO7QcWO?luQXaux8=3qk+qt? zL}eo3zNj`=s(y8?>OYYMLh@?x)pAnvp$q-hdOt2V}3(m)j~;ty0Tf=wX>VL-y#w*=E{giWf@ zgB8+ip=JI7d(~qu_1J@df|uaUlLxO}yf{0D4!rNY`MmGUV`lype-#|haX3+<^<#Ip ze(F>Ymw^x@2m>ObnGPVJf;prF~tmKRpk&wR-1FmoX0tB&S_Fm zq=@sHPsSdrh@2WZNc@dehWKMfaPL;f-E zmDN)crs9c;(Ylf`=>x(Z4cFx3cwC2I;3H2g<0i3NNl$|JGJLt z;Qx+}Ibc11yx53`hFXNhNUBO^=6i3j@5`iBzCUCA(Ys-2N44~&xRJ|Nn_qO=TTi{Q z_e_D2{&&j30#5S~Hm9GgTL5kOHBo|={GK?6yYeG{VBA*b*YbkrDp5AGy4}EgJM4CM z8Za}^f3x3fRKh#*FW-b!`Oq%HntWw9+@>;ztw^G6;Ujrsudof3$_sndNu+=~mc_wT G{r>~fKai{d diff --git a/data/questionare.csv b/data/questionare.csv index 575e537..1d7b88f 100644 --- a/data/questionare.csv +++ b/data/questionare.csv @@ -9,3 +9,16 @@ IP,Style,Frequency,Age,Gender 127.0.0.1,B,B,E,A, 127.0.0.1,A,A,D,C, 127.0.0.1,A,A,A,C, +127.0.0.1,C,A,D,C, +127.0.0.1,D,A,A,C, +127.0.0.1,D,A,,B, +127.0.0.1,B,A,D,A, +127.0.0.1,A,A,C,A, +127.0.0.1,B,A,B,A, +127.0.0.1,B,A,C,A, +127.0.0.1,D,A,C,A, +127.0.0.1,D,A,C,A, +127.0.0.1,D,A,A,A, +127.0.0.1,C,E,A,B, +127.0.0.1,B,A,D,A, +127.0.0.1,A,A,A,B, diff --git a/main.py b/main.py index a4e983c..1f3d67d 100644 --- a/main.py +++ b/main.py @@ -1,3 +1,4 @@ +import json import os from IDManager import idManager @@ -70,9 +71,16 @@ def gameanno(id): def getJSONData(id): if request.method == 'POST': print("POST Game") - print(request.values) + print(request.form) + print(list(request.form)) + resultList = list(request.form)[0].split(",") + for i,j in request.form.items(): + print(i) + print(j) + + # FIXME: NOT SAVING! - saveFile(replayDataPath, request.json[4], request.json) + saveFile(replayDataPath, id+resultList[0] , str(resultList[1:])) return "get!" diff --git a/reps/127.0.0.1.txt b/reps/127.0.0.1.txt new file mode 100644 index 0000000..e69de29 diff --git a/reps/127.0.0.1lvl3066.txt b/reps/127.0.0.1lvl3066.txt new file mode 100644 index 0000000..e69de29 diff --git a/reps/127.0.0.1lvl6966.txt b/reps/127.0.0.1lvl6966.txt new file mode 100644 index 0000000..e1ac7ec --- /dev/null +++ b/reps/127.0.0.1lvl6966.txt @@ -0,0 +1 @@ +['0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '2', '2', '2', '2', '2', '2', '2', '2', '2', '2', '2', '2', '2'] \ No newline at end of file diff --git a/reps/127.0.0.1lvl7966.txt b/reps/127.0.0.1lvl7966.txt new file mode 100644 index 0000000..6d5db34 --- /dev/null +++ b/reps/127.0.0.1lvl7966.txt @@ -0,0 +1 @@ +['0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0'] \ No newline at end of file diff --git a/templates/data.js b/templates/data.js index 5a33160..95c0555 100644 --- a/templates/data.js +++ b/templates/data.js @@ -34,7 +34,7 @@ function PlayLevel(group, level){ return returnVal.then(function(){ console.log("the return val is ready"); console.log(returnVal.value); - PostToServer(window.location.href+"/data",returnVal.value); + PostToServer(window.location.href+"/data",group+returnVal.value); //Array.from() }); }