@@ -170,14 +170,22 @@ server <- function(input, output) {
170
170
if (! is.null(file $ datapath ) && grepl(" ^.+__.+\\ .rds" , file $ name ) &&
171
171
! is_done()) {
172
172
solution <- data.io :: read $ rds(file $ datapath )$ value
173
+ message(" data read" )
173
174
score <- score_model(solution )
175
+ message(" score is " , score )
174
176
name <- file $ name
177
+ message(" name is " , name )
175
178
project <- sub(" (^.+)__.+$" , " \\ 1" , name )
176
179
model <- sub((" ^.+__(.+)\\ .rds$" ), " \\ 1" , name )
180
+ if (project == name ) {
181
+ message(" Wrong name!" )
182
+ score <- NA
183
+ }
177
184
} else {
178
185
score <- NA
179
186
}
180
187
ranking <- load_data()
188
+ message(" Data loaded" )
181
189
# Record an entry in the mongoDB database
182
190
# But we need the login of *all* members of the team, and we don't have them
183
191
# right now => leave this to a post-process task instead!
@@ -198,6 +206,7 @@ server <- function(input, output) {
198
206
ranking $ date <- as.POSIXct(ranking $ date , origin = " 1960-01-01" )
199
207
ranking $ date <- format(ranking $ date , " %Y-%m-%d %H:%M:%S" )
200
208
}
209
+ message(" Date reworked" )
201
210
# Add a column with medals for the three first results
202
211
n <- NROW(ranking )
203
212
if (n == 0 ) {
@@ -207,10 +216,11 @@ server <- function(input, output) {
207
216
if (n < 4 ) {
208
217
medals <- medals [1 : n ]
209
218
} else {
210
- medals <- c(medals , rep(" " , 1 : ( n - 3 ) ))
219
+ medals <- c(medals , rep(" " , n - 3 ))
211
220
}
212
221
}
213
222
ranking <- data.frame (rank = medals , ranking )
223
+ message(" Ranking done" )
214
224
names(ranking ) <- c(" " , " Projet" , " Mod\u 00e8le" , " Date" , " Score" )
215
225
ranking
216
226
})
0 commit comments