Skip to content

watamario15/formsclient

Repository files navigation

formsclient

Answering Screen

This is client software for a forms-like system written in Flutter 3. The server is here (private).

For deployments, visit Releases and the web page.

The purpose of this project is to evaluate the pair-programming (watamario15, Nishidaaaa, mittu205). NOT FOR A PRACTICAL USE.

Features

Fetches a form from a server, displays it, users fill it, and users submit it to the server. That's it.

Specs

Uses JSONs to communicate with a server. Samples follow.

A form to fetch:

{
    "result": "ok",
    "id": "1",
    "form": {
        "id": "1",
        "title": "testform",
        "questions": [
            {
                "id": 0,
                "type": "radio",
                "explanation": "Hey! This is radio!",
                "selection": [
                    {
                        "label": 0,
                        "value": "This is first"
                    },
                    {
                        "label": 1,
                        "value": "This is second"
                    },
                    {
                        "label": 2,
                        "value": "This is third"
                    }
                ]
            },
            {
                "id": 1,
                "type": "text",
                "explanation": "Hey! This is text!"
            }
        ]
    }
}

An answer to submit:

{
    "id": "1",
    "answers": [
        {
            "id": 0,
            "type": "radio",
            "value": {
                "0": false,
                "1": true,
                "2": true
            }
        },
        {
            "id": 1,
            "type": "text",
            "value": "This is my answer."
        }
    ]
}

Collected answers to receive from a server (not implemented)

{
    "result": "ok",
    "id": "1",
    "answers": [
        {
            "id": "1",
            "answers": [
                {
                    "id": 0,
                    "type": "radio",
                    "value": {
                        "0": false,
                        "1": true,
                        "2": true
                    }
                },
                {
                    "id": 1,
                    "type": "text",
                    "value": "This is my answer."
                }
            ]
        },
        {
            "id": "1",
            "answers": [
                {
                    "id": 0,
                    "type": "radio",
                    "value": {
                        "0": true,
                        "1": false,
                        "2": true
                    }
                },
                {
                    "id": 1,
                    "type": "text",
                    "value": "This is my 2nd answer."
                }
            ]
        }
    ]
}