Skip to content
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

Additional variable variants & answers not stored #9

Open
ewalgran opened this issue Mar 24, 2023 · 4 comments
Open

Additional variable variants & answers not stored #9

ewalgran opened this issue Mar 24, 2023 · 4 comments

Comments

@ewalgran
Copy link

We have been testing the Variable numeric set with units qtype_varnumunit 1.8 for Moodle 3.11+ version 2022050300 on a Moodle 4.1 instance.

  1. When trying to define calculated variables beyond the default 5 variants that are available the additional variants are not generated/stored. This issue occurs after using the "Recalculate now" function.
  2. When trying to included additional numerical answer options those are not stored either. This issue occurs when saving the question.

The fields are present and the elements can be configured but the data is wiped after calculating or saving. We will note issue 1 is also present in the qtype_varnumericset as well.

Below are a few javascript errors that appear that may or may not be related.

Screenshot 2023-03-24 at 8 53 43 AM

Side question is there an updated version of the qtype_varnumericset for 4.1 on the horizon? If so is there an estimated time for that?

@timhunt
Copy link
Member

timhunt commented Mar 29, 2023

This works for me.

image

The error you get makes me think that the problem is not with this plugin. The error mentions react, but Moodle does not use react. Is it possible you are using a custom theme, which somehow causes problems for this question type?

@ewalgran
Copy link
Author

Thanks for the follow up!

The issue does not occur with the Predefined variable option, we were able to have success with that as you confirmed. The error occurs when trying to generate a single Calculated variable beyond 5 variants. I am using the a=rand_int(1,00) formula to define these calculated variables.

Setup screenshot
Screenshot 2023-03-29 at 11 29 58 AM

Post Recalculate
Screenshot 2023-03-29 at 11 30 55 AM

We are using a base 4.1 test instance with no custom theme applied at this time but perhaps the default 4.1 theme is introducing this?

@timhunt
Copy link
Member

timhunt commented Mar 31, 2023

Just showing blanks does not add variants. With this question type, you must add at least one variable with Predefined variants, to control how many variants there are. (If necessary add an otherwise unused variable called variant_number with values 1, 2, 3, 4, ...

(Really, the form validation and help should make this clear.)

@ewalgran
Copy link
Author

ewalgran commented Apr 3, 2023

Understood, thanks for verifying the requirement of a Predefined variant to allow for additional Calculated ones!

Circling back on the second issue we encountered that when trying to include additional numerical answer options those are not being stored. This issue occurs after using the "Save changes" button and then returning to edit it. I did verify that the qtype_varnumericset does successfully save multiple answer options.

Initial Question Setup with 2 answers
Screenshot 2023-04-03 at 8 31 41 AM

Post Saving Question only 1 answer remains
Screenshot 2023-04-03 at 8 32 17 AM

When additional answer options are added those too are wiped after saving the question, only one answer option remains. Can you replicate this issue or is this also an intended behavior for qtype_varnumunit?

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

No branches or pull requests

2 participants