Empirisoft Support

    Welcome to Empirisoft Support
Results 1 to 17 of 17

Thread: Custom item - Autosum

  1. #1
    Join Date
    Aug 2006
    Posts
    3

    Custom item - Autosum

    Hi, if anyone could help me out on this - many thanks in advance!

    I'm trying to find out if someone has already developed this custom item. It sounds simple enough but I don't have any programming experience.

    I have 1 item with 5 labels. I want the respondent to rate their preference for each of these labels using a number from 0-100, but i'd like the total for each of label preference to add to 100, like so:

    A: 25
    B: 30
    C: 0
    D: 0
    E: 45
    Total = 100
    The total has to add to 100 in order to go to the next item. Does anybody know of someone who has done this and would like to share?

    If I'm not making sense, I can reclarify.

  2. #2
    Join Date
    Nov 2005
    Posts
    3,328
    Check this out--it's a custom item that was developed by one of our other users--I just modified it a bit to match what you are describing. See if it's in the ball park.
    Attached Files Attached Files

  3. #3
    Join Date
    Aug 2006
    Posts
    3
    Thanks heaps - i'm having some trouble trying to get the data to save to a new xml file automatically, or even the existing one in which the experiment is inputting to. Any thoughts?

  4. #4
    Join Date
    Nov 2005
    Posts
    3,328
    The data should be saving automatically to the MediaLab data file.

  5. #5
    Join Date
    Aug 2006
    Posts
    3
    Thanks, I've figured out how to get it to save now.

    However, the data is being written in a strange way. My variable name is "1BEH", and the data is being written as "1beh=asdf" ("asdf" being the input).

    How do I get rid of the "1beh="?

  6. #6
    Join Date
    Nov 2005
    Posts
    3,328
    What version of MediaLab are you using, i.e., 2006.x.x?

  7. #7

    auto sum item

    Hello,

    I need a custom item just like the one you describe in your post from September 2006. Did you ever get this to work?

  8. #8
    Join Date
    Aug 2008
    Posts
    14

    custom percentage item

    I also need an item just like this (which I have posted about in another thread before finding this one). It looks great at first - however, I couldn't get it to work because whenever the total was supposed to add up to 100, the box said it was '10'. Thoughts? fixes?

    There's also a straggling letter 'h' hanging down on the page - not sure if this has anything to do with it. I'm not super familiar with Javascript, although I've been trying/willing to learn in order to deal with these items I need.

  9. #9
    Join Date
    Aug 2008
    Posts
    14
    Got this to work for me after all! Some minor edits to the code, and it worked beautifully. I suspect maybe it didn't work before because of some browser compatibility issues, but I don't know for sure. Anyway, thanks to all for providing this code - it was a big help to me.

  10. #10
    Join Date
    Nov 2005
    Posts
    3,328
    Wagnerla,

    Thanks for the update--would you care to post and attach your revised version just in case it could help anyone who comes across the same problem?

    -Blair

  11. #11
    Join Date
    Aug 2008
    Posts
    14

    updates to autosum

    Sure - here's my version of it. I took out the hanging "h" which seemed to be causing some problems. I also re-did the layout so the percentages are vertical instead of spread out across the page, and made it so that a participant can enter "100" in one box and leave the rest as zero. There's a style sheet that makes it look more similar to the default MediaLab style, for better continuity. I hope this is helpful to some people.
    Attached Files Attached Files

  12. #12
    Join Date
    Nov 2005
    Posts
    3,328
    Thanks, this looks great!!

  13. #13
    Join Date
    Oct 2008
    Posts
    2
    Could someone tell me what codes to use to get the table here, especially how to get the total 100? Thanks,

  14. #14
    Join Date
    Nov 2005
    Posts
    3,328
    Can you elaborate? e.g., are you wondering how to edit the underlying html code, or how to use the form within a MediaLab questionnaire?

  15. #15
    I've taken the wagnerla file and made changes for my own needs.
    But, I sure can't get it to save data.

    For that matter, I can't get the custom files 'percentages.html' or 'fruit.htm' to save data either from this thread to save data either.

    When I run them I only get values for these variables in my data files:

    Subject Cond Exper Inifile Date Time perctest

    'perctest' is what I called the custom item type which I linked to, for example, 'fruit.htm.'

    I'm attaching the actual revised custom file I'm working off of.
    Any suggestions would be helpful.

    rob

    [update by user]
    I figured it out, after poking around on the Support Threads.
    Thanks!
    Attached Files Attached Files
    Last edited by jarvis24; 12-01-2008 at 10:36 PM.

  16. #16
    Join Date
    Nov 2005
    Posts
    3,328
    What was the fix? Just curious.

  17. #17

    Here you go

    Basically, it was just reading more to understand how the Custom Item option works (he said sheepishly).

    But, I've uploaded what the final outcome was...along with a new section to our Lab Manual that gives instructions.

    Hope it's helpful.

    Happy Holidays.
    rob
    Attached Files Attached Files

Similar Threads

  1. custom item with background image
    By rkozink in forum MediaLab Older Versions: How Do I...
    Replies: 1
    Last Post: 05-04-2006, 01:10 PM

Posting Permissions

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