Sorting Challenges

Per docs here I should be able to see/edit the sorting functions. Using the ‘core’ theme, I only see within the Settings dialog the option to set the window size.

If I switch to the ‘learning’ theme, I have a limited ability to sort, but again, with no ability to edit the function (as the docs indicate is possible).

I’d really like to have the ‘box’ appearance of the challenges (like with core theme) but with ability to sort them.

Am I overlooking something?

self-hosted v3.5.1

Hello, sorting is currently best supported on GitHub - CTFd/core-beta.

I’ve just downloaded and added theme ‘core-beta’ and seem to have no ability adjust sorting (and the editor isn’t editable). Should this work via the UI or must all settings be made directly in the files within the themes/ folder?

I’ve sorted this. I had been downloading the core-beta repo to a zip and transferring it (via S3) to the instance, then expanding. This appears to have been causing issues. Git cloning it directly into the /themes directory appears to have resolved.

May have spoke to soon… While getting the core-beta theme working solved the major problem, I"m finding many questions within a category continue to sort out of order. See attached image

In this questino, b is in the last position, instead of the expected 2nd position.

While the IDs are not sequential, this should have no bearing:

The Requirements tab shows its prior question ‘a’ is listed as a requirement.

I’ve this unusual behavior in other locations also. Trying to ‘fix’ this via the UI has so far been not possible (recreating all the content from scratch would be a terrible idea). But, if there were a way to edit the export JSON files, and rezip/import that would correct the ordering, I’d happily give it a shot.

Has anyone else encountered unusual sorting issues?

Ideas?

Bump. Functionally, the ordering works, but visually they sort incorrectly.

Resolved. Changing the Challenge Order Custom Function
to reference .name instead of .id did the trick.

function compare(a, b) {
  if (a.name < b.name) {
    return -1;
  }
  if (a.name > b.name) {
    return 1;
  }
  return 0;
}```