@@ -170,14 +170,22 @@ server <- function(input, output) {
170170 if (! is.null(file $ datapath ) && grepl(" ^.+__.+\\ .rds" , file $ name ) &&
171171 ! is_done()) {
172172 solution <- data.io :: read $ rds(file $ datapath )$ value
173+ message(" data read" )
173174 score <- score_model(solution )
175+ message(" score is " , score )
174176 name <- file $ name
177+ message(" name is " , name )
175178 project <- sub(" (^.+)__.+$" , " \\ 1" , name )
176179 model <- sub((" ^.+__(.+)\\ .rds$" ), " \\ 1" , name )
180+ if (project == name ) {
181+ message(" Wrong name!" )
182+ score <- NA
183+ }
177184 } else {
178185 score <- NA
179186 }
180187 ranking <- load_data()
188+ message(" Data loaded" )
181189 # Record an entry in the mongoDB database
182190 # But we need the login of *all* members of the team, and we don't have them
183191 # right now => leave this to a post-process task instead!
@@ -198,6 +206,7 @@ server <- function(input, output) {
198206 ranking $ date <- as.POSIXct(ranking $ date , origin = " 1960-01-01" )
199207 ranking $ date <- format(ranking $ date , " %Y-%m-%d %H:%M:%S" )
200208 }
209+ message(" Date reworked" )
201210 # Add a column with medals for the three first results
202211 n <- NROW(ranking )
203212 if (n == 0 ) {
@@ -207,10 +216,11 @@ server <- function(input, output) {
207216 if (n < 4 ) {
208217 medals <- medals [1 : n ]
209218 } else {
210- medals <- c(medals , rep(" " , 1 : ( n - 3 ) ))
219+ medals <- c(medals , rep(" " , n - 3 ))
211220 }
212221 }
213222 ranking <- data.frame (rank = medals , ranking )
223+ message(" Ranking done" )
214224 names(ranking ) <- c(" " , " Projet" , " Mod\u 00e8le" , " Date" , " Score" )
215225 ranking
216226 })
0 commit comments