Skip to content

Commit

Permalink
judge history
Browse files Browse the repository at this point in the history
  • Loading branch information
UltimateHikari committed Nov 30, 2018
1 parent 4df7532 commit 4b534bf
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
18 changes: 18 additions & 0 deletions client_Core.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

function handleLogin(){
applyJudgeName();
google.script.run.withFailureHandler(handleError).withSuccessHandler(OnJudgeResultsFetched).fetchJudgeResults(getIDValue());
changeView("backform","mainlayer"); // disabled now for comfortable debug
}

Expand All @@ -31,6 +32,23 @@
sessionStorage.setItem("teamnames", data);
}

function OnJudgeResultsFetched(data){
var judge = getJudgeValue();
var counter = 0;
for(i in data){
try{
var curForm = JSON.parse(data[i][0]);
if(curForm.judge == judge){
$('#logslist').prepend("<li id='log" + counter + "'> Загрузка... " + "</li>");
pushServerResponse(counter,curForm.team,curForm.problem,curForm.result,curForm.serverResponse,curForm.token);
counter++;
}
}catch(err){
continue;
}
}
}

function changeView(first ,second){
//change forms disabled
document.getElementById('' + first).setAttribute("hidden","true");
Expand Down
6 changes: 6 additions & 0 deletions module_server.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,12 @@ function module_getTeamnames(id){
return repacked_teamArray;
}

function fetchJudgeResults(id){
var modelSheet = GetSheet(RAW,id);
var modelSize = modelSheet.getLastRow() - MODEL_START + CONST_MORE_THAN_JUDGIES;
return modelSheet.getRange(MODEL_START, 1, modelSize, 2).getValues();
}

function GetHumanReadableCaption(value) {
if (value[0] == "+")
return "Уже сдана (" + value + ")";
Expand Down

0 comments on commit 4b534bf

Please sign in to comment.