-
-
Notifications
You must be signed in to change notification settings - Fork 80
PG::Critic add policy for weightedGrader.pl functions. #1363
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Conversation
2cc687e to
d9421e1
Compare
drgrice1
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Technically the weightedGrader.pl macro is not yet officially deprecated. It has not been moved to the macros/deprecated directory, which is the official mark of deprecation at this point.
I really don't think that it is a good idea to add a specific macro deprecation rule for a macro that is not deprecated. Particularly when there is already a general rule for actually deprecated macros.
| The C<DBsubject>, C<DBchapter>, C<DBsection> tags can only be specific values. | ||
| The prefered way to edit these tags is to use the tag editor (click "Edit Tags" | ||
| when viewing the problem). The tag editor provides drop down menus to choose | ||
| between the valid possibilities. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think that it is a good idea to include this comment.
First, I would not say that using the "Edit Tags" button in webwork2 is the preferred way of editing tags. There is certainly nothing wrong with directly editing them in a file. There are also other ways of editing tags that in the future might even become more preferable. This is specific to webwork2, and the standalone renderer also has a tag editor.
Second, the "Edit Tags" button is only shown for admin users in a course. So for other instructors that are creating and editing problems that isn't even an option.
Finally, I am not even sure this rule is a good idea. I added it because it was in the rules discussed at the Vegas workshop. However, there are problems with this. One issue is the fact that the defined tags which are from webwork-open-problem-library/OpenProblemLibrary/Taxonomy2 may not work for all problems. Another issue is that the tags are not even complete to begin with. For example, the DBSubject of "Graph theory" has a DBChapter of "Terminology", but there is no DBSection to go with that. The same for the DBChapter of "Coloring". There are other cases like this as well.
So it is likely that we should disable this rule until we get the tags in proper order to begin with.
Once the tags are in order and we think this rule is a good idea, then this rule should probably even go further and ensure that the tags are not only set, but have valid values. Although the issue with that is that the tags are defined in a file in another repository.
| Since OPL metadata tags are only needed for problems in the OPL, for local | ||
| problems it is possible to override this check by adding the following as | ||
| the first line of the PG file. | ||
| ## no critic (PG::RequireMetadata) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not true. If this comment is going to be added then it needs to be more specific. You seem to be assuming that this is only used through the webwork2 interface. This can also be used with the bin/pg-critic.pl script (or in theory other implementations). The no critic annotations are shown by default, but can be disabled. If the -s flag is passed to the pg-critic.pl script. then the no critic annotation is ignored and all policies are forced to apply.
|
I guess the new rule is okay, since we do have the comment in the POD that the macro shouldn't be used, and the rule is different than the general macro deprecation rule in that it is checking method calls. |
|
My thought was also to help explain how to fix the issues, and just stating the macro is deprecated might not help an author know how to weight answers. I modeled this off of I am okay with removing |
d9421e1 to
bfd1330
Compare
|
I just dropped my second commit with modifying the |
|
I am not opposed to the comment regarding the |
|
I mostly removed it due to I would rather just disable it per your previous comment, than tell people to ignore it. So I think it should also be removed/disabled until the tag situation is better worked out. I find I'm just ignoring/disabling it in my use and thought others would want to do the same. But to me, if many are just going to disable that policy, might as well just not have it, or at the least I don't want to couple it with the |
Add a
PG::Criticpolicy to catch use of the deprecatedweightedGrader.plfunction calls.