FIX Server Rep

This commit is contained in:
bigJIU 2022-11-03 23:16:45 +08:00
parent 619fd535f2
commit 56b88f0c5a
9 changed files with 56 additions and 8 deletions

35
.idea/workspace.xml generated
View File

@ -3,11 +3,9 @@
<component name="ChangeListManager"> <component name="ChangeListManager">
<list default="true" id="c32bfd4e-6189-47f3-9d6c-c1825d3d7e5f" name="Changes" comment=""> <list default="true" id="c32bfd4e-6189-47f3-9d6c-c1825d3d7e5f" name="Changes" comment="">
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" /> <change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/IDManager.py" beforeDir="false" afterPath="$PROJECT_DIR$/IDManager.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/data/questionare.csv" beforeDir="false" afterPath="$PROJECT_DIR$/data/questionare.csv" afterDir="false" /> <change beforePath="$PROJECT_DIR$/data/questionare.csv" beforeDir="false" afterPath="$PROJECT_DIR$/data/questionare.csv" afterDir="false" />
<change beforePath="$PROJECT_DIR$/main.py" beforeDir="false" afterPath="$PROJECT_DIR$/main.py" afterDir="false" /> <change beforePath="$PROJECT_DIR$/main.py" beforeDir="false" afterPath="$PROJECT_DIR$/main.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/templates/GameAnnotation.html" beforeDir="false" afterPath="$PROJECT_DIR$/templates/GameAnnotation.html" afterDir="false" /> <change beforePath="$PROJECT_DIR$/templates/data.js" beforeDir="false" afterPath="$PROJECT_DIR$/templates/data.js" afterDir="false" />
<change beforePath="$PROJECT_DIR$/templates/GameQuestion.html" beforeDir="false" afterPath="$PROJECT_DIR$/templates/GameQuestion.html" afterDir="false" />
</list> </list>
<option name="SHOW_DIALOG" value="false" /> <option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" /> <option name="HIGHLIGHT_CONFLICTS" value="true" />
@ -21,6 +19,17 @@
</list> </list>
</option> </option>
</component> </component>
<component name="FlaskConsoleOptions" custom-start-script="import sys&#10;sys.path.extend([WORKING_DIR_AND_PYTHON_PATHS])&#10;from flask.cli import ScriptInfo&#10;locals().update(ScriptInfo(create_app=None).load_app().make_shell_context())&#10;print(&quot;Python %s on %s\nApp: %s [%s]\nInstance: %s&quot; % (sys.version, sys.platform, app.import_name, app.env, app.instance_path))">
<envs>
<env key="FLASK_APP" value="app" />
</envs>
<option name="myCustomStartScript" value="import sys&#10;sys.path.extend([WORKING_DIR_AND_PYTHON_PATHS])&#10;from flask.cli import ScriptInfo&#10;locals().update(ScriptInfo(create_app=None).load_app().make_shell_context())&#10;print(&quot;Python %s on %s\nApp: %s [%s]\nInstance: %s&quot; % (sys.version, sys.platform, app.import_name, app.env, app.instance_path))" />
<option name="myEnvs">
<map>
<entry key="FLASK_APP" value="app" />
</map>
</option>
</component>
<component name="Git.Settings"> <component name="Git.Settings">
<option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$" /> <option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$" />
</component> </component>
@ -105,7 +114,7 @@
<workItem from="1666752468427" duration="1563000" /> <workItem from="1666752468427" duration="1563000" />
<workItem from="1667205217155" duration="3357000" /> <workItem from="1667205217155" duration="3357000" />
<workItem from="1667357110859" duration="5735000" /> <workItem from="1667357110859" duration="5735000" />
<workItem from="1667456828218" duration="19880000" /> <workItem from="1667456828218" duration="21349000" />
</task> </task>
<servers /> <servers />
</component> </component>
@ -123,7 +132,23 @@
</map> </map>
</option> </option>
</component> </component>
<component name="XDebuggerManager">
<breakpoint-manager>
<breakpoints>
<line-breakpoint enabled="true" suspend="THREAD" type="python-line">
<url>file://$PROJECT_DIR$/main.py</url>
<line>73</line>
<option name="timeStamp" value="1" />
</line-breakpoint>
<line-breakpoint enabled="true" suspend="THREAD" type="python-line">
<url>file://$PROJECT_DIR$/main.py</url>
<line>82</line>
<option name="timeStamp" value="3" />
</line-breakpoint>
</breakpoints>
</breakpoint-manager>
</component>
<component name="com.intellij.coverage.CoverageDataManagerImpl"> <component name="com.intellij.coverage.CoverageDataManagerImpl">
<SUITE FILE_PATH="coverage/MarioWeb$Flask__main_py_.coverage" NAME="Flask (main.py) Coverage Results" MODIFIED="1667486951241" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="coverage.py" COVERAGE_BY_TEST_ENABLED="true" COVERAGE_TRACING_ENABLED="false" WORKING_DIRECTORY="" /> <SUITE FILE_PATH="coverage/MarioWeb$Flask__main_py_.coverage" NAME="Flask (main.py) Coverage Results" MODIFIED="1667488394064" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="coverage.py" COVERAGE_BY_TEST_ENABLED="true" COVERAGE_TRACING_ENABLED="false" WORKING_DIRECTORY="" />
</component> </component>
</project> </project>

Binary file not shown.

View File

@ -9,3 +9,16 @@ IP,Style,Frequency,Age,Gender
127.0.0.1,B,B,E,A, 127.0.0.1,B,B,E,A,
127.0.0.1,A,A,D,C, 127.0.0.1,A,A,D,C,
127.0.0.1,A,A,A,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,

1 IP,Style,Frequency,Age,Gender
9 127.0.0.1,B,B,E,A,
10 127.0.0.1,A,A,D,C,
11 127.0.0.1,A,A,A,C,
12 127.0.0.1,C,A,D,C,
13 127.0.0.1,D,A,A,C,
14 127.0.0.1,D,A,,B,
15 127.0.0.1,B,A,D,A,
16 127.0.0.1,A,A,C,A,
17 127.0.0.1,B,A,B,A,
18 127.0.0.1,B,A,C,A,
19 127.0.0.1,D,A,C,A,
20 127.0.0.1,D,A,C,A,
21 127.0.0.1,D,A,A,A,
22 127.0.0.1,C,E,A,B,
23 127.0.0.1,B,A,D,A,
24 127.0.0.1,A,A,A,B,

12
main.py
View File

@ -1,3 +1,4 @@
import json
import os import os
from IDManager import idManager from IDManager import idManager
@ -70,9 +71,16 @@ def gameanno(id):
def getJSONData(id): def getJSONData(id):
if request.method == 'POST': if request.method == 'POST':
print("POST Game") 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! # FIXME: NOT SAVING!
saveFile(replayDataPath, request.json[4], request.json) saveFile(replayDataPath, id+resultList[0] , str(resultList[1:]))
return "get!" return "get!"

0
reps/127.0.0.1.txt Normal file
View File

View File

View File

@ -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']

View File

@ -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']

View File

@ -34,7 +34,7 @@ function PlayLevel(group, level){
return returnVal.then(function(){ return returnVal.then(function(){
console.log("the return val is ready"); console.log("the return val is ready");
console.log(returnVal.value); console.log(returnVal.value);
PostToServer(window.location.href+"/data",returnVal.value); PostToServer(window.location.href+"/data",group+returnVal.value);
//Array.from() //Array.from()
}); });
} }