{"id":22455771,"url":"https://github.com/theapache64/qpool","last_synced_at":"2025-03-27T13:20:45.601Z","repository":{"id":86799665,"uuid":"176408469","full_name":"theapache64/qpool","owner":"theapache64","description":"An android library to create a questionnaire/feedback application  ","archived":false,"fork":false,"pushed_at":"2019-03-19T04:42:40.000Z","size":315,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-02-01T17:44:00.565Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Kotlin","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/theapache64.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-03-19T02:38:40.000Z","updated_at":"2021-01-26T11:33:17.000Z","dependencies_parsed_at":"2023-06-05T22:45:47.080Z","dependency_job_id":null,"html_url":"https://github.com/theapache64/qpool","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/theapache64%2Fqpool","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/theapache64%2Fqpool/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/theapache64%2Fqpool/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/theapache64%2Fqpool/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/theapache64","download_url":"https://codeload.github.com/theapache64/qpool/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245850358,"owners_count":20682647,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-12-06T07:13:23.855Z","updated_at":"2025-03-27T13:20:45.594Z","avatar_url":"https://github.com/theapache64.png","language":"Kotlin","readme":"# qpool\nAn android library to create a questionnaire/feedback application  \n\n## Installation\n\n```groovy\nimplementation 'com.theah64.qpool:qpool:1.0.0'\n```\n\n## Usage\n\n1. Create a class and extend it from `QPoolActivity`\n\n```kotlin\nclass MyQuestionnaireActivity : QPoolActivity() {\n\n}\n```\n\n2. Override `abstract` methods\n\n```kotlin\n\nclass MyQuestionnaireActivity : QPoolActivity() {\n    override fun getQuestions(): Array\u003cout Question\u003e {\n        TODO(\"not implemented\") //To change body of created functions use File | Settings | File Templates.\n    }\n\n    override fun onSurveyFinished(answers: List\u003cAnswer\u003e) {\n        TODO(\"not implemented\") //To change body of created functions use File | Settings | File Templates.\n    }\n\n}\n```\n\n- `getQuestions` will be called when the component ready to render questions.\nIn this method, you should return the questions you want to display.\n\nThere are 4 types of question\n\n|  Types            | Description                       |\n|-------------------|-----------------------------------|\n|RadioQuestion      | Question with single choice       |\n|CheckBoxQuestion   | Question with multiple choice     |\n|FactualQuestion    | Question with custom text input   |\n|TimeQuestion       | Question with time input          |\n\n\n- `onSurveyFinished` will be called when the survery/questionnaire got finished.\nThis method will give you a `List` of answers. \n\n3. Now try starting the `Activity` as usual\n\n```kotlin\nstartActivity(Intent(this, MyQuestionnaireActivity))\n```\n\nNOTE: (Don't forgot to add the activity to `AndroidManifest` file.)\n\n \n### Example Usage\n\n```kotlin\nclass MyQuestionnaireActivity : QPoolActivity() {\n\n    /**\n     * Questions to be asked\n     */\n    override fun getQuestions(): Array\u003cout Question\u003e {\n\n        //TODO: Replace dummy questions with real questions\n        return arrayOf(\n\n            // Favorite Language\n            RadioQuestion(\n                question = \"Which is your favorite language ?\",\n                option1 = \"Kotlin\",\n                option2 = \"Java\",\n                option3 = \"Python\",\n                option4 = \"Other\",\n                imageUrl = getImageUrl(1)\n            ),\n\n            // Favorite Project\n            RadioQuestion(\n                question = \"Which is your favorite project ?\",\n                option1 = \"Retrofit\",\n                option2 = \"RxAndroid\",\n                option3 = \"ButterKnife\",\n                option4 = \"Other\",\n                imageUrl = getImageUrl(2)\n            ),\n\n            // Favorite Food\n            FactualQuestion(\n                question = \"Which is your favorite food ?\",\n                imageUrl = getImageUrl(3)\n            ),\n\n            // Hobby\n            CheckBoxQuestion(\n                question = \"What are your hobbies other than programming ?\",\n                option1 = \"Gaming\",\n                option2 = \"Reading\",\n                option3 = \"Travelling\",\n                option4 = getString(R.string.option_none),\n                imageUrl = getImageUrl(6)\n            ),\n\n            // Sleep time\n            TimeQuestion(\n                question = \"What time do you sleep ?\",\n                imageUrl = getImageUrl(4)\n            ),\n\n            // Wake-up time\n            TimeQuestion(\n                question = \"What time do you wake up?\",\n                imageUrl = getImageUrl(5)\n            )\n        )\n    }\n\n    /**\n     * When survey gets finished, this method will get invoked\n     */\n    override fun onSurveyFinished(answers: List\u003cAnswer\u003e) {\n\n        // Showing a thank you dialog\n        val thankYouDialog = AlertDialog.Builder(this)\n            .setTitle(\"Congratulations\")\n            .setCancelable(false)\n            .setMessage(\"You've finished the interview.\")\n            .setPositiveButton(android.R.string.ok) { _: DialogInterface, _: Int -\u003e\n                doSomethingWithTheAnswers(answers)\n            }.create()\n\n        thankYouDialog.show()\n    }\n\n}\n```\n\n### Other features\n\nIf you want to show a greeting message on the activity start, you can override the \n`getWelcomeMessageWithTitle` method, and return a `Pair` of `String`. The first `String`\ndenotes the title and the second one denotes the message to be displayed.\n The alert message will be only displayed at the initial startup of the activity and will not show it again. \n This is achieved with the help of `SharedPreference`: \n \n```kotlin\noverride fun getWelcomeMessageWithTitle(): Pair\u003cString, String\u003e? {\n        return Pair(\"Hi Jake\", \"Thank you for trying this app! :)\")\n}\n```\n\n### Projects that using qpool\n\n- [AskWharton](https://github.com/theapache64/ask-wharton)\n\n### Author\n\ntheapache64\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftheapache64%2Fqpool","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftheapache64%2Fqpool","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftheapache64%2Fqpool/lists"}