Survey - list items do not retain their order

This is the place to report bugs and get support. When posting in this forum, please always provide as much detail as possible.

Please do not report problems with a custom build or custom code in this forum. If you are producing your own build from the source code and have problems or questions, ask in the developer forum, do not report it as a bug.

This is the place to report bugs and get support

When posting in this forum, please try to provide as many relevant details as possible. Particularly the following:

  • What operating system were you running when the bug appeared?
  • What database platform is your site using?
  • What version of mojoPortal are you running?
  • What version of .NET do you use?
  • What steps are necessary to reproduce the issue? Compare expected results vs actual results.
Please do not report problems with a custom build or custom code in this forum. If you are producing your own build from the source code and have problems or questions, ask in the developer forum.
This thread is closed to new posts. You must sign in to post in the forums.
10/28/2008 1:45:49 PM
Gravatar
Total Posts 88

Survey - list items do not retain their order

Hello,

I am creating a survey with lots of dropdown boxes e.g. Please select: 1-Excellent; 2-Good; 3-Fair; 4-Poor.

Unfortunately, the order is not retained in the list when I take the survey so it may end up being displayed 2-Good; 4-Poor; 3-Fair; 1-Excellent.

Is there a way I can override this at my end? It's really important for the order to be consistent.

Many Thanks,

Leah

10/28/2008 1:47:48 PM
Gravatar
Total Posts 18439

Re: Survey - list items do not retain their order

Sounds like a bug. I'll look into this tomorrow and post again when I know more.

Which db platform are you using?

Best,

Joe

10/28/2008 2:30:53 PM
Gravatar
Total Posts 88

Re: Survey - list items do not retain their order

Thanks - I am using MYSQL.

As a separate point (you can tell I've been busy today) I have also been struggling to change the width of textboxes in the survey - I can't find an appropriate class or id. The only one that has the desired effect has a very long name, ctl00_mainContent_ctl10_txtd2379123e4a5482d9c3bce40832d549e which to me looks as though it must be dynamically generated? Can you shed any light? Thanks, Leah

 

10/28/2008 4:10:42 PM
Gravatar
Total Posts 46

Re: Survey - list items do not retain their order

Hi Leah/Joe

I don't have the source code on my machine, but I had a quick look in SVN and it looks like the mysql data layer method is missing an order by order statement, I checked the MSSQL sproc and it has one, so it looks likely to be the culprit:

public static IDataReader GetAll(Guid questionGuid)
{
StringBuilder sqlCommand = new StringBuilder();
sqlCommand.Append("SELECT * ");
sqlCommand.Append("FROM mp_SurveyQuestionOptions ");
sqlCommand.Append("WHERE QuestionGuid = ?QuestionGuid; ");
 

10/29/2008 6:22:13 AM
Gravatar
Total Posts 18439

Re: Survey - list items do not retain their order

Hi Rob,

Nice to see you're still monitoring the forums for Survey stuff!

Hi Leah,

Rob is the developer who contributed the Survey. Apparently I messed up the sort when implementing the other data layers. I've fixed it now so it will be in the next release coming very soon.

You can make your textboxes wider using a css selector like this:

.survey .settingrow input[type=text] { width: 300px;}

Best,

Joe

10/29/2008 7:11:02 AM
Gravatar
Total Posts 46

Re: Survey - list items do not retain their order

Hi Joe,
I try to check now and again. It's good to get feedback on the survey module. Although this time I got an email from Leah, I’m friends with Leah and recommended MojoPortal to her when she was looking for a CMS.
Keep up the great work Joe!
Rob

 

 

10/29/2008 7:12:50 AM
Gravatar
Total Posts 18439

Re: Survey - list items do not retain their order

Oh, yeah, Leah told me she knew you but I forgot.

Hope you're doing well Rob!

Cheers,

Joe

10/29/2008 7:20:08 AM
Gravatar
Total Posts 88

Re: Survey - list items do not retain their order

Thanks Joe / Rob! Yes it's a small world sometimes :-)

I'll look out for the next release to upgrade to.

.survey .settingrow worked a treat too- I am curious though, how it works as the generated HTML (if I go to view page source in Firefox) doesn't show a "survey" class? How does this work? It'd be useful to know so that I can amend similar settings in future.

As always, appreciate your help!

Best,

Leah

10/29/2008 7:32:58 AM
Gravatar
Total Posts 18439

Re: Survey - list items do not retain their order

Its all about the css selectors. CSS boils down to selectors and rules, the part within the {} are the rules and the preceding part is the selector. There are lots of different ways of selecting and learning about the different ways of selecting is the whole key to css mastery.

If you view the source of the rendered page you will see the survey is wrapped in a div with class="panelwrapper survey"

Notice how multiple class names can be specified with white space between them, so in effect this div has both .panelwrapper and .survey applied.

The questions are further contained within a div with class=settingrow

So the css selector:

.survey .settingrow input[type=text]

means select all inputs of type text where the input is nested within a container having class=settingrow which is nested in a container having class=survey

People generally understand simple class selectors easiest

.survey just means select elements with the class survey

But once you learn about more selector possibilities you can pretty much select anything in the markup and apply style rules to it.

Best,

Joe

10/29/2008 8:08:57 AM
Gravatar
Total Posts 88

Re: Survey - list items do not retain their order

Thanks Joe, for an excellent explanation.

I've been learning CSS but hadn't appreciated that you can put two different classes in the same quotation marks.

Leah

You must sign in to post in the forums. This thread is closed to new posts.