From 240c75e1033e9a80036218508dd4cdf731ac3ae7 Mon Sep 17 00:00:00 2001 From: UltimateHikari Date: Wed, 28 Nov 2018 18:25:55 +0700 Subject: [PATCH] deletion in view fix (else added); view re-writing after deletion added --- module_view.js | 4 +++- server_Core.js | 4 ++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/module_view.js b/module_view.js index bcc3dba..27db3ba 100644 --- a/module_view.js +++ b/module_view.js @@ -20,8 +20,8 @@ function view_refreshTeamView(team, modelData, maxProblem, viewSheet){ } /// exctraction from 2017 script FACE algo for(i in attemptsArray){ + var curRange = viewSheet.getRange(VIEW_START_X + team, VIEW_START_Y + parseInt(i)); if(attemptsArray[i][1] > 0){ - var curRange = viewSheet.getRange(VIEW_START_X + team, VIEW_START_Y + parseInt(i)); value = String(attemptsArray[i][1] - attemptsArray[i][0]); if(value == "0"){ value = ""; @@ -29,6 +29,8 @@ function view_refreshTeamView(team, modelData, maxProblem, viewSheet){ curRange.setValue(SYMBOLS[attemptsArray[i][0]] + value); curRange.setFontColor(FONTS[attemptsArray[i][0]]); curRange.setHorizontalAlignment("center"); + }else{ + curRange.setValue(""); } } } \ No newline at end of file diff --git a/server_Core.js b/server_Core.js index 4a3a0fa..9121200 100644 --- a/server_Core.js +++ b/server_Core.js @@ -143,9 +143,13 @@ function deleteForm(token, link, id){ for(i in modelData){ try{ var item = JSON.parse(modelData[i][0]); + var team = item.team; if(item.token == token){ modelData[i][0] = ""; + view_refreshTeamView(team, modelData, + module_getParams(id).problem, GetSheet(VIEW, id)); modelRange.setValues(modelData); + return link; } } catch(err){