Empirisoft Support

    Welcome to Empirisoft Support
Results 1 to 48 of 48

Thread: Slider size (case 17391)

  1. #1
    Join Date
    Jan 2006
    Posts
    3

    Slider size (case 17391)

    As I was playing with the advanced features experiment, and the "slider" response option, I was wondering if there is a way to have a slider with more than 10 or 12 points? There is a scale used in my field that uses a "line slider" but with 100 points on the slide. Is that possible with MediaLab?

    Thanks,
    Josland
    Last edited by jason_reed; 12-02-2014 at 11:43 AM.

  2. #2
    Join Date
    Nov 2005
    Posts
    3,328
    Yes, there is. MediaLab now support html forms so you can create pretty much anything you want. I've attached a sample (below) of a 100 point slider. It's a java slider embeded within an html page and it shows you the value (from 1 to 100) as you slide it back and forth. It's pretty cool--check it out and see if it's in the ballpark of what you're looking for. Also, if you know any html or java, you can modify it to look and respond however you want. MediaLab simply loads it up, gives it access to question wording, response opitons, colours and such, and then intercepts any posted data. Soon we'll start posting more samples like this--it really opens up the possibilities.

    NOTE: The slider item origionally posted here (slider.zip) works for MediaLab 2006.1.*. For users of newer releases (v2006.2.1 or later), slider_revised.zip should be used.
    Attached Files Attached Files
    Last edited by jarvis24; 02-13-2007 at 07:53 AM.

  3. #3
    Join Date
    Nov 2005
    Posts
    3,328
    [edited from support email]
    1. Is there a specific program one should use to edit the continuum.htm file? I do not have much html experience but MS Word seems like it might be inept at this. I would like to be able to add in little images (e.g. smilies) below the slider to reinforce the number value associated with the response.
    2. Is there a way to change the values of the slider from (1,100) to something else, like (-10,10)?Again, I apprecite the support on this. As I mentioned I have little to no html experience.

  4. #4
    Join Date
    Nov 2005
    Posts
    3,328
    Best way to edit html, for me, is with the Windows notepad, or any simple text editor. You can also use Microsoft Frontpage--it is targeted at people who are new to HTML. Generally I would avoid Word unless you are technophobic in which case, it might be the way to go--or find a student who knows HTML--hey there goes one walking down the hall now!

    To adjust the range on the slider, just open the conitinuum.htm file in a text editor and change the following text:

    s.setMinimum(0);
    s.setMaximum(100);
    s.setValue(50);

    to:

    s.setMinimum(-50);
    s.setMaximum(50);
    s.setValue(0);

    And see how that goes!

  5. #5
    Join Date
    Nov 2006
    Posts
    4
    We are finally getting ready to use the MediaLab software for our study. We are using the slider, which you provided earlier, for creating a pain intensity visual analog scale (VAS). The pain VAS ranges from 0-10. We want the slider to report the integer values (e.g. 1, 2, 3...) as well as fraction values upto the first decimal place (e.g. 1.1, 4.3, 5.6...). I modified the slider to that allows it to report the integer values. However, we don't know how to report the fraction values. Can you please help? I am attaching the modified slider.
    Last edited by jarvis24; 03-25-2010 at 08:03 PM.

  6. #6
    Join Date
    Nov 2006
    Posts
    4
    I actually found a solution: I made couple of changes to the slider, 1) I set the slider minimum value to 0 and maximum value to 100, 2) then I set the input text color to white so that the subject cannot see the displayed number on the right side of the slider. See the attached slider (pain.htm).

    However, now I have 4 more issues:
    1) Because I want the slider output to be between 0 and 10, is there a way that MediaLab would divide the output of the slider (between 0 and 100) by 10 to give us the actual value?
    2) I want the length of the VAS to be 10 centimeters long. However, it shows up not be 10 cm. Is there anyway that the Javascript can be setup that it automatically figures out the resolution of the screen and sets it to 10 cm?
    3) On running a MediaLab experiment with the slider (pain.htm), I receive an error box that states something like "var 003 will not be saved... it is a string." I receive quite a few of these messages right before the final prompt that states that the experiment is over. How can I avoid these messages?
    4) Another problem is related to the .csv file generated by MediaLab after running an experiment using the slider. Instead of having actual numbers, the .csv file states "OK." How can that be fixed?

  7. #7
    Join Date
    Nov 2005
    Posts
    3,328
    Wolud have to see the que and htm files. Be sure to zip them as the board doesn't accept unzipped html files.

  8. #8
    Join Date
    Nov 2006
    Posts
    4
    I am attaching the zipped files. Thank you. Bhagwant
    Last edited by Bhagwant; 02-23-2007 at 01:49 PM.

  9. #9
    Join Date
    Nov 2006
    Posts
    4
    Okay, I was able to fix a couple of problems. See attached files. However, the following problems still exits: 1) Because I want the slider output to be between 0 and 10, is there a way that MediaLab would divide the output of the slider (between 0 and 100) by 10 to give us the actual value?
    2) The data file (.csv and .txt) in the folder named "byquestionnaire" to generated after running an experiment states "OK" for all the questionnaire answered and rest of the questionnaire variables have a value of 99. It seems that the software is not working properly.
    Please help!
    Attached Files Attached Files

  10. #10

    Using the revised slider zip with a background picture.

    I have used the revised slider zip and that works fine but when i use it rather than some of the other rating scales you can no longer see the background image that i have specified and i was wondering if there was a way to remedy this? Ideally i would like to have the picture closer to the top and the slider closer to the bottom. Any help with this would be much appreciated.
    Many Thanks

  11. #11
    Join Date
    Nov 2005
    Posts
    3,328
    You can't see background images on a custom item because they are behind the HTML. However, you can add the background image to the code in your custom item like this:

    <IMG SRC="myscale.jpg">

    or

    <IMG SRC="<ml.background>">

    In the latter example, MediaLab will substitute whatever you have listed in the background field for the current item. That can be a nice way to do it because you can vary the image without having to change the custom item file.

    Hope that helps

  12. #12
    Hi, Thankyou for your reply it was helpful- i do however have a couple of further questions- i apologise if this is simple html coding stuff that i do not understand...

    Firstly the first piece of code works fine and inserts a picture i want, however i want to have the picture appear in the centre and i was wondering how to do that (i played about with align center and things and it didn't really work for me).

    Moreover, i would really prefer to be able to use the second piece of code as i have 81 different photos to show and would prefer not to have to make 81 separate custom files, however, when i use it i just get a small box with a cross in it and i was wondering if i had to write something else to make it work- i would also like this in the centre. The photos i am using are bmp files.

    Thankyou so much for your help...
    LLW

  13. #13
    Join Date
    Nov 2005
    Posts
    3,328
    Can you zip your folder and attach it here? I'll take a look at what you've got so far and see if I can help.

  14. #14
    Hi, i have attached the code below. Thankyou for taking a look, it is very much appreciated. Also just to be a little cheeky, i also want to make the numbers to the right of the slider disappear like the person above described...
    Thanks
    LLW
    Attached Files Attached Files

  15. #15
    Hi, so i have learnt how to centre it now... so progress...

  16. #16
    Join Date
    Nov 2005
    Posts
    3,328
    Want to edit your previous post then and attach your newly revised and ceneterd version? I'll take a look and see if I can get the <ml.background> option figured out.

  17. #17
    Sure... here is my new version... sorry if this is bit beginners html!! In my version at the moment is the specific picture piece of code as that was the one i got to work... Thanks!!
    Attached Files Attached Files

  18. #18
    Join Date
    Nov 2005
    Posts
    3,328
    What happens if you replace:

    <center><IMG SRC="f001111.bmp"></center>

    with:

    <center><IMG SRC="<ml.background>"></center>

    Does that work?

    In this case you would want your background in the MediaLab questionnaire to be listed as f001111.bmp, assuming that the .que file and the continuum3.htm file are located in the same folder.

  19. #19
    Hi, Thanks for your advice, unfortunately due to time constarints i had to go ahead and do the program using the long way (i.e. i have many different .htm files) it works fine this way. However, i may have a play about with the opther way of doing it when i have a little more time.
    Many Thanks Again, LLW

  20. #20
    Join Date
    Nov 2007
    Posts
    13

    How can I capitalize letters?

    [edited by moderator]
    Hi!
    This slider works fine except two things:

    Medialab automatically transforms all text to small letters. I cannot use any capital letters, not even to start a sentence. [note from moderator: see http://www.empirisoft.com/support/showthread.php?p=2971]

    How can the indicator at the right be hidden?

    Thanks in advance for a prompt reply!
    Last edited by jarvis24; 12-06-2007 at 11:39 AM.

  21. #21

    Can I use java instead of java script to program a slider?

    Hi Jarvis,

    I want to use a slider for my experiment. I have read your previous post but because I want to adjust the length and the anchors of the slider, I am asking my RA to modify it for me. He wants to know if it is possible to creat a slider using Java instead of Java script as he is more familar with the former than the latter.

    Or could you let us know how to change the length of the slider and the anchor in Java script, if we use the sample that you've posted earlier in this thread?

    Thanks!
    Venus

  22. #22
    Join Date
    Nov 2005
    Posts
    3,328
    You could use Java (or any method), so long as it can work within Internet Explorer and post the data using the method=post function. As far as modifiying the length, you'd have to actually look at the javascript code. I believe there are variables within the code that you can set for such things.

  23. #23
    [edited by moderator]

    My RA has helped me to reprogram the slider with a Java. But how can I intergrate it in my MediaLab file?

    Also, if I use the slider that you have provided in this thread, how can I change the length of it? You have described how to change the maximum and minimum, can you describe how to change the length of the slide, the anchors in two ends and how to hide the numerical value.

    I have attached the Java applet that is created by my RA.

    [a little bit later]

    I have figured out how to add anchors to the end of the items. There are only two things that I need to sort out.

    1. I followed your suggestions below and tried to show a picture in every trial, but it does not work.

    2. I still don't know how to hide the nurmeric value of the slider. Here is my HTML.

    By the way, I just checked the data file. What is showed is whether the participants have answered the question ("ok") but not the values that they have chosen. Have I done something wrong?
    Last edited by jarvis24; 12-13-2007 at 10:35 AM.

  24. #24
    Join Date
    Nov 2005
    Posts
    3,328
    Can you please retry attaching your sample--it didn't seem to post.

  25. #25

    Attachement

    Sorry. Here is the modified html. I have not modify other files.

    It does not allow me to upload the html file as html. I have to change it to .txt.

    I have attached the questionnaire file too.
    Attached Files Attached Files

  26. #26
    Join Date
    Nov 2005
    Posts
    3,328
    I am trying to code something much the same as the above poster; I can manipulate the properties of the html document easily enough, but I cannot get the document to display the image stored as the background image in medialab (even if the image is pointed to 'ml.background').

    The image simply will not load (and instead displays a broken link graphic). Has a workaround been developed for this, or is the only alternative to make separate html documents for each image to be used?

    I have played around with things a bit, but I still cannot get the image cued in the medialab background tab to load in the html document. If I load the image directly into the html file it works fine, but doing so is far more time consuming than being able to index the medialab background.

    I have attached my html code as well as a sample image; please take a look and let me know if there is something obviously wrong with it.

    Here's a copy with the .que file attached. It is the same skeleton as the slider example (included in the slider zip file) without any real changes; I want to get the image display working before I change too much around.

    Thanks!
    Try using <ml.bg> rather than <ml.background> and see if that helps. See the user's guide for the official variable reference or online here:

    http://www.empirisoft.com/medialab/h..._reference.htm
    Attached Files Attached Files
    Last edited by jarvis24; 03-28-2008 at 11:41 AM.

  27. #27
    Join Date
    Feb 2008
    Posts
    11
    Also, I opened the "slider.css" file from this thread, but couldn't find the "input name" part of the HTML text, which means I couldn't figure out what to name that slide so that MediaLab would store the input in SPSS. Where is that in the file?

  28. #28
    Join Date
    Nov 2005
    Posts
    3,328
    The file name you would give to MediaLab would simply be continuum.htm as in the sample que file above. Note to modify the length of the slider you can just modify the code in the htm file to whatever percentage of the screen (or number of pixels) you like:

    <table border="0" width="70%">

    And to get rid of the value appearing at the right, change:

    <input type="text" name="<ml.varname>"

    to:

    <input type="text" style="color:white" name="<ml.varname>"

    As far as displaying images within the continuum.htm page, make sure you are using the angular brackets around the image name. If the image does not appear, replace <ml.background> with the name of a specific image in the same location to see if it appears properly. If so, attach a zipped copy of the html file and image file and I'll take a look.

  29. #29
    Join Date
    Feb 2008
    Posts
    11
    Aaah...thanks. Unfortunately, I was under a time crunch and had to go with another method, but I'll definitely keep those tips in mind for when I use MediaLab in the future. And I hope someone else finds them useful in the meantime!
    Last edited by jarvis24; 03-28-2008 at 11:42 AM.

  30. #30
    Join Date
    Mar 2008
    Posts
    3

    Additional Slider Modification Questions

    Hi All,
    I have three questions about modifying the slider (I am using the revised slider posted on this thread - and using media lab v 2008.1.21):

    1) Is it possible to force the participants to move the slider before pressing continue?
    2) Is it possible to allow participants to simply click on the line and have the slide indicator (not sure what to call this - the button that is moved) automatically appear where they click instead of forcing the subject to slide the indicator to the position? (I'm just thinking this could be easier for them and help avoid question fatigue).
    3) Are there easy ways to change how the slider appears (e.g. use an image for the slider line (like a thermometer) instead of a line)?

    Also, I figured out how to have media lab record the x vector of wear someone is on a picture when they click on it (I have attached it here in case it is useful to people) - but my ideal would be to have it possible for someone to click on a line (or thermometer as attached), have a mark appear where they clicked with a number appearing representing the numerical value of where they clicked (e.g. on a scale of 1-100) and then have a separate continue button for them to click on afterwards (the approach I use in the attached version automatically advances them, but I would like for the subject to see where they clicked and then press continue, with option to change where they clicked if they made a mistake). Is this possible? If it is, can you help me with creating a measurement tool that would do this?

    Thanks in advance for your help!
    -Sol
    Attached Files Attached Files

  31. #31
    Join Date
    Nov 2005
    Posts
    3,328
    Unfortunately most of these questions go beyond MediaLab and are really HTML and JAVA questions. I do think you could add some validation code to the form post section though to ensure they have moved the slider. It's just not something I'm especially great at coding. There may be an example worth looking at here:

    http://www.empirisoft.com/support/showthread.php?t=222

    Also, feel free to post any new techniques you discover on the sharing board:

    http://www.empirisoft.com/support/forumdisplay.php?f=25

  32. #32
    Join Date
    Nov 2007
    Posts
    13

    Slider_revised for 2008 version

    [edited by moderator]
    Hi, I tried to use a modified version of the slider you have in your forum for an experiment run with medialab version 2008. The slider worked perfectly for version 2006, but it did not collect any data in the version 2008 (although superficially it worked ok as well).
    Last edited by jarvis24; 05-27-2008 at 05:41 AM.

  33. #33
    Join Date
    Nov 2005
    Posts
    3,328
    issrcadmin,

    First I've heard of that. Can you zip and attach or send us a copy of your experiment folder complete with sample data? Or better yet, create a simple test folder with just the que file, the slider and data from a single sample run showing the problem--in your case, that no data show up for the slider in the data files. With a simplified 'troubleshooting' version like that we can usually pinpoint the problem fairly quickly.

  34. #34
    Join Date
    Nov 2007
    Posts
    13

    Test slider

    Hi,

    attached a zipped file with the slider and data folders and a simplified version of the experiment (the experiment originally included many images and directrt files that I omitted to reduce file size. The problem also appears in this simplified version).

    As you can see, in all the slider measures "ok" is written instead of data. All the not-slider measures worked. Finally the exact same file runned perfectly including data collection in v2006.

    Finally we still have the data files from the original experiment. Is there possibly a way to retrieve the data from those it is lost for good?

    Thanks for a prompt reply
    Attached Files Attached Files

  35. #35
    Join Date
    Nov 2005
    Posts
    3,328
    Yes, I ran the sample you attached, and I got the result you described. I don't think there is a way to retrieve those data, but I do think I can explain why it happened.

    I took a look at the html in a few of your sample custom items. In the area where you define the variable name for the response, you have it set to "var" but that is not a variable in your experiment. e.g., the first two items to use "like.htm" are ashlik and cuplik. But for both, the variable name stated in the html is name="var" and so MediaLab would not know you want the first two responses posted from like.htm to be assigned to ashlik and cuplik, respectively.

    What ought to work, e.g., for ashlik would be if the html were to use name="ashlik". Consequently,it would use the form data for the MediaLab item that uses that variable name. This method is a bit cumbersome though because in your case you would have to create a different html file for each item (e.g., a different version which uses name="cuplik"). See the section on Creating Custom Items in the user's guide for more detail on using a single custom item file with multiple variables

    So after all that--the easiest alternative here would be to use name="<ml.varname>" in your html. That tells MediaLab to use the name of the current item so you can use one file (such as like.htm for multiple items). In fact, I'm curious--the original code for the slider posted in this thread (above) actually uses <ml.varname>. Is there a reason you changed it to "var"?

    Hope this makes some sense.

  36. #36
    Join Date
    May 2006
    Posts
    12

    slider background image

    I tried to do as you suggested in the quote below (using <ml.bg> rather than <ml.background>) and it still does not work. Instead, my image is appearing on the screen behind my custom slider. If I insert the name of the picture, it works fine. Any other suggestions?

    Quote Originally Posted by jarvis24 View Post
    Try using <ml.bg> rather than <ml.background> and see if that helps. See the user's guide for the official variable reference or online here:

    http://www.empirisoft.com/medialab/h..._reference.htm

  37. #37
    Join Date
    Nov 2005
    Posts
    3,328
    Yes--MediaLab saves a copy of the HTML file that is actually presented.. I believe it will have a "temp" in the filename. Can you run it once with <ml.bg> and once with the image name and then look at the difference in the actual html files that are generated? How can zip and post them here if you like and I'll be happy to take a look.

  38. #38
    Join Date
    May 2006
    Posts
    12
    I ran it as you suggested and have attached both of the TEMP files in the zip file. The _bg file is when I used <ml.bg> and the _pic file is when the actual filename of the picture was used. Everything looks pretty much the same to me. I have it set-up so that a picture (1 of 146) is randomly selected, so the picture filenames are different between the two runs, but that should not have affected anything. Any advice for this java novice is welcomed!
    Attached Files Attached Files

  39. #39
    Join Date
    Nov 2005
    Posts
    3,328
    I see what you mean. Could you post a copy of your que file and your custom html file? I'll run it here and see if I can figure out where the problem is.

  40. #40
    Join Date
    May 2006
    Posts
    12
    Here they are. Thanks for the help.
    Try running the attached revision (testfolder.zip) where the que file uses relative rather than absolute paths. I just tried it on my machine and it works ok now--at least with the test image I used. Note that I changed the the WGR value of the first trial to "none" for test purposes.
    Attached Files Attached Files
    Last edited by jarvis24; 07-01-2008 at 01:42 PM.

  41. #41
    Join Date
    May 2006
    Posts
    12
    The html is now reading the image name from the background field. However, now the "question" variable is not reading the question wording from the que file and I am only getting "ok" as responses in the data, rather than numerical values.

  42. #42
    Join Date
    May 2006
    Posts
    12
    Disregard the previous post. I am now able to have the question wording appear and the slider values recorded. Rather than using the substitutions at the bottom of the html page, I simply replaced the variable name (i.e. question) with the medialab variable (i.e. ml.wording) in the body of the html script.

  43. #43
    Join Date
    Nov 2005
    Posts
    3,328
    Good to hear. The method of using the substitution HTML at the bottom of the HTML file was an early idea that I didn't end up liking very much. I personally prefer the direct substitution like you described. We left the older method functional though just in case anyone still wanted to use it. BTW, if you think any other users might benefit from what you learned, feel free to attach a sample that illustrates what you were able to do that's different from the basic sample above. In any case, glad to hear it's working for you now.

  44. #44
    Join Date
    May 2011
    Posts
    1
    I realize I'm resurrecting this thread here, but I'm wondering if there is a way to modify the slider so that it only displays select increments (i.e., 0, 10, 20, 30,...., 100). I know this is a javascript modification and I tried messing around with the setUnitIncrement and setBlockIncrement methods, but nothing seems to be effected by any of the changes I make. Any tips?

  45. #45
    Join Date
    Nov 2010
    Posts
    4

    Slider and handle modifications

    Hi, when designing my questionnaire, I used the example which was originally posted right at the beginning of this thread titled 'slider.revised' to create the basis for my VAS questions, which has worked really well. However, I'm not particularly computer-minded when it comes to editing the slider or handle in note-pad or using java etc. What I would like if possible is to have a thin vertical line as a handle to make the pointer as accurate as possible.

    In addition, is there a way of having two vertical lines at the end of the 'slider line' to act as endpoints (I have attached a simple diagram in MS word to illustrate what I mean).

    Lastly, for the text labels at each end of the VAS, is it possible that these can be positioned on the same line as the 'slider'? (Again, i've tried to show what I mean in the word doc. attached).
    Would this require a completely new slider example, and if so can you help?

    Thanks very much,

    Jenny.
    Attached Files Attached Files

  46. #46
    Join Date
    Nov 2010
    Posts
    4
    Just wondering if the problem with only an 'ok' response appearing in the data files instead of a numerical value had been resolved, as I am experiencing the same problem, and can't seem to find a solution on this thread? I am unfortunately under a major time pressure to find this out otherwise I will be unable to use the questionnaire if I cannot retrieve sensible results.

    In terms of my last post, I have managed to find a way round my questions.

    Thank you in advance if you are able to respond to this fairly swiftly.

    Jenny

  47. #47
    Join Date
    Nov 2014
    Posts
    1

    numerical data for slider

    I am also experiencing the same problem.
    I would appreciate any advice on how to resolve this.

    Thank you,
    Tal.

  48. #48
    Join Date
    Feb 2013
    Posts
    1,093
    Tal,

    Could you please be more specific about the problem you experienced? Any examples of files you have would also be helpful.
    Jason Reed
    Empirisoft Software Support Specialist

Similar Threads

  1. MediaLab Version 2008.1
    By jarvis24 in forum MediaLab v2018: Version History
    Replies: 8
    Last Post: 02-26-2024, 08:50 PM
  2. DirectRT Version 2008.1
    By jarvis24 in forum DirectRT v2018: Version History
    Replies: 7
    Last Post: 10-26-2018, 07:28 AM
  3. Version / Backwards Compatibility (case 40)
    By jarvis24 in forum Pre-Sales and Licensing FAQ
    Replies: 4
    Last Post: 07-23-2012, 10:12 AM
  4. older versions and MediaLab 2008
    By NancyBrodsky in forum MediaLab Older Versions: General Questions
    Replies: 3
    Last Post: 04-07-2008, 01:38 PM
  5. Run-only version?
    By mha in forum Pre-Sales and Licensing FAQ
    Replies: 1
    Last Post: 09-25-2007, 07:43 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •