-
Notifications
You must be signed in to change notification settings - Fork 173
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
[Instrument API] expand saving functionality to include Candidate age calculations and scoring #7485
Conversation
… calculations and scoring
@@ -171,7 +171,8 @@ class Instrument extends Endpoint implements \LORIS\Middleware\ETagCalculator | |||
try { | |||
$instrumentname = $this->_instrument->testName; | |||
$this->_instrument->clearInstrument(); | |||
$this->_instrument->_save($data[$instrumentname]); | |||
$this->_instrument->_saveValues($data[$instrumentname]); | |||
$this->_instrument->score(); |
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.
The only thing missing from the validate code path of the save()
function seems to be:
// determine the data entry completion status, and store that in
// the database
$dataEntryCompletionStatus = $this->_determineDataEntryCompletionStatus();
$this->_setDataEntryCompletionStatus(
$dataEntryCompletionStatus
);
why not just add that?
You could also try moving the code into a final public
class method and calling that from both save
and the api
, to ensure that they're always doing the same thing.
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.
can I just move the data entry completion status logic to save values instead ? or you prefer not ?
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 looked into the IBIS and CCNA repositories and on IBIS there's 19 instrument classes that override _saveValues
, mostly to implement instruments that have an uploader. (I think it might be the only way to do it?)
CCNA, on the other hand, has a bunch of scripts that call _saveValues
but no instruments that override it.
It's probably safer to keep it where it is to ensure that it doesn't get missed.
@xlecours can you look at this too? |
@driusan changes done. just curious why you wanted to do it |
I meant including the i'm not opposed to the updateDataEntryCompletionStatus being moved out. It's a little cleaner.. but you're right there's no reason for that to be |
Ohhh I get it. let me remove the final and it'll be ready |
Brief summary of changes
Currently the API only calls the
_save()
function which stores the data sent to it in the appropriate instrument. That workflow is not symmetrical to saving on the front end which computes the age and scores.This PR is not making it 100% symmetrical either since validation is not being added but it gets closer to the target
Testing instructions (if applicable)
Link(s) to related issue(s)