Skip to content

Cleanup modelCourse achievements.#2984

Draft
somiaj wants to merge 1 commit into
openwebwork:WeBWorK-2.21from
somiaj:clean-achievements
Draft

Cleanup modelCourse achievements.#2984
somiaj wants to merge 1 commit into
openwebwork:WeBWorK-2.21from
somiaj:clean-achievements

Conversation

@somiaj
Copy link
Copy Markdown
Contributor

@somiaj somiaj commented May 21, 2026

Cleanup and update the default achievements in the modelCourse.

  • Remove the same comment from the bottom of all evaluators. This is hard to maintain, instead put all the information in achievements_readme.txt and point to this file from other evaluators.

  • Cleanup the achievement evaluators:

    • Simplify the code, don't use else statements when there was a return inside the previous if. Clean up some of the logic.
    • Take advantage of the new $globalData->{completedSets} hash to avoid looping through all problems to determine if a set is completed.
    • Ran perltidy on them using an 80 character limit.
  • Remove some evaluator duplication. The complete n problems or n sets can all be done using a single evaluator, since the only difference is the $maxCounter setting from the achievement.

  • Remove all unused achievement evaluators. There are lots of these that are really just the same example achievement over and over again to see if particular problems from particular sets were completed. The images are still available for helping people think of names, but the evaluators don't need to be included. Instead provide four example evaluators for completing specific problems and/or sets.

I still need to do a bit of testing on this, so making this a draft, but sharing so others can help test/give feedback.

@somiaj somiaj marked this pull request as draft May 21, 2026 22:35
Cleanup and update the default achievements in the modelCourse.

* Remove the same comment from the bottom of all evaluators.
  This is hard to maintain, instead put all the information in
  achievements_readme.txt and point to this file from other
  evaluators.

* Cleanup the achievement evaluators:
  * Simplify the code, don't use else statements when there was
    a return inside the previous if. Clean up some of the logic.
  * Take advantage of the new $globalData->{completedSets} hash
    to avoid looping through all problems to determine if a
    set is completed.
  * Ran perltidy on them using an 80 character limit.

* Remove some evaluator duplication. The complete n problems
  or n sets can all be done using a single evaluator, since
  the only difference is the $maxCounter setting from the
  achievement.

* Remove all unused achievement evaluators. There are lots of
  these that are really just the same example achievement over
  and over again to see if particular problems from particular
  sets were completed. The images are still available for
  helping people think of names, but the evaluators don't need
  to be included. Instead provide four example evaluators for
  completing specific problems and/or sets.
@somiaj somiaj force-pushed the clean-achievements branch from ca15f6b to 76c2363 Compare May 21, 2026 22:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant