Radio Done
This commit is contained in:
parent
f5563685b2
commit
0004823617
7
.idea/workspace.xml
generated
7
.idea/workspace.xml
generated
@ -2,12 +2,9 @@
|
|||||||
<project version="4">
|
<project version="4">
|
||||||
<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$/.gitignore" beforeDir="false" afterPath="$PROJECT_DIR$/.gitignore" afterDir="false" />
|
|
||||||
<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$/Mario-AI-Interface.jar.js" beforeDir="false" afterPath="$PROJECT_DIR$/Mario-AI-Interface.jar.js" afterDir="false" />
|
|
||||||
<change beforePath="$PROJECT_DIR$/Mario-AI-Interface/src/Play.java" beforeDir="false" afterPath="$PROJECT_DIR$/Mario-AI-Interface/src/Play.java" 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/play.html" beforeDir="false" afterPath="$PROJECT_DIR$/templates/play.html" afterDir="false" />
|
<change beforePath="$PROJECT_DIR$/templates/eval.html" beforeDir="false" afterPath="$PROJECT_DIR$/templates/eval.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" />
|
||||||
@ -108,6 +105,6 @@
|
|||||||
</option>
|
</option>
|
||||||
</component>
|
</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="1666606996030" 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="1666620093891" 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.
10
main.py
10
main.py
@ -21,7 +21,15 @@ def eval():
|
|||||||
|
|
||||||
|
|
||||||
@app.route('/', methods=['POST'])
|
@app.route('/', methods=['POST'])
|
||||||
def getData():
|
def getJSONData():
|
||||||
|
if request.method == 'POST':
|
||||||
|
print("POST")
|
||||||
|
print(request.json)
|
||||||
|
return redirect(url_for('datapage'))
|
||||||
|
|
||||||
|
|
||||||
|
@app.route('/', methods=['POST'])
|
||||||
|
def getRadioData():
|
||||||
if request.method == 'POST':
|
if request.method == 'POST':
|
||||||
print("POST")
|
print("POST")
|
||||||
print(request.json)
|
print(request.json)
|
||||||
|
@ -3,40 +3,171 @@
|
|||||||
<head>
|
<head>
|
||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<script src="https://cjrtnc.leaningtech.com/2.3/loader.js"></script>
|
<script src="https://cjrtnc.leaningtech.com/2.3/loader.js"></script>
|
||||||
|
<style>
|
||||||
|
*{
|
||||||
|
margin: 0;
|
||||||
|
padding: 0;
|
||||||
|
}
|
||||||
|
.popwindow {
|
||||||
|
width:500px;
|
||||||
|
height:550px;
|
||||||
|
border:3px solid #ff928e;
|
||||||
|
visibility: hidden;
|
||||||
|
position: absolute;
|
||||||
|
z-index: 999;
|
||||||
|
opacity: 1;
|
||||||
|
overflow: hidden;
|
||||||
|
background-color: white;
|
||||||
|
text-align: center;
|
||||||
|
margin-top: 10%;
|
||||||
|
margin-left: 35%;
|
||||||
|
border-radius: 10px;
|
||||||
|
}
|
||||||
|
.leftInfoBlock{
|
||||||
|
margin-top: 20px;
|
||||||
|
height: 180px;
|
||||||
|
background: #f1a087;
|
||||||
|
}
|
||||||
|
.leftInfo {
|
||||||
|
width: 90%;
|
||||||
|
top: 20px;
|
||||||
|
position:absolute;
|
||||||
|
background: #f7a2a2;
|
||||||
|
}
|
||||||
|
.rightQuery{
|
||||||
|
width: 10%;
|
||||||
|
left: 90%;
|
||||||
|
height: 400px;
|
||||||
|
top: 20px;
|
||||||
|
position:absolute;
|
||||||
|
background: #a19cee;
|
||||||
|
}
|
||||||
|
.circleButton{
|
||||||
|
align-items: center;
|
||||||
|
border-radius:50%;
|
||||||
|
border: none
|
||||||
|
}
|
||||||
|
.pararadio{
|
||||||
|
height: 20%;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
||||||
</head>
|
</head>
|
||||||
<div id="replayWindow">
|
<div id="replayWindow" class="popwindow">
|
||||||
<div id="replayWindowGame">
|
<div id="replayWindowGame">
|
||||||
</div>
|
</div>
|
||||||
<div align="center"><button onClick="closeReplayWindow()">Close Window</button></div>
|
<div align="center"><button onClick="closeReplayWindow()">Close Window</button></div>
|
||||||
</div>
|
</div>
|
||||||
<body>
|
|
||||||
|
|
||||||
<div align="center"><button onClick="Replay('test1')">Replay Game1</button></div>
|
|
||||||
<div align="center"><button onClick="Replay('test2')">Replay Game2</button></div>
|
|
||||||
<script>
|
<body>
|
||||||
//The Funtions
|
<div class = "leftInfo">
|
||||||
function closeReplayWindow(){
|
<div class = "leftInfoBlock">
|
||||||
var replayWindow=document.getElementById("replayWindow");
|
<h3 align = "center"> Game 1</h3>
|
||||||
replayWindow.style.visibility = 'hidden';
|
<img src="../levels/test1.png" width="100%" >
|
||||||
}
|
<div align="center"><button onClick="Replay('test1')">Replay Game1</button></div>
|
||||||
function Replay(id){
|
</div>
|
||||||
var replayWindow=document.getElementById("replayWindow");
|
|
||||||
replayWindow.style.visibility = 'visible';
|
<div class = "leftInfoBlock">
|
||||||
cjCall("Play", "replayGameMain", id, id);
|
<h3 align = "center"> Game 2</h3>
|
||||||
}
|
<img src="../levels/test2.png" width="100%" >
|
||||||
window.onload=function(){
|
<div align="center"><button onClick="Replay('test2')">Replay Game2</button></div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<script>
|
||||||
|
//The Funtions
|
||||||
|
function closeReplayWindow(){
|
||||||
|
var replayWindow=document.getElementById("replayWindow");
|
||||||
|
replayWindow.style.visibility = 'hidden';
|
||||||
|
}
|
||||||
|
function Replay(id){
|
||||||
|
var replayWindow=document.getElementById("replayWindow");
|
||||||
|
replayWindow.style.visibility = 'visible';
|
||||||
|
cjCall("Play", "replayGameMain", id, id);
|
||||||
|
}
|
||||||
|
function getValue(){
|
||||||
|
var radio = document.getElementsByName("gameRadio");
|
||||||
|
for (i=0; i<radio.length; i++) {
|
||||||
|
if (radio[i].checked) {
|
||||||
|
alert(radio[i].value)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
window.onload=function(){
|
||||||
|
closeReplayWindow();
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
<script>
|
||||||
|
cheerpjInit();
|
||||||
|
var divElement = document.getElementById("replayWindowGame");
|
||||||
|
cheerpjCreateDisplay(500,500,divElement);
|
||||||
|
cheerpjRunMain("Play", "/app/Mario-AI-Interface.jar", "0", "f_l");
|
||||||
closeReplayWindow();
|
closeReplayWindow();
|
||||||
}
|
</script>
|
||||||
</script>
|
</div>
|
||||||
<script>
|
<div class = "rightQuery">
|
||||||
cheerpjInit();
|
<!-- <button class = "circleButton" style = "width: 100px; height: 100px;"></button>
|
||||||
var divElement = document.getElementById("replayWindowGame");
|
<button class = "circleButton" style = "width: 60px; height: 60px;"></button>
|
||||||
cheerpjCreateDisplay(500,500,divElement);
|
<button class = "circleButton" style = "width: 40px; height: 40px;"></button>
|
||||||
cheerpjRunMain("Play", "/app/Mario-AI-Interface.jar", "0", "f_l");
|
<button class = "circleButton" style = "width: 60px; height: 60px;"></button>
|
||||||
closeReplayWindow();
|
<button class = "circleButton" style = "width: 100px; height: 100px;"></button> -->
|
||||||
</script>
|
<fieldset style="height: 100%;" >
|
||||||
|
<legend align="center" height = 30px >Fun</legend>
|
||||||
|
|
||||||
|
<div class = "pararadio">
|
||||||
|
<input type="radio" value="1-2" name="fun">
|
||||||
|
<label for="gameRadio">Game1 Better</label>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class = "pararadio">
|
||||||
|
<input type="radio" value="1-1" name="fun">
|
||||||
|
<label for="gameRadio">Game1 Good</label>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class = "pararadio">
|
||||||
|
<input type="radio" value="0-0" name="fun">
|
||||||
|
<label for="gameRadio">Equal</label>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class = "pararadio">
|
||||||
|
<input type="radio" value="2-1" name="fun">
|
||||||
|
<label for="gameRadio">Game2 Good</label>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class = "pararadio">
|
||||||
|
<input type="radio" value="2-2" name="fun">
|
||||||
|
<label for="gameRadio">Game2 Better</label>
|
||||||
|
</div>
|
||||||
|
</fieldset>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
function getRadioValue(){
|
||||||
|
var obj = document.getElementsByName("fun");
|
||||||
|
for(var i=0; i<obj.length; i ++){
|
||||||
|
if(obj[i].checked){
|
||||||
|
|
||||||
|
alert(obj[i].value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// var radio = document.getElementsByName("gameRadio");
|
||||||
|
// var addressID = $("input[name='sex']:checked").val();
|
||||||
|
// alert(addressID)
|
||||||
|
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
<button onclick="getRadioValue()"> Submit </button>
|
||||||
|
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
</body>
|
</body>
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user