Surveyor gem show results after user submits the survey - surveyor-gem

Is there any option to show the results of the survey after user submits it to database?

You can view the survey results through the same URL i.e. '/surveys/survey_name/access_code' (no '/take' at the end).
If you are looking to get the data through the console / build an API to get the results try user.response_sets[response_index].responses

Related

Automated tests with Laravel

I am new to PHP laravel framework.
My application is very basic:
User first log-in with login and password (html form)
The user can add items in a mysql table. This are numeric values. There are 2 controllers: One to see all rows and another to add/edit row
Another Controller computes statistics (sum, average, etc.) on the numeric values stored in the table.
What i want do to is to test this application.
I want to write a test that:
Creates an empty database
Creates a user
Log-in this user on my application
Creates entries in my table throw my application (not directly in mysql)
Check in the listing page if each entry has been created properly
And i want to check if the statistics are good (check good values displayed on the webpage.
I have read about Testing section on Laravel's website documentation.
Here are my questions:
I do not se how i can automated database initialization
I do not see how i can check if a span or div contains a specific value (i only can test http response code and if webpage contains a given string).
I have worked with phpunit.
Thanks a lot

Branch.io - Appending Query Parameters

Trying to append some query parameters to links created via Branch.io, but I can't figure out how to do this in the dashboard. I see from https://docs.branch.io/pages/links/integrate/ that the following is possible.
Short links can have additional data appended to them
e.g. dynamic link https://example.app.link/fzmLEhobLD?content_id=123
Append query strings https://example.app.link/fzmLEhobLD?$custom_data=123&hello=world
Is there a way to do this via Quick Links in the dashboard?
I need to create the link here to test that my Android and iOS apps can read the parameters from the link and take the user to the appropriate page, or redirect the user to the appropriate page on the website - and then bulk create similar links with the query parameters varying (either via the dashboard or the HTTP API).
Have already checked out the following - Deep link with variable query on branch.io - but this didn't seem to address the issue.
When creating a quick link under configure options, you can select the deep linking tab and click on the "+ more data" button which will allow you to add parameters to the quick link.
adding parameters to quick link
You cannot add query params in the dashboard, but you can add link data in the Link Data section. (date of the screenshot: Jan, 2021)
If you need links for different purposes, then you should create multiple links.
On the other hand, if you only need to vary one parameter, then you can reuse one link by passing a different query parameter. For example, you can create a Quick Link to add a user to a user group that looks like this - myapp.link/add, That is a Quick Link, and you can set its params in the Link Data section (e.g. set key type to value new_users
Then, on the backend (or wherever you want to "generate" links), you reuse that one link like this:
myapp.link/add?code=a1 this is inviting user L to group Y
myapp.link/add?code=b2 this is inviting user M to group Z
In your app, you can access both the code param (from query param) and the type param (defined in Link Data) in the same way, usually through a data Map.

Tabular - DAX - Filter Value for current logged on User

i have the following Scenario:
I have a Power View Report that Shows certain Values for Employee's based on the Projects they have worked in.
Now, until the Report is filtered for the Currently logged in User, the User openning the Report will see everything about the Projects they have worked on, including the engagement of others in the Projects.
What i Need is to have it all only showing, therefore filtered, after the Currently logged in User.
I have a Employee Table that has columns like: Employee Name and Login,
and i thought i could create something like a Calculated column which would produce the Currently logged on user, and that would then be used by me later in the Report, where i would simply open the Employee Table and Filter where Employee is Logged on User.
Does anyone have any Idea about how this is to be accomplished ?
or, does anyone know a better way ?

Any IMDB API to get user's ratings history?

I need to be able to import IMDB user's movie ratings into my website. Is there any API for this purpose?
The short answer is that there is not an API for this purpose (at the moment).
If you need to get a user's movie ratings I think that the best solution for you is to log in at IMDB, go inside the user profile page, click on rating and in the bottom of the page click on the CSV export.
This should contains all the data you are looking for and in a good format. The bad news is that you have to follow these steps for each user you want to get the ratings. There is not an automatic procedure to get them.

How to identify and save keywords in the database and retrieve it later in rails 3.1

I am working on a rails 3.1 app where I have to implement the following logic.
1) Provide a searchbox
2) User enters their query in the searchbox
3) If the query is not present in the database the user saves the query in the database
4) If a matching query is found it is retrieved and displayed to the user.
I am new to the search business and needs some direction on how to identify what are the keywords which the user has entered in the query? Is there a gem which can do this?
I am using sunspot for doing the search, how do I customize the sunspot to make the text entered in the searchbox searchable?
Thanks,

Resources