summaryrefslogtreecommitdiff
path: root/js
diff options
context:
space:
mode:
authorTimotej Lazar <timotej.lazar@fri.uni-lj.si>2016-03-01 15:55:00 +0100
committerTimotej Lazar <timotej.lazar@fri.uni-lj.si>2016-03-01 15:55:00 +0100
commit56762ca8cc862a4873b3c3edf491b07daffd5626 (patch)
treee9c0826c744f304d02ed5a6b5a1b1bba1cf52b1b /js
parent8123099f8655981e3f7984830fe8ca0154b7278e (diff)
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.
Diffstat (limited to 'js')
-rw-r--r--js/codeq/problem_list.js10
1 files changed, 5 insertions, 5 deletions
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 <http://www.gnu.org/licenses/>. */
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');
}
}