From 56762ca8cc862a4873b3c3edf491b07daffd5626 Mon Sep 17 00:00:00 2001 From: Timotej Lazar Date: Tue, 1 Mar 2016 15:55:00 +0100 Subject: problem_list: fix updating solved/attempted indicators Indicators were only removed for attempted problems, leading to incorrect display if logging out and back in as a user with fewer attempts. --- js/codeq/problem_list.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'js/codeq') diff --git a/js/codeq/problem_list.js b/js/codeq/problem_list.js index 728f28c..9c19852 100644 --- a/js/codeq/problem_list.js +++ b/js/codeq/problem_list.js @@ -299,15 +299,15 @@ along with this program. If not, see . */ var problems = languageData.refs, groups = languageData.groups, jqGroup = jqScreen.find('h2.group-title'), - i; + i, ref, jqLink; // show attempted/solved status in the link for each problem for (i = 0; i < languageData.refs.length; i++) { - var ref = languageData.refs[i]; + ref = languageData.refs[i]; + jqLink = jqScreen.find('a.problem-'+i); + jqLink.removeClass('attempted solved'); if (ref.id in attempts) { - jqScreen.find('a.problem-'+i) - .removeClass('solved attempted') - .addClass(attempts[ref.id] ? 'solved' : 'attempted'); + jqLink.addClass(attempts[ref.id] ? 'solved' : 'attempted'); } } -- cgit v1.2.1