ThukuWakogi / staff-competency-assessment

MIT License
1 stars 3 forks source link

Get assessments #20

Open ThukuWakogi opened 4 years ago

ThukuWakogi commented 4 years ago

Create endpoint to serve assessments and their results.

Steve-design commented 4 years ago

Done enhancement

ThukuWakogi commented 4 years ago

Get assessments is not yet complete @Steve-design When requested for a particular assessment the json returned be formatted as

{
    "assessment_id": 1,
    "assessments": [
        {
            "user": {
                "id": 1,
                "results": [
                    {
                        "competency": {
                            "id": 1,
                            "strands": [
                                {
                                    "id": 1,
                                    "rating_id": 3
                                },
                                {
                                    "id": 2,
                                    "rating_id": 2
                                },
                                {
                                    "id": 3,
                                    "rating_id": 1
                                }
                            ]
                        }
                    },
                    {
                        "competency": {
                            "id": 1,
                            "strands": [
                                {
                                    "id": 1,
                                    "rating_id": 3
                                },
                                {
                                    "id": 2,
                                    "rating_id": 2
                                },
                                {
                                    "id": 3,
                                    "rating_id": 1
                                }
                            ]
                        }
                    },
                    {
                        "competency": {
                            "id": 1,
                            "strands": [
                                {
                                    "id": 1,
                                    "rating_id": 3
                                },
                                {
                                    "id": 2,
                                    "rating_id": 2
                                },
                                {
                                    "id": 3,
                                    "rating_id": 1
                                }
                            ]
                        }
                    },
                    {
                        "competency": {
                            "id": 1,
                            "strands": [
                                {
                                    "id": 1,
                                    "rating_id": 3
                                },
                                {
                                    "id": 2,
                                    "rating_id": 2
                                },
                                {
                                    "id": 2,
                                    "rating_id": 2
                                },
                                {
                                    "id": 3,
                                    "rating_id": 1
                                }
                            ]
                        }
                    },
                    {
                        "competency": {
                            "id": 1,
                            "strands": [
                                {
                                    "id": 1,
                                    "rating_id": 3
                                },
                                {
                                    "id": 2,
                                    "rating_id": 2
                                },
                                {
                                    "id": 3,
                                    "rating_id": 1
                                }
                            ]
                        }
                    }
                ]
            }
        },
        {
            "user": {
                "id": 1,
                "results": [
                    {
                        "competency": {
                            "id": 1,
                            "strands": [
                                {
                                    "id": 1,
                                    "rating_id": 3
                                },
                                {
                                    "id": 2,
                                    "rating_id": 2
                                },
                                {
                                    "id": 3,
                                    "rating_id": 1
                                }
                            ]
                        }
                    },
                    {
                        "competency": {
                            "id": 1,
                            "strands": [
                                {
                                    "id": 1,
                                    "rating_id": 3
                                },
                                {
                                    "id": 2,
                                    "rating_id": 2
                                },
                                {
                                    "id": 3,
                                    "rating_id": 1
                                }
                            ]
                        }
                    },
                    {
                        "competency": {
                            "id": 1,
                            "strands": [
                                {
                                    "id": 1,
                                    "rating_id": 3
                                },
                                {
                                    "id": 2,
                                    "rating_id": 2
                                },
                                {
                                    "id": 3,
                                    "rating_id": 1
                                }
                            ]
                        }
                    },
                    {
                        "competency": {
                            "id": 1,
                            "strands": [
                                {
                                    "id": 1,
                                    "rating_id": 3
                                },
                                {
                                    "id": 2,
                                    "rating_id": 2
                                },
                                {
                                    "id": 2,
                                    "rating_id": 2
                                },
                                {
                                    "id": 3,
                                    "rating_id": 1
                                }
                            ]
                        }
                    },
                    {
                        "competency": {
                            "id": 1,
                            "strands": [
                                {
                                    "id": 1,
                                    "rating_id": 3
                                },
                                {
                                    "id": 2,
                                    "rating_id": 2
                                },
                                {
                                    "id": 3,
                                    "rating_id": 1
                                }
                            ]
                        }
                    }
                ]
            }
        }
    ]
}
ThukuWakogi commented 4 years ago

Code should be pushed to feature-get-assessments git fetch then git checkout feature-get-assessments