Code Monkey home page Code Monkey logo

survey_kit's People

Contributors

adar2378 avatar edlose16b avatar ezmegy avatar gafar-code avatar hamid313-coder avatar hugoviktor avatar ignertic avatar incro avatar joshua27 avatar maltebucksch avatar massimomartinelli avatar miguel-a-calles-mba avatar numoy avatar petcupaula avatar saiful-apx avatar soaresg avatar zeshuaro 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

survey_kit's Issues

How can I have several questions in a single step?

I am looking for a way to have multiple questions in a single QuestionStep which would result in a better user experience in my case. Is there a clear way to do so or would this be considered a CustomStep?
Thanks!

First question textChoices repeating for every question when answerFormat: SingleChoiceAnswerFormat has been added for multiple steps

I have added the question to survey kit in below format.


   steps.add(InstructionStep(
      title: 'Welcome to Lab Survey',
      text: 'Get ready for a bunch of questions!',
      buttonText: 'Let\'s go!',
    ));
    steps.add(
      QuestionStep(
        title: 'Done?',
        text: 'We are done, do you mind to tell us more about yourself?',
        answerFormat: SingleChoiceAnswerFormat(
          textChoices: [
            TextChoice(text: 'Yes', value: 'Yes'),
            TextChoice(text: 'No', value: 'No'),
          ],
        ),
      ),
    );
    steps.add(
      QuestionStep(
        title: 'Done?',
        text: 'kjdsfkjaskdfj?',
        answerFormat: SingleChoiceAnswerFormat(
          textChoices: [
            TextChoice(text: 'none', value: 'none'),
            TextChoice(text: 'none', value: 'noe'),
          ],
        ),
      ),
    );

and returning the task to suveyKit task,

 var task = NavigableTask(id: TaskIdentifier(), steps: steps);
 return task;

Issue is on pressing next, the question changes but options remain the same.

Completion Step when loaded from json file

Hello, the completion step when loaded from a JSON file does not seem to work as expected. When one gets to the end of the survey and on clicking the submit button, it just goes back to the beginning. How can I correct this behavior please?

Survey in Jetpack Compose

Hi, I am currently migrating an app to Jetpack Compose, is there any version which can be used directly with compose?

Thanks a lot.

Conditional Statement for Navigation Rule

Hi, sorry for my bad english, i want to know if it is possible to create navigation rule from 2 step identifier. i use single choice question in every questionstep, and i want it to navigate if the 2 question result equals to 'yes'.

Screenshot 2022-08-10 062526

Update survey default values with data from DB when filling survey

Hello
I created survey with survey_kit commit: 41f3229.
At the beginning of the survey, the person's ID is asked. After inserting the person id, I want to check in the DB if the person already exists. If yes, the default survey values will be replaced with the values from the DB. Can I do it and how?
Also, I want to log after every step that goes through in the survey. Can I do it and how?
Thanks in advance

[bug] huge issue about QuestionResult.valueIdentifier

as defined in the plugin answer creation process:
TextChoice(text: answer.text, value: answer.id);
i think the TextChoice value may vary from the TextChoice text
So i think the QuestionResult.valueIdentifier should equal to TextChoice.value not as it is now Textchoice.text

Allowing users to create custom surveys

A completed survey produces an json file.

I want to allow users to be able to create surveys. Is there a way to do this using the package? Or would I need to do this externally to this package and generate the JSON file?

keyboard not showing on TextAnswerFormat

on Android, when I tap on the text field of TextAnswerFormat
the keyboard does not show and instead the survey goes one step backward

minSdkVersion 19 
targetSdkVersion 30

Example for handing survey results

It would be useful if there are examples on how to get all the key-value pairs of the survey items.. Currently I am unable to understand how to get the question name.

Answer format type text input cuts height in half when textlength == screen width

First of all thanks for this beautiful package! :)

Unfortunately the "text area" is being cut of at half the height, when the text length reaches the display width.
Do you have any quick advice to handle this scenario, or is this a bug?
Setting the "maxLines" to a high value doesn't fix it.
The questions are generated via a JSON file.
(And "isOptional" doesn't work as well)

Screenshot_1631747434

Change font size of survey elements

Hi,

I'd like to change the font style of the survey elements. I tried overriding the textTheme in SurveyKit().

I found out that headline6 is used for e.g. question type title and selected value (scale). I was able to change color and font size here. However, I wasn't able to change the font size for "type" "intro" (note: I'm using json import). It seems that bodytext2 is used b/c I could change the color - but not the size.
Am I missing something?

Thanks in advance.

custom step

great package, thank you!
2 questions:
-- would you demonstrate a custom step for attaching images to the step (no need to demo image picker);
-- how to restart the survey, possibly from a specific step (in case if user decided to change some answers).
thank you in advance!
yury

Customizing survey pages

Hello,

This post is not related to any issues but I just have some queries about customizing survey pages like appbar and next button. Is there any way to remove cancel button, rename back arrow in app bar. I just want to navigate to the next question once a question is answered by removing next button in survey question page. Can you please let me know if there is anyway.

Thanks

Unable to load in getJsonTask() from example code

When I try to run the following getJsonTask() from the example code, the app just stays on the loading screen for some time.
Using Flutter 3.0.1

class _MyAppState extends State<MyApp> {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        body: Container(
          color: Colors.white,
          child: Align(
            alignment: Alignment.center,
            child: FutureBuilder<Task>(
              future: getJsonTask(), //HERE
              builder: (context, snapshot) {
                     .....

Running getSampleTask() it works fine.

Finish quiz

Hi, I have a question regarding when the questionnaire is finished.
I'm using the example from the page. However, when the questionnaire ends, the application goes to a completely black screen.
I would like to know how do I go to a custom screen.
What I want is to present a simple screen saying that the questionnaire has already been answered.

Any roadmap for missing features? :)

Hi!
Thank you very much for this awesome library! I would like to use it, but currently it's missing one the main features: an image choice and value picker. Any estimation if these will be added anytime soon?
Thanks! :)

Issues with bloc dependencies

When trying to implement this package with our project we have a conflict in dependencies; namely we are relying on a bloc version in which mapEventToState has been deprecated (bloc 8.0.0 or greater). In the future will the bloc dependency of the package be updated to usable with projects depending on newer versions of bloc?

Using SurveyKit in a Future for API database loading

Hi,
I'd like to congratulate you on this excellent work you did here.
I just have a question that I'm sure is due to my lack of expertise with Flutter/Dart, than with your work.
I'm trying to load the questions from a database through a NodeJS API & Mongo DB as backend, everything seem to work just fine, but when I call SurveyKit from a Future Builder (see code below), as soon as I tap/click on the Answer text field it takes me immediately the InstructionsStep screen.
Can you please guide me on what am I missing here?
...
FutureBuilder(
future: getQuestionSteps(surveyId:'1'),
builder: (ctx, snapshot) {
// Checking if future is resolved or not
if (snapshot.connectionState == ConnectionState.done) {
// If we got an error
if (snapshot.hasError) {
return Center(
child: Text(
'${snapshot.error} occured',
style: TextStyle(fontSize: 18),
),
);
// if we got our data
} else if (snapshot.hasData) {
// Extracting data from snapshot object
final questionSteps = snapshot.data;
return Survey.SurveyKit(
onResult: (Survey.SurveyResult result) {
print(result.finishReason);
},
task: getSampleTask()
)
;
}
}
// Displaying LoadingSpinner to indicate waiting state
return Center(
child: CircularProgressIndicator(),
);
},
)

Develop of file upload answer format

I'm developing a new answer format that you can upload a file and a description on a question step. I would like to know if there is some example or some ongoing code you can provide me so I can base on it.

Appreciate.

SingleChoiceAnswerFormat default selection does not work

The survey does not preselect the default answer when I provide the defaultSelection.

Here is the code snippet

this.questions.asMap().forEach((index, each) => {
  choices = [],
  each['options'].forEach((eachOption) {
    choices.add(TextChoice(
        text: eachOption['text'],
        value: eachOption['text']
      )
    );
  }),
  steps.add(QuestionStep(
    isOptional: false,
    id: StepIdentifier(id: index.toString()),
    title: 'Question ' + index.toString(),
    text: each['question'],
    answerFormat: SingleChoiceAnswerFormat(
      defaultSelection: TextChoice(
        text: capitalize(getDefaultSelection(each['question'])),
        value: getDefaultSelection(each['question'])
      ),
      textChoices: choices
    )
  ))
});

problem in running sample example

Hello,

Thanks for creating this good looking suvery kit, I think this will help to implement in our project.

Im facing issue to run the example project.

Google%20Drive/src/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_platform_widgets-1.9.0/lib/src/platform_app.dart:577:9: Error: No named parameter with the name 'scrollBehavior'.
scrollBehavior: dataRouter?.scrollBehavior ?? scrollBehavior,
^^^^^^^^^^^^^^
../../../../Google%20Drive/src/flutter/packages/flutter/lib/src/material/app.dart:217:9: Context: Found this candidate, but the arguments don't match.
const MaterialApp.router({
^^^^^^^^^^^^^^^^^^
../../../../Google%20Drive/src/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_platform_widgets-1.9.0/lib/src/platform_app.dart:632:9: Error: No named parameter with the name 'scrollBehavior'.
scrollBehavior: data?.scrollBehavior ?? scrollBehavior,
^^^^^^^^^^^^^^
../../../../Google%20Drive/src/flutter/packages/flutter/lib/src/material/app.dart:167:9: Context: Found this candidate, but the arguments don't match.
const MaterialApp({
^^^^^^^^^^^
../../../../Google%20Drive/src/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_platform_widgets-1.9.0/lib/src/platform_circluar_progress_indicator.dart:75:7: Error: No named parameter with the name 'color'.
color: data?.color,
^^^^^
../../../../Google%20Drive/src/flutter/packages/flutter/lib/src/material/progress_indicator.dart:542:9: Context: Found this candidate, but the arguments don't match.
const CircularProgressIndicator({
^^^^^^^^^^^^^^^^^^^^^^^^^
../../../../Google%20Drive/src/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_platform_widgets-1.9.0/lib/src/platform_nav_bar.dart:166:7: Error: No named parameter with the name 'enableFeedback'.
enableFeedback: data?.enableFeedback,
^^^^^^^^^^^^^^
../../../../Google%20Drive/src/flutter/packages/flutter/lib/src/material/bottom_navigation_bar.dart:257:3: Context: Found this candidate, but the arguments don't match.
BottomNavigationBar({
^^^^^^^^^^^^^^^^^^^
../../../../Google%20Drive/src/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_platform_widgets-1.9.0/lib/src/platform_page.dart:128:7: Error: No named parameter with the name 'restorationId'.
restorationId: data?.restorationId ?? restorationId,
^^^^^^^^^^^^^
../../../../Google%20Drive/src/flutter/packages/flutter/lib/src/material/page.dart:153:9: Context: Found this candidate,
but the arguments don't match.
const MaterialPage({
^^^^^^^^^^^^
../../../../Google%20Drive/src/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_platform_widgets-1.9.0/lib/src/platform_page.dart:140:7: Error: No named parameter with the name 'restorationId'.
restorationId: data?.restorationId ?? restorationId,
^^^^^^^^^^^^^
../../../../Google%20Drive/src/flutter/packages/flutter/lib/src/cupertino/route.dart:419:9: Context: Found this candidate, but the arguments don't match.
const CupertinoPage({
^^^^^^^^^^^^^
../../../../Google%20Drive/src/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_platform_widgets-1.9.0/lib/src/platform_text_form_field.dart:386:7: Error: No named parameter with the name 'scrollController'.
scrollController: data?.scrollController,
^^^^^^^^^^^^^^^^
../../../../Google%20Drive/src/flutter/packages/flutter/lib/src/material/text_form_field.dart:135:3: Context: Found this
candidate, but the arguments don't match.
TextFormField({
^^^^^^^^^^^^^

FAILURE: Build failed with an exception.

can you help me or fix this problem so that I can have example project as reference one.

Thank you.

Internationalization for cancel and next buttons

I couldn't find a way to change the text of the cancel and next buttons in the step view.
I think the text for the cancel button is hard coded in step_view.dart line 64 and 91.
Is it possible to adapt these texts?
If this is not the case, could you please use internationalization for these texts or provide a way to change the texts.
I would need a german translation in addition to the english one.

Cancel Button Behaviours

Is there an option to override the cancel option behaviour ? or do i have to modify the library

The entire page gets popped if i tap on cancel, I want it to behave like the back button of a scaffold.

Issue in Date Answer Format

For the below step there is an exception on the default value.

          QuestionStep(
            title: 'Your Birthday?',
            answerFormat: DateAnswerFormat(
              minDate: DateTime.now().subtract(const Duration(days: 365 * 70)),
              maxDate: DateTime.now().subtract(const Duration(days: 365 * 15)),
              defaultDate:
                  DateTime.now().subtract(const Duration(days: 365 * 20)),
            ),
          ),

Below is the exception. Does not make sense as I set the default date within the range.

The following assertion was thrown building DateAnswerView(dirty, dependencies: [_LocalizationsScope-[GlobalKey#9b781], _InheritedTheme], state: _DateAnswerViewState#9bd0a):
initialDate 2021-04-10 00:00:00.000 must be on or before lastDate 2006-04-14 00:00:00.000.
'package:flutter/src/material/calendar_date_picker.dart':
Failed assertion: line 116 pos 7: '!this.initialDate.isAfter(this.lastDate)'

The relevant error-causing widget was: 
  SurveyKit file:///D:/Flutter/club/lib/pages/survey/user_survey.dart:8:13
When the exception was thrown, this was the stack: 
#2      new CalendarDatePicker (package:flutter/src/material/calendar_date_picker.dart:116:7)
#3      _DateAnswerViewState._androidDatePicker (package:survey_kit/src/views/date_answer_view.dart:109:18)
#4      _DateAnswerViewState.build (package:survey_kit/src/views/date_answer_view.dart:73:32)
#5      StatefulElement.build (package:flutter/src/widgets/framework.dart:4612:27)
#6      ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:4495:15)
...
====================================================================================================

VideoStepResult usage example

Hi,
I'm working on a research application that needs to show users some videos, I saw that survey_kit has a VideoStepResult and depends on video_player, is there a code sample for a VideoStep?

Survey answer access

Hi,

Can you show me how to access the survey answers with sample code in Dart/Flutter?

Thanks,
Mike

SurveyResult toJson

Hey guys,

Awesome plugin, great work!

I've been playing around with it in the last couple of a days and plan on using it in my current project. I would need to export the survey results to json though and saw (on another thread + in the code) that it's not implemented yet.

Just wanted to check with you: did you start that at any point?

I took a quick look on how to do it and at this stage I think I would just go ahead, use freezed and make all the subclasses of QuestionResult (BooleanQuestionResult, DateQuestionResult etc) serializable...

Did you maybe see any potential problems with that approach?

Cheers

How to enable and disable question as per dependency question.

There is rating question in Screen shoot we provided conditions

  1. When 1 rating is selected than related question is enable. (1 question is enable check below SS example).
  2. When 7 rating is selected than related question is enable. (2 question is enable check below SS example).

Is there any workaround for this Type of question in package.

image

Get sum of value answers

Hi all,
on my QuestionStep:
QuestionStep(
title: 'Congestive heart failure within the past month',
answerFormat: const SingleChoiceAnswerFormat(
textChoices: [
TextChoice(text: 'Yes', value: '1'),
TextChoice(text: 'No', value: '0'),
],
defaultSelection: TextChoice(text: 'No', value: '0'),
),
),
I see the text and value for each answer, I'm not able to see the value of all the answers when I finish the survey, only the text.
My need is to sum all the value... there is a way to do it?

check icon on completed task edit

I can't find where to chance the color or remove the final ico. I see in previous issue that is possible to create my own. but how to do that?

For `SingleChoiceAnswerFormat`, `isOptional` flag not working

    this.questions.asMap().forEach((index, each) => {
          choices = [],
          each['options'].forEach((eachOption) {
            choices.add(TextChoice(
                text: capitalize(eachOption['text']),
                value: eachOption['text']));
          }),
          steps.add(QuestionStep(
              isOptional: false,
              id: StepIdentifier(id: index.toString()),
              title: 'Question ' + index.toString() + '/' + total.toString(),
              text: each['question'],
              answerFormat: SingleChoiceAnswerFormat(
                  defaultSelection: null, textChoices: choices)))
        });

Even if I mark the isOptional false, I am able to skip the question by clicking next button, my Goal is to restrict the user.

How to add animation between steps

Hi,

Thank you for your project. It is very useful. I want to add animation when switching to other page. Can you help me about this or can you say me what should I research?

Web error "UnsupportedError: Unsupported operation: Platform._operatingSystem"

Everyting is okay when publishing for iOS and Android, but when targeting for web I got this error: UnsupportedError: Unsupported operation: Platform._operatingSystem

Context: thrown building BlocBuilder<SurveyPresenter, SurveyState>(dirty, state: _BlocBuilderBaseState<SurveyPresenter, SurveyState>#4664a)

Information: debugCreator: BlocBuilder<SurveyPresenter, SurveyState> ← BlocConsumer<SurveyPresenter, SurveyState> ← SurveyPage ← _InheritedProviderScope<SurveyPresenter?> ← InheritedProvider<SurveyPresenter> ← BlocProvider<SurveyPresenter> ← _InheritedProviderScope<Map<String, String>?> ← Provider<Map<String, String>?> ← _NestedHook ← _InheritedProviderScope<SurveyProgressConfiguration?> ← Provider<SurveyProgressConfiguration> ← _NestedHook ← ⋯

Running workflow on every PR

I'd run the workflows which asserts the general integrity of the library on every PR.

Also: set the requirements for being able to merge so that that workflow has to pass without error.

In my opinion, running it on master/develop servers of little purpose, since by then you'd already created a new published version and it's either too late or you already ran the checks yourself locally.

If you let it run on every PR, also other PRs (besides your own) have the benefit having the security of a successful workflow run.

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.