Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding new Questions #53

Open
AbanoubG opened this issue Feb 23, 2017 · 14 comments
Open

Adding new Questions #53

AbanoubG opened this issue Feb 23, 2017 · 14 comments

Comments

@AbanoubG
Copy link

AbanoubG commented Feb 23, 2017

When adding new questions to the challenges.bpc and submitting an update to the play store, it does not show the new questions for the user. I had to go into my app settings and clear the data. Only then did it show the new questions. Is there someway to show the new questions without having to do this? Also for some reason Import doesn't show in the production version of the app in the play store but when I run it in the emulator it does

@ValentinFunk
Copy link
Owner

The challenges.bpc is loaded to the database only once when the app is loaded. What you could do is store the challenges version somewhere in the App and then import only the new ones in app start.

You could then use the FileImport class in de.fhdw.ergoholics.brainphaser.logic.fileimport to load your incremental changes. You'd also need to patch ProxyActivity to do this.

What you can also do is allow your users to download the new challenges as bpc file. (For example on your website). bpc files are automatically associated with the app so users could import new challenges by downloading and opening the file.

A PR to allow for updating automatically would be very welcome! This was something we didn't consider when coding the app.

@AbanoubG
Copy link
Author

AbanoubG commented Feb 23, 2017

I am a new developer and my abilities are limited in terms of doing a PR. In any case, when allowing users to download a new challenges as a bpc file, I get duplicates of each category. I'm trying to look for the simplest way in which I could add new questions via an update. Any ideas on how I could achieve this based upon my limited skill set? Perhaps their is a way to clear the loaded database upon new version launch

@ValentinFunk
Copy link
Owner

ValentinFunk commented Feb 24, 2017

You'd have to give them only the added questions in the bpc. I agree it's not a very good solution.

I believe what I posted above would be the most simple way (but it does require a bit of implementation). You could clear the database but that would also mean clearing all of their progress on updates.

If you want to give it a shot and get stuck anywhere i'm always here to help as well 😄

@AbanoubG
Copy link
Author

AbanoubG commented Feb 24, 2017

Thanks Kamshak for the help. If you would like to see the project that I made by forking your application, it's on my GitHub profile. I wouldn't have been able to do anything without your help. In terms of implementing this, I will try and do more research regarding this matter.( Perhaps on Stack Overflow.) In the mean time, I tell the users to clear the app data via a push notification until I can figure out how to implement what was stated above lol

Thank you for your constant help and advice

@AbanoubG
Copy link
Author

AbanoubG commented Feb 28, 2017

Would this work? (Referring to the accepted answer) I am assuming that I would put it in the DataBaseModule.Java. Any ideas?

http://stackoverflow.com/questions/23881317/delete-sqlite-database-when-updating-new-version-of-application

@ValentinFunk
Copy link
Owner

You could do this but it will remove all user progress. For that you'd just need to change the number in https://github.com/Kamshak/BrainPhaser/blob/master/brainphaserdaogenerator/src/main/java/de/fhdw/ergoholics/brainphasergenerator/BrainphaserDaoGenerator.java#L14

@AbanoubG
Copy link
Author

AbanoubG commented Mar 2, 2017

In other words, if I were to pursue this route, I would periodically change this number with each subsequent addition of questions and app version? It will remove all user progress however it would show all questions. Correct?

@ValentinFunk
Copy link
Owner

ValentinFunk commented Mar 2, 2017

Yep that's correct.

Just thought of another way: You could use the DB migration to run your question migrations as well and change the DB version whenever you add questions. There is some information here: http://stackoverflow.com/questions/13373170/greendao-schema-update-and-data-migration basically you'd need to subclass DaoMaster.OpenHelper and provide a custom onUpgrade method. In that method you could use FileImport to import the new questions via BPC. (You'd have a BPC for app install, and then each time you add questions a new BPC with only the added questions)

@tonyesna
Copy link

hi, i am new in Android.

I would like to know where I can modify the path where the database is stored on my device.
I have read that by default it is saved in / data/data/... but it can only be seen as root.

@ValentinFunk
Copy link
Owner

@tonyesna: Please open a new issue next time :)

What you need to do is change the database name here, change prodDb to /mnt/sdcard/database_name.db

@zfc0812
Copy link

zfc0812 commented Oct 1, 2017

@kamshak How to disable the no challenges due after users has completed all the quiz? I would like to let users to repeat doing the quiz.

@ValentinFunk
Copy link
Owner

@zfc0812 the way it works at the moment is by spaced repetition, they'll get asked the questions again after a specified period of time (you can set it in the app settings)

@farhannaseer88
Copy link

How can I use images in the multiple choice question rather than text. display images in the options.

@ValentinFunk
Copy link
Owner

@farhannaseer88 please see #56

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants