             style += " " + styles[s]
         if props.result.problemName
             title = props.user.name + ": " + props.result.problemName
-    return 
+    return
         <td className={style} title={title}>
             {if props.header
                 "="
             else
-                ("" + props.result.solved + 
+                ("" + props.result.solved +
                  (if props.result.ok then " + " + props.result.ok else "") +
                 " / " + props.result.total)
             }
         </td>
-        
+
 Result = (props) ->
     if props.result.total > 1
         `<TotalResult {...props}/>`

            "wa"
        else
            undefined
            
    if className
        className = globalStyles[className]
        
    realProblem = r.table.substr(1)
    runId = r.lastSubmitId
    runSuff = ''
    if runId
        if runId.indexOf("p") > 0
            runId = runId.substr(0, runId.indexOf("p"))  # strip problem suffix
        runSuff = '&run_id=' + runId
    dbClickUrl = 'http://informatics.mccme.ru/moodle/mod/statements/view3.php?chapterid=' + realProblem + runSuff

    ctrlDbClickUrl = 'http://informatics.mccme.ru/moodle/mod/statements/view3.php?chapterid=' + realProblem + '&submit&user_id=' + props.user._id
    
    dbClickHandler = (event) ->
        if event.ctrlKey 
            window.open(ctrlDbClickUrl, '_blank') 
        else 
            window.open(dbClickUrl, '_blank')


    <td title={props.user.name + " : " + props.result.problemName} className={className + " " + styles.res + " " + globalStyles.mainTable_td} onDoubleClick={dbClickHandler}>
        {text}
    </td>
    
totalResultClass = (result) ->
    if not result.problemName
        return undefined
    if result.total == result.solved
        return "full"
    else 
        needed = result.total
        if result.problemName.slice(-1) == "В"
            needed = Math.ceil(needed / 2)

            return "started"
        else
            return "none"

TotalResult = (props) ->
    style = globalStyles.mainTable_td
    title = ""
