How bring selected choices to the next question with their embedded values for further evaluation? - qualtrics

I have a different attributes like
Select any one of the attributes given below:
A
B
C
These attributes has to be selected by the participants for further decision making. If A and B are selected, I need to show A and B along with their embedded data in a table format automatically in Qualtrics.
Imagine if A and B is selected out of the 3 attributes, I need to show it like the table below automatically for participants evaluation.
A 50 80
B 40 30
```
Further if they select only C, C has to be displayed but not A and B.
```
C 90 100
```
I wish to do it in Qualtrics.

Instead of working around with the Qualtrics platform. Use HTML and Javascript to complete the task.
Embed the data first into qualtrics - both the values for A and B and also if A is choosen assign a value to it.
Later, call the data based on conditions using HTML and Javascript. Load them into the question.
However, there is problem in aligning the variable values as a table in Qualtrics. But it is possible overcome it.

Related

DT::dataTableOutput with table in long form and still having full functionality?

In R Shiny, I have a data table in wide form, let's all this Representation A of the data:
Rank
Person
School
1
Sean
Boston
2
Alicia
I'm using DT::dataTableOutput to present this table. I want to instead present this table in long form (Rank identifies the observations):
Rank
Variable
Value of Variable
1
Person
Sean
1
School
Boston
2
Person
Alicia
2
School
I will then also style this table slightly differently, I will:
Only print the first occurrence of a value of rank
The table then becomes:
Rank
Variable
Value of Variable
1
Person
Sean
School
Boston
2
Person
Alicia
School
I will also:
Drop empty rows
So the final table, which we will call Representation B of the data, becomes:
Rank
Variable
Value of Variable
1
Person
Sean
School
Boston
2
Person
Alicia
When presenting the table in the format B, I still want to keep as much of the functionality as possible that DT::dataTableOutput supplies for form A, e.g. the ability to search and sort (without separating rows belonging together) etc. Here, by sorting I don't mean the order variables are presented in within a given rank, but the order the "rank groups" are presented. For example, sorting on Person should yield the following since Alicia comes before Sean lexicographically:
Rank
Variable
Value of Variable
2
Person
Alicia
1
Person
Sean
School
Boston
What do you think is the easiest way to implement this?
Currently, I consider two different ways. In both plans, instead of having the standard sorting buttons provided by DT::dataTableOutput, I will link e.g. a radio button which will allow the user to choose which variable the table should be sorted on (i.e. Rank, Person, or School).
My first option for implementation: When the radio button is pressed, I will (without the user seeing it) transform the table to representation A, sort it there, then transform it to the properly sorted version of representation B.
My second option for implementation: I could to representation B "attach" representation A (without showing the latter to the user) so that each row of the underlying data contains the full information for that rank:
Rank
Variable
Value of Variable
Rank_Long
Person_Long
School_Long
1
Person
Sean
1
Sean
Boston
School
Boston
1
Sean
Boston
2
Person
Alicia
2
Alicia
If I want to obtain the lexicographically sorted B representation, I order the table above by (Person_Long, Rank_Long, Variable). The extra Variable in the ordering is added to get the rows presented to the user (Rank and Variable) in the right order (Person above School).
In practice, I will have around five to ten variables rather than only two (and each of these ten should be allowed to sort on), and I will be running Shiny Server on an AWS server which will be reached through an iframe on a website.
Pros and cons of the first and second options for implementation:
First option: Fast if the dcast and melt functions are fast enough and if melt can be set to preserve the sorting when transforming to long. Should provide faster initial load time of the table for the user since the table won't have as many columns as the second option.
Second option: No reshape needed, but more data sent to the user at initial load.
Which of my two options do you think is the best, and do you have suggestions about other implementations I haven't considered?
I concatenated my columns of interest using paste with properly placed <br> tags for line break. Using DT::datatable(..., escape = FALSE) I could then obtain the table in the form I wanted.
I defined a sliderInput (outside of the table) whose input I set to trigger events for sorting. The table reloads (thus resetting search) when the slider obtains a new input, I will try to fix that (with some filter or proxy solution, or hopefully I find a simple way).

R datatable's editable functionality incorporated with rowtotal and dynamic column calculation

I am trying to produce a user interactive table like Target table
The yellow columns represent editable columns, white ones can't be edited, and they work in following fashion
User updates column B and allocates 100% of distribution among the three rows(40,35,25 in this case). A total is shown in footer to help user identify correct allocation of 100%
Column A updates in backend by multiplying each % with a predetermined number(1000 in this case). A total is shown, which would be 1000 if user entered % correctly
User then enters values in column C. No total is necessary here
Column D is then calculated in backend as a product of column A and column C
Is this achievable by any simple means?
I also then want to reuse this table for more calculations since this is the input prompt
Thank you very much.
You can do most or all of this with the tools you tagged but it won't be simple:
The DT package will not do all of this for you: you will also have to use reactivity.
This link discusses working with edited values in DT, providing an idea of the level of difficulty to expect: R -shiny- DT: how to update col filters.
In addition to what you see in the example, you want to add formatting, a totals row, and only allow editing of some columns, which will require more work.

Dojo DataGrid: Filter column - condition: Values in CSV string exist in an Array?

I am using Dojo DataGrid with dojo 'AndOrReadStore' so that I can use complex queries on column data.
I have a column, say DocumentTypeIds, in dojo DataGrid that shows comma seperated string of type ids of a document for each document row. Lets say its value is '5, 6' among 20 different possible values. These document types are further categorized into 3 categories: A, B, C. for example
Document Type/name | A B C
---------------------------
5 / finance report | 1 0 0
6 / summary report | 0 1 0
Based on choice of A, B and C, I want to filter documents in the grid. For example if user chose C and document type ids are '5,6' then I do not want to filter this document. I can filter the possible document type ids based on category in an array that I want to compare this column against. Lets assume the possible values after choosing option C are [8, 9, 2, 99] then my filtering condition needs to be
[5,6] in [8,9,2,99]
or
'5,6' in '8,9,2,99'
The problem with first approach is that column values are in CSV format so i dont think i can convert those into array in query. The problem with second approach is that i dont want to find string '5,6' in '8,9,2,99' rather i want to find if both '5' and '6' exist in the '8,9,2,99' and they may not appear next to each other in '8,9,2,99'.
I don't know how to approach this problem as it is very important for me to filter the rows at client side because I want to bring in all rows and let user choose what type of documents they want to see.
grid.filter({complexQuery: "DocumentTypeIds: ? "});
I appreciate any help.
Thanks

Restart list numbering in word for each new list created

I am exporting content from a jsp page into MS Word using javascript.
When the user is in Word there is a table with 10 rows and 2 columns, A & B. The user creates an ordered list in row 1, column A like this:
1 dog
2 cat
3 mouse
if the user then creates a second list in row 1 column B is turns out like this:
4 car
5 truck
6 bike
instead of:
1 car
2 truck
3 bike
Word is set up to continue the numbering in lists from prior lists automatically. I know this can be reset easily but the users dont want to have to do this. They want the numbering of any potential lists created to restarted at 1. when the document is exported into Word and opened in front of them.
So this must be set up in the javasctipt code or using a style or something prior to getting into Word. This is what I dont know how to do.
Any help is much appreciated.
Thanks,
Feena.
If you use a named sequence rather than the in-built lists (as in inserting an instnace of the field {SEQ SequenceName} everywhere you want a number), and choose a different name for each of the different lists, it will work as you desire.
e.g.
{SEQ OpenIssueSeq} Issue 1
(SEQ OpenIssueSeq} Issue 2
etc.

Best way to implement a read and write for an unknown amount of rows

I asked a question similarly, but the outcome was pretty messy and I was having difficulties populating so I'm trying to go at from a different angle:
Question concerning asp:listview and multiple dynamically created controls
I have a table which stores steps in a process. Some companies only have 6 steps while others have 15, so I created a table with 15 different slots for steps. What I would like to do is set up a control that displays each step in its own row with a label next to it saying "Step '#'", and not in an adjacent column. I'd also like for it to not display any blank rows. If they are entering the step instructions, I would want for them to have to press a button that would add a row so that they aren't just given 15 empty text boxes to fill in.
What would be the best control to do this in, and how would I get started in setting it up?
You are putting data in the field names in the table, which makes your task more complicated. Instead of storing the steps in columns, like this:
CompanyId Step1 Step2 Step3 Step4 Step5 Step 6 Step7 ...
1 alpha beta gamma
2 one two three four five
You should store the steps as rows, so that you get the step number as data in a field:
CompanyId StepNumber Step
1 1 alpha
1 2 beta
1 3 gamma
2 1 one
2 2 two
2 3 three
2 4 four
2 5 five
This way you don't get any unused fields, and the data model doesn't pose any limitation on the number of steps. Also, you can easily get the steps as a collection instead of having to get each one separately and add to a collection.
Something like:
var steps =
from s in CompanySteps
where s.CompanyId = 2
orderby s.StepNumber
select new { s.StepNumber, s.Step };
Then you have many different options to display the steps, like using the collection as data source in a Repeater, or loop through the items and just create HTML code for them and put in a Literal control.

Resources