Skip to content

Use JavaScript to show/hide fields when switching assignment_type. - #3222

Open
somiaj wants to merge 1 commit into
openwebwork:developfrom
somiaj:js-switch-set-type
Open

somiaj wants to merge 1 commit into
openwebwork:developfrom
somiaj:js-switch-set-type

Conversation

@somiaj

@somiaj somiaj commented Sep 27, 2026

Copy link
Copy Markdown
Contributor

When selecting the assignment_type on the ProblemSetDetails page, use JavaScript to show/hide set fields for the appropriate assignment type. This way one can change a set's assignment type and edit the specific assignment type fields without having to save the changes first to see the fields for that type.

@somiaj

somiaj commented Sep 27, 2026

Copy link
Copy Markdown
Contributor Author

I just realized this isn't complete or might be not possible, because this only messes with set fields, and switching also changes problem fields. Making a draft for now as I think about what to do with the problem fields.

@somiaj
somiaj marked this pull request as draft September 27, 2026 21:32
@somiaj

somiaj commented Sep 28, 2026

Copy link
Copy Markdown
Contributor Author

This now shows/hides the problem fields based on set type as well, but the javascript would be a bit too complicated to update the set numbering to change to/from JITAR sets, so in that case a warning is shown to let the user they need to "Save Changes" to update the problems when changing to/from a JITAR set.

@somiaj
somiaj force-pushed the js-switch-set-type branch 2 times, most recently from 81a48f1 to 65e84bf Compare September 28, 2026 01:42
@dlglin

dlglin commented Sep 28, 2026

Copy link
Copy Markdown
Member

This is probably beyond the scope of this PR, but how about adding the ability to choose an assignment type when creating a set?

@somiaj
somiaj marked this pull request as ready for review September 28, 2026 15:59
@somiaj

somiaj commented Sep 28, 2026

Copy link
Copy Markdown
Contributor Author

Since I cannot think of a good way to deal with to/from jitar sets and updating problems to the jitar naming/nesting buttons, this is now ready for review again. It does update problem fields, and just warns users when they need to "Save Changes" to move to/from jitar sets to fully update the problems to/from the jitar naming/nesting ability.

@somiaj

somiaj commented Sep 28, 2026

Copy link
Copy Markdown
Contributor Author

@dlglin that could be a possibility, but there are multiple places a set can be created. Adding that option to the "Create" action tab in the "Sets Manager" would be doable. Though should this also be added when creating a set from the "Library Browser". Unsure if there is any other way a set can be created (outside of importing which already contains the type).

When selecting the `assignment_type` on the ProblemSetDetails page,
use JavaScript to show/hide set fields for the appropriate
assignment type. This way one can change a set's assignment type
and edit the specific assignment type fields without having to
save the changes first to see the fields for that type.
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.

2 participants