zooniverse / wildcam-gorongosa-education

This is WildCam Labs, the education/exploration-oriented extension of the WildCam Gorongosa project.
https://lab.wildcamgorongosa.org/
Apache License 2.0
0 stars 1 forks source link

Can we View/Edit Assignments? #300

Closed shaunanoordin closed 7 years ago

shaunanoordin commented 7 years ago

@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.

simoneduca commented 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.

shaunanoordin commented 7 years ago

Ah, OK, that puts the problem into focus! Thanks Simone.

Issue

Users cannot Edit an existing Assignment.

Analysis

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.

screen shot 2016-09-21 at 14 45 39

Therefore, Teachers can never successfully Edit an Assignment. (i.e. clicking Submit will show an error alert().)

Status

Investigating Solution

shaunanoordin commented 7 years ago

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.