Google Forms validation based on multiple questions - forms

I want to create a form that lets people choose items they will get
Each person should get 10 items, and no more than 4 of each item.
So I create 3 questions with multiple choice answers:
Item A: 0 - 4
Item B: 0 - 4
Item C: 0 - 4
Now upon submission, or better yet before, I want to make sure that the values selected in the 3 questions is added up to exactly 10.
Is there a way to do such thing?

Related

Is it possible to run multiple functions in one request

Newbie here with limited to no history with coding.
Attempting to build an email template and I want to know if it is possible to run multiple function in one request? I am providing some test data below to try and better explain what is needed
Custom Field 1 - Score_A - Value can be between 1 and 10 This will vary based on the customer being emailed)
Custom Field 2 - Score_B - Value can be between 1 and 10
Custom Field 3 - Score_C - Value can be between 1 and 10
Custom Field 4 - Score_D - Value can be between 1 and 10
I need the code to search across all four custom fields and if any of the values of these custom fields is more than 5 I want to the outcome to read "Good", if any of the vales of the custom field are below 5 I want the outcome to read "Bad". I do not want out outcome for each custom field, I just need 1 outcome for each email.
e.g. if
Score_A=6
Score_B=9
Score_C=10
Score_D=8
The outcome in the email should read "Good"
But if
Score_A=2
Score_B=9
Score_C=10
Score_D=8
The outcome should read "Bad"

Grouping multiple values

Grouping multiple values on Details section
I have got an output from SQL query:
ID Value
1 1
1 3
1 5
1 7
1 9
2 1
2 4
3 1
3 2
3 3
I just want to have on each page ID and whole list of values assigned to this id. On next page I should have next ID a it's values.
As you can see for ID 1 I have got 4 values, for 2 I have got only 2 values, for 3 I have got 3 values. I want to say that how many values I have got for particular ID can be different.
I don't know what is the name of this kind go grouping, If someone will name it I will be able to dig the Internet to find the solution.
If someone knew how to do this and will share the knowledge I will really appreciate this.
Best regards,
Volcano
You should add a group (Insert Group) for ID and put Value in the detail section. Make sure to start each group on a new page (Section Expert for your group header or footer, then tick New Page Before / After.

IS it ok to have 20 activities in an app?

I am trying to make a basic kids app. I have 20 questions to be asked, kid will tap on the right colour and once he does so , next question should appear.
My questions is shall I keep changing layout of the same activity or shall I call 2 and create 20 different actvities for 20 different colour questions. What isthe Best Practice?
one activity is enough . you can just change the texview values of questions and answers and manipulate colors if you want too. as soon as user hits next button check with answer ,add it to score or add just 0 then change values for next question.
you dont need to create new button you do just change the button name or question 1.user open the app 2. there is a start quiz button 3. user press the start quiz button 4. we do four things (A)creating a hash-table of questions giving it 1.2.3...ids, creating hashtable of right answers giving same ids 1.2.3.. then two more tables with fake answers giving same ids (B) when we are done doing this we start with first question. (c) using id 1 from table 1 get the the value and assign it to question or the first button i guess. (d) using id 1 get value from table 2 which our right answers table assign it to one of 3 buttons (e) now get value from 3 and 4 table which is our fake answer table using id 1 n assign to other two buttons.5 now our question 1 is ready and wait for user to click on one of three buttons. 6. lets say user click button 3 . 7 using button id we get button name which the answer user gave us we match it with our table 2 id 1 8. if it matches user giving the right answer we add 1 point to user score and move to next question which will be question number+1 so 2 then will repeat same from step C to E but this time we will use id 2 . so every time user answer we go to next question using +1 with question number until be get at 20. 9. if answer does not match we add nothing to score move to next question. When question number reaches 20 we finish we hide all button and show a textview with user's score

Is this an approach to user-item recommendations that could work

I am designing an application that incorporates a recommendation system base on user interactions (collaborative filtering). The user on his homepage is presented a set of 6 items to interact with. There will be between 50 and 300 items. The following actions are possible:
click on an item (strong interest)
refresh an item (some interest)
open a read-more dialog (some interest)
don't do anything an move on (no interest)
This data is collected and stored. The system should recommend items of interest to the user. I'am thinking about turning this data into a rating system.
Option A) if the user clicks on an item, this is translated into a implicit lifetime rating of 5. refreshing an item it a 4 and so on. So my user->item matrix would look like this:
item 1 | item 2 | item 3
john 5 4
jane 4
In this example john has clicked on item 1 and refreshed item 3. The rating can only go up really, i.e. if a user has previously refreshed an item I write a 4 and update only to a 5 if the item is clicked later.
Option B) each time the user does one of the above actions, I'll increment a scalar value for the item, which means it can grow unbounded.
item 1 | item 2 | item 3
john 55 1 30
jane 41 9
Maybe this is a problem, since now the numbers are harder to translate into a rating scale from 1 to 10
Option C) I count every interaction separately
item 1 click | item 1 refresh | item 1 read
john 3 1
jane 1 1
Here the problem is that "reading about" an item is probably only done once.
Independent of whatever option I choose, my idea is to first find similar users using something like cosine similarity or pearson correlation. Then pick the top 10 to 30 users from that list and compile a toplist of their favorite items. From that list, I will then recommend items that the current user has had little interaction with in the past.
Is this something that could work? I am worried that finding similar users will eliminate the chance of finding interesting (new) items for the current user.
What you suggest sounds reasonable. Your concern about not finding new items is a reflection of the collaborative filtering method which is metadata-based. To find new items you would have to undoubtedly do some content analysis which would be a separate stage. For example, if your items are news articles you might try to identify important keywords for each user.

How to show categories and sub categories in view page and select menu in zend frame work

i'm having the table like
category_id category_name parent_id
1 General Grocery 0
2 Ready to eat 0
3 rice 1
4 oils 1
5 flour 1
6 seed 1
7 testing cate 0
8 testing 5
i want to display the categories with "n" number of sub categories in subcategories. My main moto is by using the array generated by the code i want to display in view page and the select menu in the zend form. I found the code in php. but i'm unable to use that in zend. Can some one help me out with this please.
Thank you.
I think you need to generate a tree.. so there are two known patterens to me
adjacency level pattern
Nested Level Patteren
I suggest you to use Nexted level pattern
If you follow the given below two links you will surely come to know what to do.
http://blog.richardknop.com/2009/05/nested-set-model/
http://baobab.sideralis.org/
By this you can generate appropriate tree. now you have to generate a tree in which you can select your items. so you should use this tree http://www.dhtmlx.com/docs/products/dhtmlxTree/index.shtml
you can keep checkboxes to select the items and store in the database