With a number of reviews comes a number of possibilities...
Definition of Done
[x] A user must be able to read the number of reviews done to a visited grant program
[x] A user must be able to read the average review score for a visited grant program, if 1 review or more were done
[x] A user must be able to read the number of reviews done per score, for a visited grant program, if 1 review or more were done
[x] A user must be able to read the average interval that a grant program is reviewed, if 1 review or more were done
[x] A user must be able to click the "+ Add Review" button
[x] A user must be able to see this nicely displayed in mobile, tablet and desktop views. Please adjust the design as necessary to achieve so (Example: instead of using vertical dividers in this section, as proposed for desktop views, use horizontal ones for mobile and tablet views)
How to do so?
Number of reviews
Simply gather the length of the reviews array of the visited grant program.
Average interval
Gather the timestamp of the first review of a grant program and gather the timestamp of the "now" moment. With T1 and T2 (timestamp 1 and 2), do T1 - T2 to get to know the interval time between these times. Divide this interval by the number of reviews the grant program has. This result, this timestamp, represents the interval of time that it is taking for the grant program to receive a review. Lastly, transform the timestamp to a readable information: use "per day", "per week", "per month", "per year" labels if the interval is less than a 1 year.
Example:
3 days interval messages: "Typically reviewed 2 times per week"
1 day interval messages: "Typically reviewed 1 time per day"
7 days interval messages: "Typically reviewed 1 time per week"
21 days interval messages: "Typically reviewed 1 time per month"
18 days interval messages: "Typically reviewed 1 time per month"
32 days interval messages: "Typically reviewed 11 times per year"
365 days interval messages: "Typically reviewed 1 time per year"
366 days interval messages: "Typically reviewed each 366 days"
Average review
Sum all the reviews scores and divide this number by the number of reviews summed.
Reviews per score
Math.round() each review and set each one into a bucket between the 5 possible ones (1 star, 2 stars, 3 stars, 4 stars or 5 stars)... After this, divide each bucket length by the total number of reviews to gather the percentage each bucket has of all the reviews.
Feature Request
With a number of reviews comes a number of possibilities...
Definition of Done
How to do so?
Number of reviews Simply gather the length of the reviews array of the visited grant program.
Average interval Gather the timestamp of the first review of a grant program and gather the timestamp of the "now" moment. With T1 and T2 (timestamp 1 and 2), do T1 - T2 to get to know the interval time between these times. Divide this interval by the number of reviews the grant program has. This result, this timestamp, represents the interval of time that it is taking for the grant program to receive a review. Lastly, transform the timestamp to a readable information: use "per day", "per week", "per month", "per year" labels if the interval is less than a 1 year.
Example:
3 days interval messages: "Typically reviewed 2 times per week" 1 day interval messages: "Typically reviewed 1 time per day" 7 days interval messages: "Typically reviewed 1 time per week" 21 days interval messages: "Typically reviewed 1 time per month" 18 days interval messages: "Typically reviewed 1 time per month" 32 days interval messages: "Typically reviewed 11 times per year" 365 days interval messages: "Typically reviewed 1 time per year" 366 days interval messages: "Typically reviewed each 366 days"
Average review Sum all the reviews scores and divide this number by the number of reviews summed.
Reviews per score Math.round() each review and set each one into a bucket between the 5 possible ones (1 star, 2 stars, 3 stars, 4 stars or 5 stars)... After this, divide each bucket length by the total number of reviews to gather the percentage each bucket has of all the reviews.
Design specifications
Can be found in this Figma artboard
You should look for this section: