     for w of weekOk
         if w<firstWeek
             delete weekOk[w]
+
+    if user._id == DEBUG_USER_ID
+        console.log "activity=", activity, "rating=", rating
 
     activity *= (1 - WEEK_ACTIVITY_EXP) # make this averaged
     return {


import {startDayForWeeks, lastWeeksToShow, WEEK_ACTIVITY_EXP, LEVEL_RATING_EXP, ACTIVITY_THRESHOLD, MSEC_IN_WEEK, FM_CONST} from './ratingConstants'

export levelVersion = (level) ->
    if (level.slice(0,3) == "sch")
        major = 1
        minor = 'В'
    else if (level.slice(0,3) == "nnoi")
        major = 2
        minor = 'Б'
    else if (level.slice(0,3) == "reg")

        week = weekByTime(r.lastSubmitTime)
        if r.solved == 1 or r.ok == 1
            rating += levelScore(level) * FM_CONST
            if user._id == DEBUG_USER_ID
                console.log "add rating 2 ", r.table, level, levelScore(level), rating
            activity += activityScore(level, r.lastSubmitTime) * FM_CONST

    for level in ["1А", "1Б"]
