Closed shaunanoordin closed 7 years ago
That's by design. Only subjects and students cannot be edited, so "View/Edit" seems still apt. The decision to limit what can be edited stemmed from the fact that it is yet not clear how to handle that in the backend, i.e. a non-trivial amount of work needs to go into that.
Ah, OK, that puts the problem into focus! Thanks Simone.
Users cannot Edit an existing Assignment.
The Edit Assignment tries to enforce the "must have Students > 0 and Subjects > 0, AND Subjects > Images per Student" rule, but Subjects is always 0 when Editing an existing Assignment.
Therefore, Teachers can never successfully Edit an Assignment. (i.e. clicking Submit will show an error alert().)
Investigating Solution
Minor update: So I've discovered that the error messages only appear on the live production
site, but not on our localhost`. This is because of...
//TESTING: localhost uses 'Bacon' Zooniverse project for Subject IDs.
//WildCam Gorongosa has no Staging data that we can use to create Subjects.
//Therefore, we need to hardcode some Subject IDs.
//--------
if (window.location.hostname === 'localhost') {
newAssignment.subjects = [
'4077',
'4079',
'4078',
'4076',
'4080',
'4075',
];
}
//--------
So on localhost
, when VIEWING/EDITING an Assignment, newAssignment.subjects
will always have a valid list of subjects. But on production
, it'll be undefined
.
@simoneduca I need some refreshers on this - do we allow users to Edit Assignments?
I received an e-mail from Milena Tsvetkova of the OII with the following query/request: "I further have another question — is it intentional that I cannot edit the students and the subject selection once the assignment is created and I click on the “View/Edit” action? Any chance you can make these fields editable so that I don’t have to create a new assignment if I mess it up."
If we're making users unable to edit Assignments on purpose, I'll need to change the "View/Edit" button to just "View". If users are suppose to be able to Edit Assignments, then a larger fix is needed as it seems non-functional at the moment.