Welcome to the LimeSurvey Community Forum

Ask the community, share ideas, and connect with other LimeSurvey users!

Search Results (Searched for: random)

  • Joffm
  • Joffm's Avatar
05 May 2023 11:35 - 05 May 2023 11:38
Replied by Joffm on topic Conjoint Analysis with some conditions
What is the content of the cell.
I assume you entered the formula to create the random number.

No, you just replace your old

with


And in the table cell it is still
{if(random7== 1, 'KMT',if(random=7= 2, 'DPP',if(random7== 3, 'NPP',if(random7== 4, 'TPP','NA'))))}
or whatever

Joffm
 
  • Martin Jönsson
  • Martin Jönsson's Avatar
05 May 2023 11:28
Replied by Martin Jönsson on topic Customizing questions randomly and systematically
Thank you so much for this. This is perfect!
  • RitaShen
  • RitaShen's Avatar
05 May 2023 09:35 - 05 May 2023 09:37
Replied by RitaShen on topic Conjoint Analysis with some conditions
Dear Joffm,

I would like to express my sincere appreciation for your assistance, and my deepest apologies for any inconvenience caused. Initially, I had intended to simplify the table before seeking your guidance, but it appears that my actions have caused you some trouble. I deeply regret any inconvenience this may have caused you, and I am truly sorry.

And I've followed your code:

{if(is_empty(random6),if(random5==2,round(1.3*rand(1,3)), rand(1,4)),random6)}
rand(1,3) selects a random number 1, 2 or 3
so the result of 1.3*rand(1,3) is 1.3, 2.6 or 3.9
And after rounding you have your desired 1,3 and 4



However, when I tested it, the number 2 still appeared. 
 

Rita
 
  • Joffm
  • Joffm's Avatar
05 May 2023 09:13
Replied by Joffm on topic Conjoint Analysis with some conditions
Well,

and if in the first column there is DPP then in the second column there is only NPP and TPP?

That's the already shown code (if the second column is random6)
{if(is_empty(random6,if(random5==2,rand(3, 4), rand(1,4)),random6)}

And here you said

for random6, can I use the word to replace the number?
random6  "1 = lower high school/ 2 = high school/ 3 = Undergraduate/ 4 = Graduate"

If I have two condition:
1. random 5 is equal 2 (DPP), random6 will appear 1 or3 or 4,
2. random 5 is equal 1 (KMT), random6 will appear 2 to 4,

Now, please, decide about your naming.
What exactly is selected by random5, random6, random7 and rendom8?

Now you know that the "rand(x,y)" function requires two parameters,
So this is wrong syntax
{if(is_empty(random6),if(random5==2,rand(1, 3, 4), rand(1,4)),random6)}
The simple solution is to recode the items of the degree.

The other is to remember some arithmetic at school.
{if(is_empty(random6),if(random5==2,round(1.3*rand(1,3)), rand(1,4)),random6)}
rand(1,3) selects a random number 1, 2 or 3
so the result of 1.3*rand(1,3) is 1.3, 2.6 or 3.9
And after rounding you have your desired 1,3 and 4

Joffm
  • RitaShen
  • RitaShen's Avatar
05 May 2023 08:48
Replied by RitaShen on topic Conjoint Analysis with some conditions
Dear Joffm,

I apologize for any inconvenience caused, as your idea is indeed correct.

require a dependency between random5 and random6
and if in the first column there is DPP then in the second column there is only NPP and TPP?
  • Joffm
  • Joffm's Avatar
05 May 2023 08:37 - 05 May 2023 08:39
Replied by Joffm on topic Conjoint Analysis with some conditions
Hi,
why did you change your assignments:
In the original code 
random5 and random6 were the "DPP/NPP/TPP" stuff
random7 and random8 were the degrees

Now you say:
random6  "1 = lower high school/ 2 = high school/ 3 = Undergraduate/ 4 = Graduate"
Do you want to confuse yourself or confuse us? 

BTW:
You entered the equation into the question code of your table.

Of course you have to enter it as the alternative creation of the random number.
 

Joffm
 
  • Joffm
  • Joffm's Avatar
05 May 2023 08:24
Replied by Joffm on topic Conjoint Analysis with some conditions
Hi, Rita,

sorry, I do not understand why you suddenly wish a dependency between random5 and random6

this was your original code
Code:
        <tr>
            <td bgcolor="#f2f2f2" style="text-align: center;"><span style="font-size:20px;"><strong><span style="color:#000000;"><span style="font-family:標楷體;">黨籍</span></span></strong></span></td>
            <td style="text-align: center;" width="1%"> </td>
            <td bgcolor="#f2f2f2" style="text-align: center;"><span style="font-size:20px;"><strong><span style="color:#000000;"><span style="font-family:標楷體;">{if(random5== 1, 'KMT',if(random5== 2, 'DPP',if(random5== 3, 'NPP',if(random5== 4, 'TPP','NA'))))}</span></span></strong></span></td>
            <td style="text-align: center;" width="1%"> </td>
            <td bgcolor="#f2f2f2" style="text-align: center;"><span style="font-size:20px;"><strong><span style="color:#000000;"><span style="font-family:標楷體;">{if(random6== 1, 'KMT',if(random6== 2, 'DPP',if(random6== 3, 'NPP',if(random6== 4, 'TPP','NA'))))}</span></span></strong></span></td>
        </tr>
        <tr style="height: 6px; text-align: center;">
        </tr>
        <tr>
            <td bgcolor="#f2f2f2" style="text-align: center;">
            <p><span style="font-size:20px;"><strong><span style="color:#000000;"> <font face="標楷體">學歷</font></span></strong></span></p>
 
            <p><span style="font-size:20px;"><strong><span style="color:#000000;"><font face="標楷體">前一份工作</font></span></strong></span></p>
            </td>
            <td style="text-align: center;" width="1%"> </td>
            <td bgcolor="#f2f2f2" style="text-align: center;">
            <p><span style="font-size:20px;"><strong><span style="color:#000000;"><span style="font-family:標楷體;">{if(random7== 1, 'lower high school',if(random7== 2, 'high school',if(random7== 3, 'Under Graduate','Graduate')))}</span></span></strong></span></p>
            </td>
            <td style="text-align: center;" width="1%"> </td>
            <td bgcolor="#f2f2f2" style="text-align: center;"><span style="font-size:20px;"><strong><span style="color:#000000;"><span style="font-family:標楷體;">{if(random8== 1, 'lower high school',if(random8== 2, 'high school',if(random8== 3, 'Under Graduate','Graduate')))}</span></span></strong></span></td>
        </tr>

 

And this was your requirement
condition1: KMT/DPP/NPP/TPP/NP  (this is random5 - in the first column, resp. random6 in the second column)
condition2: lower high school/high school/Undergraduate/Graduate (this is random7 - in the first column, resp. random8 in the second column)
If Condition 1 appears as DPP, Condition 2 cannot appear as lower high school or high school.

So there is only a dependency of random5 and random7 (resp. random6 and random8).

And this was, what I showed

{if(is_empty(random7),if(random5==2,rand(3, 4), rand(1,4)),random7)}
It is only:
If "random5" is equal 2 (DPP) then "random7" is a random number from 3-4, so 1(Lower high school) and 2(high school) will not be selected.
If "random5" is not equal 2 then "random7" is a random number from 1-4, so all degrees are possible.
Of course everything surrounded by the usual construct "if(!is_empty(randonnumber),   "

I think this was your requirement.


Now you require a dependecy between random5 and random6
Does it mean: If in the first column there is DPP then in the second column there is only NPP and TPP?

Joffm

 
  • RitaShen
  • RitaShen's Avatar
05 May 2023 07:05 - 05 May 2023 07:23
Replied by RitaShen on topic Conjoint Analysis with some conditions
Hi Joffm,

I have followed the code,
Code:
{if(random5== 1, 'KMT',if(random5== 2, 'DPP',if(random5== 3, 'NPP',if(random5== 4, 'TPP','NA'))))}
{if(is_empty(random6),if(random5==2,rand(3, 4), rand(1,4)),random6)}

but if random 5 is equal 2 (DPP), random6 will appear 1 or 2, May I know which step I have done incorrectly?
 

File Attachment:

File Name: limesurvey...4988.lss
File Size:26 KB


for random6, can I use the word to replace the number?
random6  "1 = lower high school/ 2 = high school/ 3 = Undergraduate/ 4 = Graduate"

If I have two condition:
1. random 5 is equal 2 (DPP), random6 will appear 1 or3 or 4,
2. random 5 is equal 1 (KMT), random6 will appear 2 to 4,

is the code written like this:
Code:
{if(is_empty(random6),if(random5==2,rand(1, 3, 4), rand(1,4)),random6),if(is_empty(random6),if(random5==1,rand(2, 3, 4), rand(1,4)),random6), }

Thanks
Rita

 
  • holch
  • holch's Avatar
04 May 2023 17:35 - 04 May 2023 17:39
Replied by holch on topic Was ist neu in Version 5
da scheint was auf der Website falsch gelaufen zu sein. Klick doch mal auf "Whats new in Limesurvey 6"... 

So, jetzt habe ich nochmal geklickt und jetzt erscheint auch dort die Info zu LS6 vs LS5, vorher war es noch "LS5 vs. LS3", vermutlich noch im Cache. Habe die info aber nicht gesichert und damit kann ich es dir auch nicht zukommen lassen.

In einem Inkognito-Fenster meines Browsers kam dann aber bei Whats new in LS5 wieder die richtige Info. Einfach mal ausprobieren. Zur Sicherheit, habe ich das mal hier gesichert:

New features in LimeSurvey 5 compared to version 3Most important new features 

  • Upload & Install your own question themes inside the administration
  • Field-based data encryption – this can be activated for survey participants and responses on a field-by-field case to store sensitive personal data securely
  • Many new functions for ExpressionScript (formerly ExpressionManager)
  • Introduction of user roles. You can now to assign a pre-defined set of permissions to new/existing users.
  • PHP 8 support (minimum PHP version was raised to 7.2.5).
  • User interface enhancements
Even more features in detailGlobal settings 
  • Global maintenance mode – put your surveys into maintenance mode if needed
  • Global user administration settings and admin creation email template now available
Plugins 
  • Plugins can now be given a priority
  • Ability to add static ExpressionScript functions by plugin
  • New plugin event to modify email text before sending
  • Ability to modify attachments in beforeTokenEmail plugin event
  • New event afterGenerateToken
  • New afterSurveyActivate & afterSurveyDeactivate plugin events
  • New event to send custom email if redirected after registration
  • Possible to install plugin via zip file upload
Survey participants 
  • New access code/token plugin to specify the exact format of the access code
Security 
  • Email SMTP passwords are now saved encrypted in database
  • Password strength rules can be configured using a plugin
  • Send out password reset links instead of random password
Survey themes 
  • Allow to upload and use custom fonts
  • New function to revert theme files to default
  • New twig function to get theme resource URL
  • ExpressionScript engine HTML can now be customized
  • Dropdown options can now be defined in theme configuration
  • Batch reset/uninstall survey themes
  • Configure if NoTables is active in the theme
  • Convert LS3 themes to new theme format automatically
ExpressionScript 
  • New functions statCount & statCountIf to count statistics data
  • New function floatval() to convert a number/text to float value
  • New placeholder to use the SEED value
  • New placeholder to access the question help text
  • New function to get the question text of multiple choice and array questions via questioncode.question
Export 
  • Configure a custom logo for queXML export
  • New setting for date format and question code in queXML export
  • Enhanced output of graphs in PDF statistics export
Permissions 
  • User role permissions – assign a role instead of individual permissions
  • Allow administration user to update script with enabled XSS filter
  • Allow insertion of videos with enabled XSS filter
  • New “Select all” choice when editing survey permissions
RemoteControl API 
  • Extend list_participants to allow advanced conditions
  • New getQuestionAttributes() function to get question attributes
System 
  • PHP 8 support and minimum PHP version was raised to 7.2.5.
  • Ability to also select InnoDB (vs MyIsam) as database engine for MySQL during installation
  • Allow custom modules to extend LS core controllers and their views
Survey groups 
  • New permission system for survey groups – assign individual permission for a certain group of surveys
Emails 
  • Invitation/reminder sending rate can now be configured
  • Possibility to add cc, bcc to any email
Question types/editing 
  • Configurable prefix for subquestion and answer options in personal settings
  • New placeholder setting for text & numeric questions
  • Save question settings as default question type values to speed up creation of similar questions
  • Usage of textarea for subquestion ExpressionScript
  • Show group relevance (if any) in question view
  • Share resources (uploaded images/files) between surveys
  • Lock organizer in the sidebar
  • Show warning when activating a survey that is already expired
  • Soft mandatory prompt – this reminds a participant to fill out a question but may still proceed without doing so
Question themes 
  • Possible to install question theme with zip file upload
  • Ability to disable a question theme


Finde das aber insgesamt schon etwas wenig für eine "Arbeit". Was ist denn das für eine Arbeit? Finde das Thema etwas sehr dünn.
Displaying 646 - 654 out of 654 results.

Lime-years ahead

Online-surveys for every purse and purpose