Skip to content

Commit

Permalink
team numbers change;
Browse files Browse the repository at this point in the history
4th symbol untested
  • Loading branch information
UltimateHikari committed Nov 30, 2018
1 parent d589fb1 commit f2dbb19
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 6 deletions.
13 changes: 10 additions & 3 deletions client_FormMethods.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,16 @@

function onTeamNumberChanged(){
var team = getTeamValue();
var teamnames = JSON.parse(sessionStorage.getItem("teamnames"));
if(team > 0 && team < (getVersionValue() + 1) ){
document.getElementById('current_team_name').innerText = teamnames[team-1];
var sum = team % 10;
if( (Math.trunc(team/1000) + Math.trunc(team/100) + Math.trunc(team/10) + 7) % 10 == sum){
var teamnames = JSON.parse(sessionStorage.getItem("teamnames"));
if(team > 0 && team < (getVersionValue() + 1) ){
document.getElementById('current_team_name').innerText = teamnames[ parseInt(team/10) -1];
}
getSubmitButtonElem().removeAttribute("disabled");
}else{
getSubmitButtonElem().setAttribute("disabled","disabled");
document.getElementById('current_team_name').innerText = "Неправильный номер";
}
}

Expand Down
4 changes: 2 additions & 2 deletions module_client.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
*/
function OnFormParametersFetched(data){
var parameters = JSON.parse(data);
getTeamElem().setAttribute('max', parameters.team);
getTeamElem().setAttribute('max', (parameters.team+1)*10);
getProblemElem().setAttribute('max', parameters.problem);
getTeamElem().setAttribute('placeholder', "от 1 до " + parameters.team);
getTeamElem().setAttribute('placeholder', "от 0000 до " + (parameters.team+1)*10);
getProblemElem().setAttribute('placeholder', "от 1 до " + parameters.problem);
getVersionElem().setAttribute("value",parameters.team);
}
Expand Down
2 changes: 1 addition & 1 deletion module_server.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ function module_getParams(id){
function module_getTeamnames(id){
var repacked_teamArray = [];
var maxTeams = module_getParams(id).team;
var teamArray = GetSheet(TEAMS, id).getRange(1, 1, maxTeams).getValues();
var teamArray = GetSheet(TEAMS, id).getRange(1, 2, maxTeams).getValues();
for(i in teamArray){
repacked_teamArray.push(teamArray[i][0]);
}
Expand Down

0 comments on commit f2dbb19

Please sign in to comment.