Coder Social home page Coder Social logo

quickbirdeng / surveykit Goto Github PK

View Code? Open in Web Editor NEW
387.0 11.0 69.0 4.55 MB

Android library to create beautiful surveys (aligned with ResearchKit on iOS)

License: MIT License

Kotlin 96.66% Shell 3.34%
survey android-library kotlin-android kotlin ios-researchkit-surveys android forms study-conduct clinical-trials medical poll research data

surveykit's Introduction

SurveyKit: Create beautiful surveys on Android (inspired by ResearchKit Surveys on iOS)

Do you want to display a questionnaire to get the opinion of your users? A survey for a medical trial? A series of instructions in a manual-like style?
SurveyKit is an Android library that allows you to create exactly that.

Thematically it is built to provide a feeling of a professional research survey. The library aims to be visually clean, lean and easily configurable. We aim to keep the functionality close to iOS ResearchKit Surveys.

This is an early version and work in progress. Do not hesitate to give feedback, ideas or improvements via an issue.

Examples

Flow

Screenshots

๐Ÿ“š Overview: Creating Research Surveys

What SurveyKit does for you

  • Simplifies the creation of surveys
  • Provides rich animations and transitions out of the box (custom animations planned)
  • Build with a consistent, lean, simple style, to fit research purposes
  • Survey navigation can be linear or based on a decision tree (directed graph)
  • Gathers results and provides them in a convinient manner to the developer for further use
  • Gives you complete freedom on creating your own questions
  • Allows you to customize the style
  • Provides an API and structure that is very similar to iOS ResearchKit Surveys
  • Is used in production by Quickbird Studios

What SurveyKit does not (yet) do for you

As stated before, this is an early version and a work in progress. We aim to extend this library until it matches the functionality of the iOS ResearchKit Surveys.

๐Ÿƒ Library Setup

All of the available versions of SurveyKit has been moved to MavenCentral.

1. Add the repository

SurveyKit is now available via MavenCentral which is normally added as part of every new Android project. However, if it is not present, you can add it as show here.

allprojects {
    repositories {
        mavenCentral()
    }
}

2. Add the dependency

build.gradle.kts

dependencies {
    implementation(project("com.quickbirdstudios:surveykit:1.1.0"))
}

Find the latest version or all releases

๐Ÿ’ป Usage

Example

A working example project can be found HERE

Add and Find the Survey in the XML

Add the SurveyView to your xml (it looks best if it fills the screen).

<com.quickbirdstudios.survey_kit.survey.SurveyView
    android:id="@+id/survey_view"
    android:layout_width="match_parent"
    android:layout_height="match_parent" />

Find the view in the xml and save it for further use.

var surveyView: SurveyView = view.findViewById(R.id.survey_view)

Create survey steps

To create a step, create an instance of one of these 3 classes:

InstructionStep

InstructionStep(
    title = R.string.intro_title,
    text = R.string.intro_text,
    buttonText = R.string.intro_start
)

The title is the general title of the Survey you want to conduct.
The text is, in this case, the introduction text which should give an introduction, about what the survey is about.
The buttonText specifies the text of the button, which will start the survey. All of these properties have to be resource Ids.

CompletionStep

CompletionStep(
    title = R.string.finish_question_title,
    text = R.string.finish_question_text,
    buttonText = R.string.finish_question_submit
)

The title is the general title of the Survey you want to conduct, same as for the InstructionStep.
The text is here should be something motivational: that the survey has been completed successfully.
The buttonText specifies the text of the button, which will end the survey. All of these properties have to be resource Ids.

QuestionStep

QuestionStep(
    title = R.string.about_you_question_title,
    text = R.string.about_you_question_text,
    answerFormat = AnswerFormat.TextAnswerFormat(
        multipleLines = true,
        maximumLength = 100
    )
)

The title same as for the InstructionStep and CompletionStep.
The text the actual question you want to ask. Depending on the answer type of this, you should set the next property.
The answerFormat specifies the type of question (the type of answer to the question) you want to ask. Currently there these types supported:

  • TextAnswerFormat
  • IntegerAnswerFormat
  • ScaleAnswerFormat
  • SingleChoiceAnswerFormat
  • MultipleChoiceAnswerFormat
  • LocationAnswerFormat

All that's left is to collect your steps in a list.

val steps = listOf(step1, step2, step3, ...)

Create a Task

Next you need a task. Each survey has exactly one task. A Task is used to define how the user should navigate through your steps.

OrderedTask

val task = OrderedTask(steps = steps)

The OrderedTask just presents the questions in order, as they are given.

NavigableOrderedTask

val task = NavigableOrderedTask(steps = steps)

The NavigableOrderedTask allows you to specify navigation rules.
There are two types of navigation rules:
With the DirectStepNavigationRule you say that after this step, another specified step should follow.

task.setNavigationRule(
    steps[4].id,
    NavigationRule.DirectStepNavigationRule(
        destinationStepStepIdentifier = steps[6].id
    )
)



With the MultipleDirectionStepNavigationRule you can specify the next step, depending on the answer of the step.

task.setNavigationRule(
    steps[6].id,
    NavigationRule.MultipleDirectionStepNavigationRule(
        resultToStepIdentifierMapper = { input ->
            when (input) {
                "Yes" -> steps[7].id
                "No" -> steps[0].id
                else -> null
            }
        }
    )
)

Evaluate the results

When the survey is finished, you get a callback. No matter of the FinishReason, you always get all results gathered until now.
The TaskResult contains a list of StepResults. The StepResult contains a list of QuestionResults.

surveyView.onSurveyFinish = { taskResult: TaskResult, reason: FinishReason ->
    if (reason == FinishReason.Completed) {
        taskResult.results.forEach { stepResult ->
            Log.e("logTag", "answer ${stepResult.results.firstOrNull()}")
        }
    }
}

Style

These is how you add custom styling to your survey. We'll add even more options in the future.

val configuration = SurveyTheme(
    themeColorDark = ContextCompat.getColor(requireContext(), R.color.cyan_dark),
    themeColor = ContextCompat.getColor(requireContext(), R.color.cyan_normal),
    textColor = ContextCompat.getColor(requireContext(), R.color.cyan_text)
)

Start the survey

All that's left is to start the survey and enjoy.๐ŸŽ‰๐ŸŽŠ

surveyView.start(task, configuration)

Cancel Survey dialog

When you cancel the survey, there is an option to change dialog default Strings. Must be imported from resources.

val configuration = SurveyTheme(
            themeColorDark = ContextCompat.getColor(this, R.color.cyan_dark),
            themeColor = ContextCompat.getColor(this, R.color.cyan_normal),
            textColor = ContextCompat.getColor(this, R.color.cyan_text),
            abortDialogConfiguration = AbortDialogConfiguration(
                title = R.string.title,
                message = R.string.message,
                neutralMessage = R.string.no,
                negativeMessage = R.string.yes
            )
        )

๐Ÿ“ Location steps

You need add below to your own application AndroidManifest.xml file to use Google Map.

  <meta-data
    android:name="com.google.android.gms.version"
    android:value="@integer/google_play_services_version" />

  <meta-data
    android:name="com.google.android.maps.v2.API_KEY"
    android:value="GOOGLE API KEY" />

Also need to append location permissions on AndroidManifest.xml. This is not required. But If you gave this permissions, map can select current location automatically.

    <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
    <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />

You might wanna run location question steps test or example app on this project. Need to add api keys on local.properties file.

google_sdk_key="[API_KEY]"
//if you want to use yandex address suggession on example app
yandex_sdk_key="[API_KEY]"

And finally you can instante location question step like below.

QuestionStep(
    title = "title",
    text = this.resources.getString(R.string.location_question_text),
    lifecycle = lifecycle,
    answerFormat = AnswerFormat.LocationAnswerFormat(
                    lifecycle = lifecycle,
                    //addressProvider = YandexAddressSuggestionProvider(api_key)
                )
    )

Default address provider is GeocoderAddressSuggestionProvider based on android.location.Geocoder. If you want to use custom address provider. You can use AddressSuggestionProvider interface and make your own implements like YandexAddressSuggestionProvider.

๐Ÿ“‡ Custom steps

At some point, you might wanna define your own custom question steps. That could, for example, be a question which prompts the user to pick color values or even sound samples. These are not implemented yet but you can easily create them yourself:

You'll need a CustomResult and a CustomStep. The Result class tells SurveyKit which data you want to save.

@Parcelize
data class CustomResult(
    val customData: String,
    override val stringIdentifier: String,
    override val id: Identifier,
    override val startDate: Date,
    override var endDate: Date
) : QuestionResult, Parcelable

Next you'll need a CustomStep class:

class CustomStep : Step {
    override val isOptional: Boolean = true
    override val id: StepIdentifier = StepIdentifier()
    val tmp = id

    override fun createView(context: Context, stepResult: StepResult?): StepView {
        return object : StepView(context, id, isOptional) {

            override fun setupViews() = Unit

            val root = View.inflate(context, R.layout.example, this)

            override fun createResults(): QuestionResult =
                CustomResult(
                    root.findViewById<EditText>(R.id.input).text.toString(),
                    "stringIdentifier",
                    id,
                    Date(),
                    Date()
                )

            override fun isValidInput(): Boolean = this@CustomStep.isOptional

            override var isOptional: Boolean = this@CustomStep.isOptional
            override val id: StepIdentifier = tmp

            override fun style(surveyTheme: SurveyTheme) {
                // do styling here
            }

            init {
                root.findViewById<Button>(R.id.continue)
                    .setOnClickListener { onNextListener(createResults()) }
                root.findViewById<Button>(R.id.back)
                    .setOnClickListener { onBackListener(createResults()) }
                root.findViewById<Button>(R.id.close)
                    .setOnClickListener { onCloseListener(createResults(), FinishReason.Completed) }
                root.findViewById<Button>(R.id.skip)
                    .setOnClickListener { onSkipListener() }
                root.findViewById<EditText>(R.id.input).setText(
                    (stepResult?.results?.firstOrNull() as? CustomResult)?.customData ?: ""
                )
            }
        }
    }
}

๐Ÿvs๐Ÿค– : Comparison of SurveyKit on Android to ResearchKit on iOS

This is an overview of which features iOS ResearchKit Surveys provides and which ones are already supported by SurveyKit on Android. The goal is to make both libraries match in terms of their functionality.

Steps iOS ResearchKit Android SurveyKit
Instruction โœ… โœ…
Single selection โœ… โœ…
Multi selection โœ… โœ…
Boolean answer โœ… โœ…
Value picker โœ… โœ…
Image choice โœ… โœ…
Numeric answer โœ… โœ…
Time of day โœ… โœ…
Date selection โœ… โœ…
Text answer (unlimited) โœ… โœ…
Text answer (limited) โœ… โœ…
Text answer (validated) โœ… โœ…
Scale answer โœ… โœ…
Email answer โœ… โœ…
Location answer โœ… โœ…

๐Ÿ‘ค Author

This Android library is created with โค๏ธ by QuickBird Studios.

โค๏ธ Contributing

Open an issue if you need help, if you found a bug, or if you want to discuss a feature request.

Open a PR if you want to make changes to SurveyKit.

For the moment, a mandatory requirement for a PR to be accepted is also applying ktlint when submitting this PR.

๐Ÿ“ƒ License

SurveyKit is released under an MIT license. See License for more information.

surveykit's People

Contributors

coroutinedispatcher avatar klausnie avatar kupeliorhun avatar maltebucksch avatar n8fr8 avatar nasirky avatar numoy avatar sellmair avatar yasincidem avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

surveykit's Issues

Can not create Form Step

I wanted to have a Step in which I can add multiple questions/Steps for the same screen. So that I can have mix of survey questions with single Questions in one screen as well as in a few screens/step in can show multiple questions.
How to do it?

Customize "Cancel, Next" Button and Alert "Cancel"

Hi how are things!

It would be good if they update the "Cancel, Next" buttons and the "Cancel" alert and change it from the "String" file but it remains the same and does not change the text, it would be of great help.

Cheers!

IllegalStateException when cancelling a questionnaire

Library throws the following error when trying to cancel a ongoing questionnaire.

java.lang.IllegalStateException: Already resumed
        at kotlin.coroutines.SafeContinuation.resumeWith(SafeContinuationJvm.kt:45)
        at com.quickbirdstudios.surveykit.backend.presenter.PresenterImpl$showAndWaitForResult$$inlined$suspendCoroutine$lambda$2.invoke(PresenterImpl.kt:70)
        at com.quickbirdstudios.surveykit.backend.presenter.PresenterImpl$showAndWaitForResult$$inlined$suspendCoroutine$lambda$2.invoke(PresenterImpl.kt:17)
        at com.quickbirdstudios.surveykit.backend.views.step.QuestionView$setupViews$5.invoke(QuestionView.kt:103)
        at com.quickbirdstudios.surveykit.backend.views.step.QuestionView$setupViews$5.invoke(QuestionView.kt:51)
        at com.quickbirdstudios.surveykit.backend.views.main_parts.Header$$special$$inlined$apply$lambda$1.onClick(Header.kt:70)
        at android.view.View.performClick(View.java:7259)
        at android.view.View.performClickInternal(View.java:7236)
        at android.view.View.access$3600(View.java:801)
        at android.view.View$PerformClick.run(View.java:27892)
        at android.os.Handler.handleCallback(Handler.java:883)
        at android.os.Handler.dispatchMessage(Handler.java:100)
        at android.os.Looper.loop(Looper.java:214)
        at android.app.ActivityThread.main(ActivityThread.java:7356)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:930)

IllegalStateException: Already resumed

Just click through the example app.
Submit Survey Button seems to do nothing on first click, the second click will lead to the following stacktrace

2019-11-27 11:31:04.037 16930-16930/com.quickbirdstudios.example E/AndroidRuntime: FATAL EXCEPTION: main
    Process: com.quickbirdstudios.example, PID: 16930
    java.lang.IllegalStateException: Already resumed
        at kotlin.coroutines.SafeContinuation.resumeWith(SafeContinuationJvm.kt:45)
        at com.quickbirdstudios.surveykit.backend.presenter.PresenterImpl$showAndWaitForResult$$inlined$suspendCoroutine$lambda$1.invoke(PresenterImpl.kt:62)
        at com.quickbirdstudios.surveykit.backend.presenter.PresenterImpl$showAndWaitForResult$$inlined$suspendCoroutine$lambda$1.invoke(PresenterImpl.kt:17)
        at com.quickbirdstudios.surveykit.backend.views.step.QuestionView$onViewCreated$1.invoke(QuestionView.kt:122)
        at com.quickbirdstudios.surveykit.backend.views.step.QuestionView$onViewCreated$1.invoke(QuestionView.kt:51)
        at com.quickbirdstudios.surveykit.backend.views.main_parts.Footer$$special$$inlined$apply$lambda$1.onClick(Footer.kt:64)
        at android.view.View.performClick(View.java:6669)
        at android.view.View.performClickInternal(View.java:6638)
        at android.view.View.access$3100(View.java:789)
        at android.view.View$PerformClick.run(View.java:26145)
        at android.os.Handler.handleCallback(Handler.java:873)
        at android.os.Handler.dispatchMessage(Handler.java:99)
        at android.os.Looper.loop(Looper.java:193)
        at android.app.ActivityThread.main(ActivityThread.java:6898)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:537)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)

"Submit Survey" button not clickable after click one time

I finish the survey and clicked the submit survey button after that I tried to click again but button is not clickable.
All I want to do that I want to click last button many times. I couldn't find how to enable clickable last button.

add customizable "cancel" button

Hi!
It will be good to have customizable cancel button, because now I can't event change label, so I'm stuck with english "cancel".

Best regards!

Recommendation: Moving Strings in Cancel survey Popup to string resources file

Recommendation: Moving Strings in Cancel survey Popup to string resources file so that we can add localization

Currently resources show these values only

#000000 #80000000 #3D3D3D #3CD0DF #853CD0DF #33C5D4 #807A7A7A #F3F3F3 #807A7A7A #337A7A7A #807A7A7A #00FFFFFF #FFFFFF 4dp 40dp 12dp 20dp 20dp 20dp 16sp 0dp 28sp 8dp 28sp 16dp 20sp 32sp 4dp 12dp 24dp 6dp Tell us about yourself and why you want to improve your health. Tell us about you Penicillin Latex Pet Pollen Do you have any allergies that we should be aware of? Known allergies Cancel Finish Submit survey Thanks for taking the survey, we will contact you soon! Done! 5 1 Select your body type How old are you? Let\'s go! Get ready for a bunch of super random questions! Welcome to the\nQuickBird Studios\nHealth Survey Next No We are done, do you mind to tell us more about yourself? Done? Start Yes

Cancel and Skip won't work

AbortDialogConfiguration is not present in the current version 1.1.0, still, the Cancel button triggers an alert where the actual cancel doesn't navigate to any page but freeze the survey.
The skip button button_skip_question in the footer does not have a text "Skip" set to it. So it just creates a button without text. Only header has a theme set in QuestionView.style().

Change string values of cancel dialog box

Hi, I downloaded the survey kit the last week, but I can't change the string values used in the dialog box that is displayed when the user clicks on the cancel button. Could you help me, please? Thank you in advance.

Setup instruction is out-dated

Change the example code from

<com.quickbirdstudios.survey_kit.public_api.survey.SurveyView
    android:id="@+id/survey_view"
    android:layout_width="match_parent"
    android:layout_height="match_parent" />

To

<com.quickbirdstudios.surveykit.survey.SurveyView
    android:id="@+id/survey_view"
    android:layout_width="match_parent"
    android:layout_height="match_parent" />

Otherwise a runtime error is thrown
[...] Caused by: android.view.InflateException: Binary XML file line #8: Error inflating class com.quickbirdstudios.survey_kit.public_api.survey.SurveyView [...]

Java version

Just wondering is there a way to incorporate SurveyKit for the use of a Android Studio for Java project?

Unable to add this as a part of our project

ERROR: Plugin [id: 'org.jetbrains.kotlin.android'] was not found in any of the following sources:

  • Gradle Core Plugins (plugin is not in 'org.gradle' namespace)
  • Plugin Repositories (plugin dependency must include a version number for this source)

Step constructors....resource INTS or STRINGS?

Hello all! This is a wonderful API and thank you for creating it.

I've downloaded (via ZIP) the current code base for SurveyKit and am working through the process of making my own survey. In the ZIPPED code, all of the Step derived classes seem to require String? objects. For example:

open class InstructionStep(
private val title: String? = null,
private val text: String? = null,
private val buttonText: String = "Start",
...
}

That is great! However when I make a new project and bring in version 1.0.0 of SurveyKit:

// Bring in the SurveyKit API
// https://github.com/quickbirdstudios/SurveyKit
implementation "com.quickbirdstudios:surveykit:0.1.0"

It appears all of the Step derived classes now want nullable Ints only? For example:

open class InstructionStep(
@StringRes private val title: Int? = null,
@StringRes private val text: Int? = null,
@StringRes private val buttonText: Int = R.string.start,
...
}

For the app I am trying to design, I need to send in String objects directly as I am reading the survey data dynamically at runtime (from an Excel file) and won't have any known resource IDs.

Is there an earlier version of SurveyKit I can pull down that still operates on String constructor parameters?

Thanks for any guidance!

Andrew

Resume survey from last question

Assume I have 15 question survey. Users have completed 10 and user Killed the app from the recent app list and relaunched the survey app again. How to start the survey from the 11th question from where the user left? can I do it with this syrveyKit?

Double click on any buttons inside the survey is crashing

Some users can double click/tap on buttons inside the survey (like Lets Go or Send survey) and its causing to crash

2020-03-17 17:07:42.381 26534-26534/com.tejimandi.beta E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.tejimandi.beta, PID: 26534
java.lang.IllegalStateException: Already resumed
at kotlin.coroutines.SafeContinuation.resumeWith(SafeContinuationJvm.kt:45)
at com.quickbirdstudios.surveykit.backend.presenter.PresenterImpl$showAndWaitForResult$$inlined$suspendCoroutine$lambda$1.invoke(PresenterImpl.kt:62)
at com.quickbirdstudios.surveykit.backend.presenter.PresenterImpl$showAndWaitForResult$$inlined$suspendCoroutine$lambda$1.invoke(PresenterImpl.kt:17)
at com.quickbirdstudios.surveykit.backend.views.step.QuestionView$onViewCreated$1.invoke(QuestionView.kt:122)
at com.quickbirdstudios.surveykit.backend.views.step.QuestionView$onViewCreated$1.invoke(QuestionView.kt:51)
at com.quickbirdstudios.surveykit.backend.views.main_parts.Footer$$special$$inlined$apply$lambda$1.onClick(Footer.kt:64)
at android.view.View.performClick(View.java:6319)
at android.view.View$PerformClick.run(View.java:24955)
at android.os.Handler.handleCallback(Handler.java:790)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:192)
at android.app.ActivityThread.main(ActivityThread.java:6702)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:549)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:826)
2020-03-17 17:07:42.382 26534-26534/com.tejimandi.beta D/App: Alert Already resumed
2020-03-17 17:07:42.384 26534-26534/com.tejimandi.beta E/Utils: java.lang.IllegalStateException: Already resumed
at kotlin.coroutines.SafeContinuation.resumeWith(SafeContinuationJvm.kt:45)
at com.quickbirdstudios.surveykit.backend.presenter.PresenterImpl$showAndWaitForResult$$inlined$suspendCoroutine$lambda$1.invoke(PresenterImpl.kt:62)
at com.quickbirdstudios.surveykit.backend.presenter.PresenterImpl$showAndWaitForResult$$inlined$suspendCoroutine$lambda$1.invoke(PresenterImpl.kt:17)
at com.quickbirdstudios.surveykit.backend.views.step.QuestionView$onViewCreated$1.invoke(QuestionView.kt:122)
at com.quickbirdstudios.surveykit.backend.views.step.QuestionView$onViewCreated$1.invoke(QuestionView.kt:51)
at com.quickbirdstudios.surveykit.backend.views.main_parts.Footer$$special$$inlined$apply$lambda$1.onClick(Footer.kt:64)
at android.view.View.performClick(View.java:6319)
at android.view.View$PerformClick.run(View.java:24955)
at android.os.Handler.handleCallback(Handler.java:790)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:192)
at android.app.ActivityThread.main(ActivityThread.java:6702)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:549)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:826)

json schema

It would be great to have json schema so you can validate the survey task from the backend so you don't have to find out it is not working when a user tries to load it.

Customization Requests

I need to customize the look (left justification of some text, button different colors, square and right justified...)

I can attempt this in a new branch and do a PR, but I don't have authentication to your repo.
I am an experienced programmer but have never contributed to an open source project.

Conditional rule does not trigger when selecting multiple answer (JSON TASK)

I have this issue with the conditional rule for a multiple type question. If i select multiple answers it proceeds to the next stepidentifier.
This is my rule
{ "type": "conditional", "triggerStepIdentifier": { "id": "15" }, "values": { "9": "16", "1": "17", "2": "17", "3": "17", "4": "17", "5": "17", "6": "17", "7": "17", "8": "17" } },

This is the steps. step 17 is a different question i did not include it here. 16 is a text input if they answered "Others" on step 15. but when selecting multiple answers on step 15 that is not "Others" it still proceeds to step 16. It should skip 16 and proceed to 17 base on the conditional rule.
{ "stepIdentifier": { "id": "15" }, "type": "question", "title": "Where did you learn about it? (Please select all that applies.)?", "answerFormat": { "type": "multiple", "textChoices": [ { "text": "Poster", "value": "1" }, { "text": "Teacher/School", "value": "2" }, { "text": "Friend/Acquaintance", "value": "3" }, { "text": "Parents/Sister/Brother/Relatives", "value": "4" }, { "text": "Official Facebook Page", "value": "5" }, { "text": "Website", "value": "6" }, { "text": "Other internet sites", "value": "7" }, { "text": "Satellite Offices", "value": "8" }, { "text": "Others, please specify", "value": "9" } ] } }, { "stepIdentifier": { "id": "16" }, "type": "question", "title": "Where did you learn about it? Please specify", "answerFormat": { "type": "text", "maxLines": 5, "validationRegEx": "^(?!\\s*\\$).+" } },

Location answer

Implement location answer. See ResearchKit for reference on how it should look like.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.