Code Monkey home page Code Monkey logo

Comments (4)

ezmegy avatar ezmegy commented on June 12, 2024 1

Hey @VladEfanovNewton ,

Pre-loading survey with existing results; I think there are two parts of this: A) you have to persist previous results and B) you'd need to populate the survey object.

  • For A) check out #79 - I think you could use the toJson and fromJson methods implemented there and store the results in your DB.

  • For B) this functionality is not yet implemented in the plugin. If you're interested in doing it, maybe start by looking around in survey_presenter.dart. I'd think changing theSurveyPresenter() constructor to get the pre-loaded SurveyResult object and init the Set<QuestionResult> results field with that (instead of setting it empty) could work. At that point you'd need to change how you call SurveyPresenter() in survey_kit.dart but it might not be a lot of work actually altogether.

  • Alternatively, if your questionnaire is not too long, you might get away with using something else. For example form-management plugins like
    reactive_forms or
    flutter_form_builder
    that are more fine-tuned for realtime validation and can pre-populate form fields with existing values.

Logging: you can only catch navigation events and e.g. log something when those happen (see SurveyController), listening to single user taps (selections of an answer) is not provided by the plugin.
I'd start at looking at createView() in question_step.dart: all the different answer view types would probably need to provide an onAnswerChanged() or similar callback that you can then use at QuestionStep level... It would be certainly more effort to implement than the previous point.

Both features would be very nice to have though so consider opening separate new tickets for enhancement.

from survey_kit.

ayushin avatar ayushin commented on June 12, 2024

Very much interested to see B) implemented. @adar2378

from survey_kit.

adar2378 avatar adar2378 commented on June 12, 2024

@Numoy Any plan for this? We would also like to prefill the survey with previously completed results from the user.

from survey_kit.

Numoy avatar Numoy commented on June 12, 2024

I will try to integrate this with the next feature release!

from survey_kit.

Related Issues (20)

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.