ColdHeat / UnitedStates

A United States map CTFd theme
11 stars 3 forks source link

Difficult to see solved challenges on map #2

Open SkeyeLlama opened 6 years ago

SkeyeLlama commented 6 years ago

Challenges don't change color after they are solved, making it difficult to keep track of what has been solved when there are a lot of challenges, and depending on the custom map/paths used.

SkeyeLlama commented 6 years ago

Here is some suggested fix code for the Marksolves function that we are using in our implementation. Much thanks to @usbportnoy for helping to get this working.

function marksolves(cb) {
    $.get(script_root + '/solves', function (data) {
        var solves = $.parseJSON(JSON.stringify(data));
        for (var i = solves['solves'].length - 1; i >= 0; i--) {
            var id = (solves['solves'][i].chalid - 1);
            var statetemp = Object.keys(states);
            $('path[data-id="'+statetemp[id]+'"]').addClass('solved-challenge');
        };
        if (cb) {
            cb();
        }
    });
}