-
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:
[INDENT][INDENT]A: 25
B: 30
C: 0
D: 0
E: 45[/INDENT][B]Total = 100[/B][/INDENT]
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.
-
1 Attachment(s)
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.
-
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?
-
The data should be saving automatically to the MediaLab data file.
-
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="?
-
What version of MediaLab are you using, i.e., 2006.x.x?
-
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?
-
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.
-
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.
-
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
-
1 Attachment(s)
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.
-
Thanks, this looks great!!
-
Could someone tell me what codes to use to get the table here, especially how to get the total 100? Thanks,
-
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?
-
1 Attachment(s)
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:
[I]Subject Cond Exper Inifile Date Time perctest[/I]
'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
[I][update by user][/I]
[QUOTE]
I figured it out, after poking around on the Support Threads.
Thanks!
[/QUOTE]
-
What was the fix? Just curious.
-
1 Attachment(s)
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