def get(survey_id, collection_exercise_id):

        engine = app.db.engine

        parsed_survey_id = parse_uuid(survey_id)
        if not parsed_survey_id:
            logger.debug(
                "Responses dashboard endpoint received malformed survey ID",
                invalid_survey_id=survey_id)
            abort(400, "Malformed survey ID")

        parsed_collection_exercise_id = parse_uuid(collection_exercise_id)
        if not parsed_collection_exercise_id:
            logger.debug(
                "Responses dashboard endpoint received malformed collection exercise ID",
                invalid_collection_exercise_id=collection_exercise_id,
            )
            abort(400, "Malformed collection exercise ID")

        try:
            report = get_report(parsed_survey_id,
                                parsed_collection_exercise_id, engine)
        except NoDataException:
            abort(404, "Invalid collection exercise or survey ID")

        response = {
            "metadata": {
                "timeUpdated": datetime.now().timestamp(),
                "collectionExerciseId": collection_exercise_id
            },
            "report": report,
        }

        return Response(json.dumps(response), content_type="application/json")
 def test_valid_uuid(self):
     collex_id = parse_uuid('00000000-0000-00000000-000000000000')
     self.assertTrue(collex_id)
 def test_malformed_uuid(self):
     collex_id = parse_uuid('this-is-not-a-valid-uuid')
     self.assertFalse(collex_id)