2017년 6월 15일 목요일

Can I have 100 questions per screen?


I'm making a multiple choice quiz app. The app inventor doesn't accept more than 10 screens so I have to consolidate my number of chapters which means I will have A LOT of questions per screen. One screen has about 94 questions. Do they also limit the number of question per screen? All my questions are texts, no image or sound.

--
Why you use all 10 screens?
You can use a Screen to ask the questions! For this you only need the correct programming.
See the "quiz maker" project in the gallery.

-- 
A "question" is not a programming object in App Inventor 2, so there's no such thing as a "questions limit". The questions can be asked one by one in just one label, and have multiple choices with 3 or 4 checkboxes. Also, you can set two buttons to go to the next question or go back to the previous one. Using more than 1 screen to do what you are trying to do is a waste of resources, really. 

-- 
I need more than 10 screens because my quiz is from 63 chapters. I want my quiz per chapter. If I consolidate 10 chapters in one screen, I will have around 100 questions which, as much as possible, I don't want to do. 

Is there another program out there that has no limit to the number of screens I use? 

-- 
I never said you have to place 100 questions in one screen, I said show one question at a time, reusing the same components. 
If you want to watch 100 movies, you don't buy 100 tv's right?

-- 
Sorry, what I meant was, the 100 questions don't appear in one screen. They are assigned to appear in screen 1 one at a time. I don't know if I'm making any sense, I don't know how else to explain it. 

-- 
There's a lot of different ways to do this. Did you check Nico's link above?
This is how I would do it, for simplicity I use 2 screens, but it's possible to do it with just one (by hiding some arrangements and making visible others).
Does this makes any sense to you?



-- 
I already did that. My first screen are made up of buttons, Chapter 1, Chapter 2, Chapter 3, etc. When Chapter 1 is clicked, it opens to Screen 2 where my questions for that chapter is found. It has about 23 questions. The blocks are set up that when you choose an answer for the first question, the button turns green for correct, red for wrong, then after a second, will go directly to the next question. It also has a HOME button at the bottom of every page just in case the user gets bored and wants to go HOME to choose a different chapter. 

So if I click HOME, then click Chapter 2, it will go to Screen 3 which I have 93 questions. Same set up as Chapter 1. Unfortunately, if I click Chapter 10, there will not be a Screen 11. So what I did, I made Chapter 1-10 into just one button.

-- 
You still don't understand what reusing components means. In my example, there's only 2 (TWO) screens, not one per chapter. Just two.

Screen1 will tell Screen2 which chapter the user selected. Then Screen2 will show question #1 of the chapter passed as a value from Screen1.

If the user clicks the HOME button, you CLOSE Screen2.

There's no Screen3 or 4 or 5. It's just Screen1 and Screen2 only.


--
I've been thinking about that the last couple of hours. I now know what you mean. Will try that. Thank you for your patience, time, and knowledge. :-)

-- 
I forgot to add this but I guess you already figured it out:

In Screen2, when you press NEXT QUESTION you don't go to any screen. Just get the next question with its answers and change the text in the labels and checkboxes. 
Same when you press the PREVIOUS QUESTION button.

-- 
See this app that lets you choose paths from the Big Bang to MIT,
all in one screen with a handful of components ...

-- 
MOMSHIE2  replied by personal email: (Please reply only in the forum. Thanks)

I finally figured it out!!! YEY!!! Your idea  led me to this video in youtube about simulating multiple screens. So far, it is going well. When I click the button for Chapter 1, it opens up “another screen” that has all my questions for this chapter alone. It’s not really another screen but that “screen” becomes “visible” when Chapter 1 button is clicked. Thank you!!!
Let’s see if I can do more chapters. I’m just having a hard time in the Designer view when you have to put multiple Vertical Scroll Arrangements when your “workspace” doesn’t scroll down.
But anyway, thank you!

Good to know! About the designing, it's a little annoyance, yes, but you can set some components invisible, and make them visible before compiling the apk.

-- 
Ummmm.....I keep getting this message: data partition size adjusted to match image file <93 MB> 84 MB>

Is this a problem? It slowed down the emulator.  I'm only using Screen 1 and it has 722 blocks, all text, no image or sound.

-- 
Definitely. Why do you need 722 blocks?
You should have the questions and answers in lists, not hard coded in blocks.
Check this example I did. You need to have the chapters loaded as csv files, like the one showing in my NotePad.

Then display them one by one. When the users selects a different chapter, you load the csv file that corresponds to that chapter and display the questions and answers. 
When I mean REUSE, I really mean REUSE. If you have to make the blocks for each question, then what would be the purpose of programming then?

Study this example and try to come up with the right way to implement it in your app.
Of course, there's hundreds of other ways to do this. I'm just showing you what I would do because it worked for me.



-- 
The first value of each row is the number of the correct answer.
I assumed you know how to work with lists of lists. If you don't please read this: 


-- 
Sorry, I keep forgetting to reply here.

-- 

Important information for extension developers


With our upcoming IOT release there will be some improvements to how extensions work:

1) Extension bundles: If you have two or more extension in the same package, they will be put into a single .aix file named with the package. When you import this .aix into App Inventor, you will get multiple extensions listed in the palette. This allows extension developers to group related extensions into a single package rather than asking users to upload many extensions. It also cuts down on the time needed to package up AIA and build server requests by reducing the number of files in a project.

2) Extension icons: Until now, icons needed to be compiled as part of the MIT AppInventor build or hosted externally using an HTTP or HTTPS URL. Now it is possible to include icons in the extension. To do so, create a directory aiwebres in the same package as the extension. Add a PNG file for the icon, and name it in the iconName field of the @DesignerComponent annotation, for example "aiwebres/icon.png". When the extension is packaged it will be pulled into the AIX and the SimplePaletteItem will correctly load the icon from the MIT App Inventor server.

3) Extension properties: There is a Bluetooth component property type that is used by the LEGO MINDSTORMS code to limit selection of a component to a BluetoothClient component. We have extended this functionality for our IOT work so that you can now name a component by its fully-qualified class name and the list of current components will be restricted to only those components that are instances of the named class. This can be useful for having multiple extensions that connect to one another in some meaningful way. For example, we use this in our Arduino and Micro:bit extension to limit the BluetoothDevice property to BluetoothLE instances. To take advantage of this, set the editorType of the @DesignerProperty annotation to PropertyTypeConstants.PROPERTY_TYPE_COMPONENT + ":" + the fully qualified class name of the target component type.

4) Extension loading: We have improved extension loading in the companion so that multiple extensions can link with one another for more complex extension interactions. For example, we can have one extension call methods in another extension's classes. Extensions may also be imported/upgraded after connecting the companion if using the ai2-test server with companion 2.41t2 or higher.

5) Extension help URLs: The @DesignerComponent annotation now has a helpUrl field that can be used to specify a URL for documentation. This will be used to populate the href attribute of the "More information" link that appears in the palette help when user's click on the ? icon. If no helpUrl is provided the link will no longer appear.

If you have any questions, concerns, or suggestions, please let us know.

--
Nice improvements.

--
Does the Power Users Group include the major Arduino posters?

--
Some, but not all. We've also been reaching out to individuals posting on the public forum who have been asking questions about Bluetooth LE specifically. If you have any suggestions for candidates to do testing we are glad to expand the test cohort.

--
The authors of the Arduino or BLE projects on my FAQ would probably qualify ...

--
I should also point out that you can test these new additions using the latest master branch and the ai2-test.appinventor.mit.edu server.

--
Is Android API level upgraded?

--
We are working on an upgrade path to 7.1.1, but it will take some time because we need to do some significant refactoring of existing components due to the change in the permission model from 5.1.1 to 6.0 and a number of APIs have been deprecated or removed. Once we are a little bit closer to a release there will be community testing on ai2-test so that we can identify any problem points.

--

2) Extension icons: Until now, icons needed to be compiled as part of the MIT AppInventor build or hosted externally using an HTTP or HTTPS URL. Now it is possible to include icons in the extension. To do so, create a directory aiwebres in the same package as the extension. Add a PNG file for the icon, and name it in the iconName field of the @DesignerComponent annotation, for example "aiwebres/icon.png". When the extension is packaged it will be pulled into the AIX and the SimplePaletteItem will correctly load the icon from the MIT App Inventorserver.


What should be the recommended size for icons? Also, can it be transparent? 

--
I started updating some of my extensions and just saw that on importing new version, the extension didn't upgrade. Instead, I got a dialog box saying that I have been adding duplicate extension. 

So, after deleting old extension and importing new one again, it doesn't show Class name, but it used the last word after dot from the package name. For eg, it take pavitra from com.pavitra (package name), where the class name is Arduino.

In my opinion, I think you should make some modifications in this point quoted below.

1) Extension bundles: If you have two or more extension in the same package, they will be put into a single .aix file named with the package. When you import this .aix into App Inventor, you will get multiple extensions listed in the palette. This allows extension developers to group related extensions into a single package rather than asking users to upload many extensions. It also cuts down on the time needed to package up AIA and build server requests by reducing the number of files in a project.


 I mean it maybe good for multiple extensions, but is not useful for single extensions. 

--
Sorry, it's my fault. It works well as expected. There's nothing wrong with AppInventor.

--
Just as a follow-up to this. Starting with companion release 2.42 released on 2017-06-14, extension developers can now report errors via the Screen.ErrorOccurred event using the constant ErrorMessages.ERROR_EXTENSION_ERROR. Additional arguments that will need to be pass for the format string are (1) an integer value to indicate an error code specific to the extension (only significant to the extension developer, e.g., 9001), (2) a String naming the extension (e.g., "BluetoothLE"), and (3) a string with a textual description for the error (e.g., "Device index out of bounds"). The goal is to make it easier to report extension errors through the existing error handling mechanisms in App Inventor. As part of this release, all of the items mentioned in the earlier post are now available on the production instance as well. If you have any issues, please let us know as soon as possible so we can address them.

--