Skip to content

Commit

Permalink
problem tips added
Browse files Browse the repository at this point in the history
  • Loading branch information
UltimateHikari committed Nov 27, 2018
1 parent 2aa98af commit c10433f
Show file tree
Hide file tree
Showing 5 changed files with 39 additions and 13 deletions.
21 changes: 11 additions & 10 deletions client_FormMethods.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
// Set handler for team number change
getTeamElem().onblur = onTeamNumberChanged;
// Set handler for problem number change
//getProblemElem().oninput = onProblemNumberChanged;
getProblemElem().oninput = onProblemNumberChanged;

}

Expand All @@ -16,15 +16,16 @@
}
}

// function onProblemNumberChanged(){
// team = getTeamValue();
// problem = getProblemValue();
// //console.log(team, problem);
function onProblemNumberChanged(){
team = getTeamValue();
problem = getProblemValue();
id = getIDValue();
//console.log(team, problem);

// google.script.run.withSuccessHandler(OnTeamResultsFetched).getTeamResults(team, problem);
// }
google.script.run.withSuccessHandler(OnTeamResultsFetched).getTeamResults(team, problem,id);
}

// function OnTeamResultsFetched(problem_result /* string */) {
// document.getElementById('current_problem_results').innerHTML = problem_result;
// }
function OnTeamResultsFetched(problem_result /* string */) {
document.getElementById('current_problem_results').innerText = problem_result;
}
</script>
2 changes: 1 addition & 1 deletion client_Page.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

<h1 id="header" class="headclass"></h1>

<form сlass="mui-form" id="backform" onsubmit="handleLogin(); return false;">
<form сlass="mui-form" id="backform" onsubmit="handleLogin(); return false;" autocomplete="off">
<input hidden="true" id="version" value="none">
<input hidden="true" id="tokenval" value="none">

Expand Down
5 changes: 4 additions & 1 deletion module_form.html
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,10 @@
<input id="problem" type="number" min="1" max="200" placeholder="от 1 до 8" required>
<label>Номер задачи</label>
</div>
</div>
</div>
<div class="mui-col-md-8">
<label id="current_problem_results"></label>
</div>
</div>

<div class="mui-row">
Expand Down
22 changes: 22 additions & 0 deletions module_server.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,26 @@ function module_getTeamnames(id){
}
Logger.log(repacked_teamArray);
return repacked_teamArray;
}

function GetHumanReadableCaption(value) {
if (value[0] == "+")
return "Уже сдана (" + value + ")";
Logger.log(value);
switch(value) {
case -1:
return "Была 1 попытка";
case -2:
return "Были 2 попытки";
case -3:
return "Были 3 попытки";
default:
return "Не сдавалась ранее";
}
}

function getTeamResults(team, problem, id){
var face = GetSheet(VIEW, id);
var faceCell = face.getRange(VIEW_START_X + team, VIEW_START_Y - 1 + problem);
return GetHumanReadableCaption(faceCell.getValue());
}
2 changes: 1 addition & 1 deletion server_CoreConfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ var C_Y = 6;
//others
var FORM_TITLE = "MGS";
var LOCK_TIMEOUT_MS = 4000; // 4 second
var ATTEMPTS = 3;
var ATTEMPTS = 3;
var VIEW_START_X = 2;
var VIEW_START_Y = 3;
var HEADER = "Форма для устной";

0 comments on commit c10433f

Please sign in to comment.