Laravel Query issue - laravel

I have make the survey site. User post the question and other user ans them the question.My code work perfectly but the views is not good. All the question shows the user.How we can one by one show the question. User press the next button then show the next question if press the previous button show the previous question.
Any Idea for this problem Or suggest me related site

The easiest way to do this is with Javascript or similar.
But, I too did find this way interesting as well using php only and please check whether they could help.
How to display only one data at a time in an online quiz
OR
One quiz item per page (php/mysql quiz program)

Related

How to toggle Edit and Save Cancel in a jqGrid?

I asked this question at jquery forum cf: my question, but was asked to come here and look for Oleg.
I've done a lot of research online and tested a bunch of code either mine or from the web, but so far have had no luck. I keep on reading that I need to use the oneditfunc function. As you see in my question at the jquery forum, I added those action buttons in gridComplete. Where do I declare and define the oneditfunc function?
The example at http://www.ok-soft-gmbh.com/jqGrid/ActionButtons.htm does look like what I am looking for, but I can't use the pre-defined 'actions' formatter, I have to use buttons which bear the texts Edit, Save and Cancel.
There is an example at http://www.trirand.com/blog/jqgrid/jqgrid.html# under Row Editing (new) > Custom Edit, which I followed to create mine you've seen in my original question at jquery forum. Unfortunately, those buttons don't toggle.
It just doesn't make sense to display the S(ave) and C(ancel) buttons when the rows are not even in edit mode. So I do want to fix this by toggling them. Any ideas to share? I am sure this is going to help a lot of people as no working examples can be found online. Thank you!
For those who are looking to solve this problem. I have solve it and I have posted my solution at http://forum.jquery.com/topic/jqgrid-inline-editing-buttons .

CEWP to show images (HTML) works until I use grouping. Then I see the DIV tag

I'm fairly new to Share Point so forgive me if this is to easy for you guys, but I could not seem to find the answer anywhere and I am rather stumped.
I am currently trying to make a website to track if particular tasks go over their due date. I have a calculated column that leaves a DIV tag to the image of a red/yellow/green circle which is displayed by the javascript for a Content Editor Web Part (CEWP) made by Christophe on his site here:
http://blog.pathtosharepoint.com/2008/09/01/using-calculated-columns-to-write-html/
I was able to put his code into the CEWP and everything looks great when it is in a standard list.
But I want a web part version of this on the homepage for easy view. When I make the web part (of a view grouping by the image tag) and place on the main site all I see is the DIV tag! I made sure to put an identical CEWP on the homepage as well but i get as grouping:
+[columnName] : DIV>img title=blahblahblah>/DIV> (2)
Needles to say when I expand this it stays the same for all entries below
Any Ideas?
Thanks for your time :D
Nobody has responded, but I found the answer so hopefully this will save someone the hours of grief I had. This will seem ridiculous but just go with it.
In the calculated column instead of returning the type as text, return it as a currency. Sounds ridiculous BUT IT WORKS!!

MVC3 how to optimize the get and post

Just an introduction of my code...
I have a view that consists of
-details of an item
-questionnaire
The questionnaire part has:
-series of questions
-answer choices (can be single choice or multi-choice)
so in my viewmodel, I have like a mainviewmodel to contain the details of a certain item and inside that mainviewmodel, i have a property that maps to a questionnaireviewmodel.
questionnaireviewmodel:
- questionid
- answertype (single or multi-choice)
- answer_score
- answer_text
mainviewmodel:
- detailid
- name
- status
- questions : list
so in the view, i created a loop to display each of the questions and when a user click saves, it saves the answers to a database.
the problem..
The problem I have now is that its taking aorund 11secs to load the page and around 18 seconds to do the saving. Note that the questions count i have in my page is around 8 only. I noticed that my page size is sized around 630kb+ maybe because of the many hidden fields i have in my page to keep the details of the questions.
Do you have any suggestions quick or long term(rearchitecture) on how I can improve performance? I'm thinking of doing ajax call so as not to post the whole page on this but would love to hear your feedbacks. Thanks.
It's not easy to give you specific suggestions on rearchitecture before analyzing the whole application and reviewing the whole source code. My recommendation is doing profiling. Justly click VisualStudio2010 menu 'Aanlyze'-'Launch performance wizard'. Start you application in release mode and record your actions. Finally the profiling report will tell you the hot lines that takes most time of 11s. Hope this helps.

"facebook comment id" added to url - inconveniently

A user comments on the page, the comment is posted to their facebook wall. When another facebook user clicks the link to see the comment it links back to the page but with a massive string of numbers on the end.
http://canofclouds.com/thought/?fb_comment_id=fbc_10150505683457013_20914817_10150507783662013#55
The original url was: http://www.canofclouds.com/thought/#55
This is all fine so far though, until the user clicks a button to go to
http://www.canofclouds.com/thought/#56
Instead, it goes to:
http://canofclouds.com/thought/?fb_comment_id=fbc_10150505683457013_20914817_10150507783662013#f25e670a6c
Which is not good - because it doesn't exist. Ideally it would just go to http://www.canofclouds.com/thought/#56
Normally, when the user clicks the next button a flurry of javascript grabs the hash key (in this case #55) then adds 1 to it (to make #56 - yay) and executes an ajax call to grab the new content. This facebook stuff is making things a little complicated though.
Any ideas?
Edit: Even more ideally i could disable the 'fb comments id' altogether.
You shouldn't use hash keys to link to your page. You should use a canonical URL to do so.
There are a few questions here on stack overflow about how to deal with this.
The only way around it if you choose not to make canonical urls, is to do URL Rewriting at the network or web server level.

UI - How I can make users effectively read what my program says?

I have a simple form that searches through the 2000+ issues of a 3rd party webcomic. (Easy, it's like xkcd: http://url/number
That form is as easy as possible, is like this:
What number do you want?
User writes a number, clicks ok, and goes on the 3rd party website on a new tab
Then, my form asks a question: "Did you find that issue memorable? Enter the name here, and we will add it to the "best issues" in home page"
When the user will write the name of the issue, it is added to the database (pending moderation by me)
So, I supposed this design is the easiest and convenient that users can find.
Unfortunately, NONE of the users (maybe a 2% behaved correctly) will actually read what I asked. Some of the issues are offline, and gives a 404. On that issues users will write in the textbox a completely wrong title, and correctly capitalized!
It's like if i would name http://xkcd.com/627/ as "The Great Adventures of Jack Smith"
Users are from around all over the country, with different browsers, and have a different cookie.
I cannot believe that my users will not read what I ask, it is a WHITE PAGE with a button that disappears when clicked and a textbox.... easier than that???
Maybe i should put a checkbox with "I acknowledge that this form is for submitting memorable issues, not for fun"? Oh, who will read that?
Or maybe i could enable the textbox only if the user has effectively clicked the link?
Do your users understand your site/service?
I, for one, don't remember (web-)comics by their issue number, but by their content. When asked what xkcd comic number I would like to see, I'd probably input random numbers like 42, 123 or 666 or something.
After you make me guess for a number you ask me if the associated comic is particularly epic, then you ask me to do some data entry for it to put it on some kind of hall of fame. Honestly I do not understand what the logic is behind inserting titles for non existing comics -- are you sure they don't actually land them on the comic page for "The Great Adventures of Jack Smith"? The 2% of your userbase probably noticed the issue in the URL you generated for them, addressed it and typed in the right title. Or, maybe, they are typing the name of the comic they actually wanted to see instead.
There's a simple way to know. Have your mom use it and do not correct her if she makes mistakes. All mistakes she makes are your fault, not hers.
Without having the text of the labels you have put it's harder for us to second guess what's going wrong than it is for you.
Try it!!
You could try parsing the title of the page and obtaining the title yourself
OR you might want to request the username/handle.
Once the user enters the details and clicks SUBMIT, Show a confirmation page ( preview of how the submission will be listed). Make sure to include the username/handle as the person who submitted it (This brings a sense of responsibility to the guy who submits). Remember to keep a back button to allow the user to go back and make the necessary changes ans submit again.
Allow users to create profiles on ur site (they maybe as simple as stackoverflow's profile system. here's mine for example). Unless he is logged-in, submissions posted as anonyomous. Rest same as above.
NOTE: There might be a slim possibility that, U are be being targetted by spam / captcha bots. Hence the random text entries. still. do implement the above. A better UI never hurt anyone. Right??...

Resources