Skip to content

Commit

Permalink
xcxcxcxc
Browse files Browse the repository at this point in the history
  • Loading branch information
jmurgolo committed Mar 2, 2024
1 parent 9bfcc0e commit 0f39d55
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 10 deletions.
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
const db = new Dexie("Team Tracking App");
db.version(1).stores({ teams: "++id, teamname, globalid, teamnumber, teamschool, alliancescore, moreinfo, Leaveszone, scores1amp, scores1speaker, picksup, scores2amp, scores2speaker, amp, speaker, scoreEither, ground, human, either, prefintake, spotlight, trap, alone, hangsWithAnother, attemptsSpotlight, coop" });
db.version(1).stores({ teams: "++id, teamname, globalid, teamnumber, teamschool, alliancescore, moreinfo, startingpos, Leaveszone, scores1amp, scores1speaker, picksup, scores2amp, scores2speaker, amp, speaker, scoreEither, ground, human, either, prefintake, spotlight, trap, alone, hangsWithAnother, attemptsSpotlight, coop" });

const form = document.querySelector("#new-team-form");
const input = document.querySelector("#new-team-input");
Expand Down
11 changes: 6 additions & 5 deletions pages/teamdetails.html
Original file line number Diff line number Diff line change
Expand Up @@ -90,21 +90,22 @@ <h2> Abilities </h2><br>
<input type="checkbox" id="scores2speaker" name="scores2speaker" value="scores2speaker">
<label for="action4.1"> Scores 2nd in speaker</label><br>
<br>

<!-- Teleop Survey-->
<p>Preferred scoring method:</p>
<input type="radio" id="amp" name="score" value="amp">
<label for="amp">Amp</label><br>
<input type="radio" id="amp" name="score" value="speaker">
<input type="radio" id="speaker" name="score" value="speaker">
<label for="speaker">Speaker</label><br> <!-- Fixed the for attribute -->
<input type="radio" id="amp" name="score" value="either">
<input type="radio" id="scoreEither" name="score" value="either">
<label for="scoreEither">Either</label><br><br>

<p class="ptext">Preferred Intake method:</p>
<input type="radio" class="radio" id="Preferred" name="intake" value="ground">
<input type="radio" class="radio" id="ground" name="intake" value="ground">
<label for="ground">Ground</label><br>
<input type="radio" class="radio" id="Preferred" name="intake" value="human">
<input type="radio" class="radio" id="human" name="intake" value="human">
<label for="human">Human Player</label><br>
<input type="radio" class="radio" id="Preferred" name="intake" value="either">
<input type="radio" class="radio" id="either" name="intake" value="either">
<label for="intakeEither">Either</label><br><br>

<label for="othertext">Other: </label>
Expand Down
24 changes: 20 additions & 4 deletions pages/teamdetails.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Global Dexie database initialization
const db = new Dexie("Team Tracking App");
db.version(1).stores({ teams: "++id, teamname, globalid, teamnumber, teamschool, alliancescore, moreinfo, Leaveszone, scores1amp, scores1speaker, picksup, scores2amp, scores2speaker, amp, speaker, scoreEither, ground, human, either, prefintake, spotlight, trap, alone, hangsWithAnother, attemptsSpotlight, coop" });
db.version(1).stores({ teams: "++id, teamname, globalid, teamnumber, teamschool, alliancescore, moreinfo, startingpos, Leaveszone, scores1amp, scores1speaker, picksup, scores2amp, scores2speaker, amp, speaker, scoreEither, ground, human, either, prefintake, spotlight, trap, alone, hangsWithAnother, attemptsSpotlight, coop" });

document.addEventListener('DOMContentLoaded', async () => {
try {
Expand All @@ -22,7 +22,7 @@ document.addEventListener('DOMContentLoaded', async () => {
}
});

async function submitTeamData( teamname, globalid, teamnumber, teamschool, alliancescore, moreinfo, Leaveszone, scores1amp, scores1speaker, picksup, scores2amp, scores2speaker, amp, speaker, scoreEither, ground, human, either, prefintake, spotlight, trap, alone, hangsWithAnother, attemptsSpotlight, coop) {
async function submitTeamData( teamname, globalid, teamnumber, teamschool, alliancescore, moreinfo, startingpos, Leaveszone, scores1amp, scores1speaker, picksup, scores2amp, scores2speaker, amp, speaker, scoreEither, ground, human, either, prefintake, spotlight, trap, alone, hangsWithAnother, attemptsSpotlight, coop) {
try {
const parsedGlobalId = parseInt(globalid, 10);

Expand All @@ -32,18 +32,34 @@ async function submitTeamData( teamname, globalid, teamnumber, teamschool, allia
teamnumber: teamnumber,
teamschool: teamschool,
alliancescore: alliancescore,

moreinfo: moreinfo,
startingpos: startingpos,

Leaveszone: Leaveszone,
scores1amp: scores1amp,
scores1speaker: scores1speaker,

picksup: picksup,

scores2amp: scores2amp,
scores2speaker: scores2speaker,
Preferred: Preferred,

amp: amp,
speaker: speaker,
scoreEither: scoreEither,

ground: ground,
human: human,
either: either,

prefintake: prefintake,

spotlight: spotlight,
trap: trap,
alone: alone,
hangsWithAnother: hangsWithAnother,

attemptsSpotlight: attemptsSpotlight,
coop: coop,
};
Expand Down Expand Up @@ -101,7 +117,7 @@ document.getElementById("teaminfoform").addEventListener("submit", function(even
const globalid = urlParams.get("globalid");

// Pass the new data to submitTeamData
submitTeamData( teamname, globalid, teamnumber, teamschool, alliancescore, moreinfo, Leaveszone, scores1amp, scores1speaker, picksup, scores2amp, scores2speaker, amp, speaker, scoreEither, ground, human, either, prefintake, spotlight, trap, alone, hangsWithAnother, attemptsSpotlight, coop);
submitTeamData( teamname, globalid, teamnumber, teamschool, alliancescore, moreinfo, startingpos, Leaveszone, scores1amp, scores1speaker, picksup, scores2amp, scores2speaker, amp, speaker, scoreEither, ground, human, either, prefintake, spotlight, trap, alone, hangsWithAnother, attemptsSpotlight, coop);

alert("Team data successfully submitted.");
});

0 comments on commit 0f39d55

Please sign in to comment.