djaodjin / djaopsp

Practices Survey Platform - Assess against best practices assessment and improvement planning
BSD 2-Clause "Simplified" License
3 stars 6 forks source link

Allow multiple active assessments #349

Closed smirolo closed 3 years ago

smirolo commented 3 years ago

old-vs-new-app-page

In the vue app page, it should be possible to:

  1. See more than one assessment in progress (See 'updates' field in /api/<organization>/benchmark/historical/ API).
  2. Create a new assessment unrelated to the ones currently in progress.
quiaro commented 3 years ago

My understanding per previous conversations and review of the UI:

Would you please confirm?

smirolo commented 3 years ago

There are multiple active assessments at any given moment and it is possible to create more active assessments.

Now an assessment consists of a Sample and an industry segment. Currently an industry segment is defined by an industry segment path. Since the industry segment is not tied to a Sample through the campaign field as you would expect, the only way to deduce assessments from the (only) "is_frozen": false sample returned by /api/supplier-1/sample/ is to look at the answers and build candidate industry segments.

The easier way is to call the /api/supplier-1/benchmark/history/ API and look at the "updates" field.

quiaro commented 3 years ago

@smirolo if a user creates an assessment but hasn’t answered any questions, what would the updates field look like in the response from https://www.tspproject.org/docs/api/#RetrieveHistoricalScore?

smirolo commented 3 years ago
Query:http://localhost:8000/envconnect/api/supplier-2/benchmark/historical/
HTTP response:
{
  "results": [],
  "updates": []
}

Since there are no answers, there are no industry segments that can be derived.

smirolo commented 3 years ago

A "continue assessment" button should be inside each assessment card. A button to start on a new industry segment should always be visible.

quiaro commented 3 years ago

Would /api/{organization}/sample/ be deprecated? https://www.tspproject.org/docs/api/#RetrieveHistoricalScore seems to provide the same (plus additional) information.

smirolo commented 3 years ago

We still need /api/{organization}/sample/ to POST (i.e. create) a new assessment.

quiaro commented 3 years ago

@smirolo in the results section of the response for https://www.tspproject.org/docs/api/#RetrieveHistoricalScore:

"results": [
    {
      "key": "May 2018",
      "created_at": "2018-05-28T17:39:59.368272Z",
      "values": [
        [
          "Construction",
          80,
          "/app/supplier-1/assess/ce6dc2c4cf6b40dbacef91fa3e934eed/sample/boxes-and-enclosures/"
        ]
      ]
    },
    ...

1) Will the values array only ever have one element? … or when would it be able to have more than one element? 2) What does the number 80 stand for?

smirolo commented 3 years ago

Usage example in envconnect/templates/envconnect/app.html

quiaro commented 3 years ago

If a user has already created and is currently filling in an assessment for the Construction industry segment, should Construction be removed from the industry list i.e. should the UI prevent users from having more than one active assessment for the same industry segment?

smirolo commented 3 years ago

Yes. Or maybe better would to write "Continue" next to the industry item in the dropdown list.