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

Dev david issue 723 #771

Open
wants to merge 67 commits into
base: develop
Choose a base branch
from
Open

Dev david issue 723 #771

wants to merge 67 commits into from

Conversation

davidszkiba
Copy link
Contributor

Closes #723

This is a stub for the webservice that accepts response data from a client.
For testing, I created a site at URL
/local/catquiz/client/submit_responses.php where submitting data can be
easily tested.
There are now basic plugin settings:
 - central_host: the address of the central host
 - central_token: the token used to access the central host
 - central_scale: The scale that should be synced. For now, this is a
   basic input field that expects an integer, but this should be changed
   in the future.

There are database tables to store information about send requests and
mappings of questions.

There is now also a question mapper that calculates a hash from question
properties - this way we will be able to map questions based on their
properties (text, answers, etc).
This changes the data to be returned and also
creates a simple page fetch_parameters.php for testing during
development.
Changes local_catquiz_question_hashmap to local_catquiz_qhashmap
This adds a "Sync" button to the scale detail view. It will sync all
parameters associated with that scale or any of its subscales from the
central instance.
- Only create a new contextid if parameters were synced
- Carry-over old itemparameters to the new context and include them in
  the decision of which model should be the active one. E.g., if we get
  3 new models for questionid 1 but already have a different model
  locally with a higher status, this one should still be set as the
  active one.
This sets the lowercase name as label. Since we already have a
validation step that checks if the name is unique, it should be save to
use the lowercase name as label.
Only set the scale label when it is first created.
In a future commit we could remove the rest of the code that refers to
users. Instead, we can just refer to attempts instead.
We always import the whole set of item parameters from the central instance,
as long as at least one item parameter has changed.

Also, we duplicate the items in local_catquiz_items under certain conditions:

- If the existing items (and context) are in use by at least one test,
  we create new items with the synced params.
- Otherwise, we update the existing items and change their contextid to
  the new context of the synced params.
This can be removed later, it just makes testing easier.
The question hashmap alone can't be unique.
If there is no active main/root scale for a given contextid, skip calculations.
Just pass the responses data directly. This way, we do not need to access the DB in the test
The matrix of responses is not correctly pruned to filter out items with
all-correct or all-incorrect responses. The same is done to filter out
persons or attempt with all-correct or all-incorrect answers.
This means the expected item parameters in the characterization test had
to be updated, because we previously didn't prune iteratively.
- Changed the string of the save button for remote settings config: its
  more specific AND behat checks for the default save string when doing
  another test and having two buttons with that string on the same page
  made it fail.
- Remove php unit `resetAfterTest()` after converting a unit test to be
  a `basic_testcase`
- Pass some person params as variables to fix pass-by-reference errors
@davidszkiba davidszkiba self-assigned this Dec 6, 2024
@davidszkiba davidszkiba requested a review from eynimeni December 6, 2024 08:47
@eynimeni
Copy link
Contributor

eynimeni commented Dec 9, 2024

actions succeed only for php 7.4 @davidszkiba

This adds checkboxes so that users can opt-in to either share data with a
central hub or to make the instance act as a central hub.

Also, it removes the obsolete `sync_scales` config that was used by just a page
to test submission of items.
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