I'm trying to import a few thousand questions into Qualtrics using the Advanced Formatting option detailed here https://www.qualtrics.com/support/survey-platform/survey-module/survey-tools/import-and-export-surveys/
I would like to be able to bring in an image URL with each question block and have the link display as a graphic. The documentation mentions there is a [[Text]] or [[DB]] – Text/Graphic (Descriptive Block) function but I can't figure out how to call it properly.
I have tried the following : (\n means new line below and there are no spaces)
[[Question:Graphic]] \n https://cdn.britannica.com/s:300x300/55/174255-004-9A4971E9.jpg
where I get a "Error Calling Service" message and
[[Question:DB]] \n https://cdn.britannica.com/s:300x300/55/174255-004-9A4971E9.jpg
and
[[Question:DB:Graphic]] \n https://cdn.britannica.com/s:300x300/55/174255-004-9A4971E9.jpg
However, it is only importing as a text question and not showing the URL as a graphic. The Graphic option for question type is not highlighted after importing (none of the circles are selected till I click something).
Please let me know if you have any suggestions. Thanks!
Import doesn't import images. If you want to import the images into your Qualtrics library, you would have to import them separately by going to Library/Graphics.
Whether you import them into Qualtrics or not, you need to include the html to display the image in your question. For example:
[[Question:DB]]
[[ID:Q1]]
<img src="https://cdn.britannica.com/s:300x300/55/174255-004-9A4971E9.jpg">
Related
I have this example of Excel file where the data contain some random values. I generated this using RAND() function.
What I want to do is read this excel file using R so that I can color red and bold the number 9 wherever it appears in the cell. Is this possible to do?
I've been searching on Google a while but haven't been able to figure it out any other way other than using VBA. But it's not an option.
Does anybody have an example of how to achieve this?
What I wanted to do is not possible using any of the python packages - xlsxwriter can only do rich text like I wanted but only on new cell but cannot modify, openpyxl can do a lot of things but not rich text. Wasn't sure if it could be done using R or not, but seems like it's not possible to do what I want done. I saw a Google Group discussion here where they showed a potential method to perform what I wanted, but that method didn't work for me. It showed .jnew is not recognized.
So, instead, what I did is created a function to add a color dot (image) to the cell to delineate that the cell contains the value I'm searching for - 9 in this case. The reason I can't use conditional formatting is because there's another conditional formatting that is applied for another logic.
def __add_color_dots__(self, ws=None, excel_filename=None):
from openpyxl.drawing.image import Image
import os
path = os.path.abspath('blue-dot.png')
image = Image(path)
image.anchor = 'C4'
ws.add_image(image)
return ws
Hope this will help someone later and that this method maybe a useful workaround.
I have a workflow where I'm downloading Google Docs as docx, then processing them to markdown for export to other formats in the R environment.
When I convert to markdown with pandoc_convert, I get embedded images, but they're not linked.
I want to add link syntax similar to this post,
i.e. I want this (not linked):
![m'lady](https://i.imgur.com/v8IVDka.jpg)
to be (linked):
[![m'lady](https://i.imgur.com/v8IVDka.jpg)](https://i.imgur.com/v8IVDka.jpg)
for every image in a document. How to do?
After much toil, I put this function together, which solves my issue:
addLinksToPhotos<-function(mdfile){
d<-readLines(mdfile)
s<-sapply(d,function(x) {
replacementPattern="[\\1(\\2)](\\2)\\3"
gsub('.*?(?<firstpart>!\\[[^\\]]*?\\])\\((?<filename>.*)\\)(?<potentialHTML>\\{.*?\\})?.*?',x=x,replacement=replacementPattern,perl=T)
},USE.NAMES = F)
writeLines(s,mdfile)
}
#usage
addLinksToPhotos("myRMarkdownDoc.rmd")
It will read every line in the markdown file, looking for the photo ![]() pattern, including where it has style coding in braces ![](){}. It will modify each instance to have a linked image [![]()](){}.
I want to create an Advanced TXT file for importing a survey into qualtrics.
This help file says that you can include text/graphic descriptive block.
Specifically, you are meant to be able to use the following tags:
[[Text]] or [[DB]] – Text/Graphic (Descriptive Block)
However, the help file does not provide any examples of how it is meant to be used. And when I try the obvious options, I get the following error message on import:
Error parsing file (line 5) invalid directive Text
I've tried a few things.
Option 1:
[[Text]]
Here is some text
Option 2:
[[Text:foo]]
Here is some text
Option 3:
[[Text]]
[[ID:foo]]
Here is some text
They all generate the same error.
Thus, the question is:
How do you use the[[Text]] tag for text blocks in Advanced TXT file for a Qualtrics survey?
Do it like this:
[[Question:DB]]
[[ID:foo]]
This is text
I am new to R and have worked for a while as follows. I have the code writen in a word document, then I copy and paste the document with the code into R as to have the code run which works fine, however when the code is long (hundred pages) it takes a significant amount of time in R to start making the code run. This seems rather not a very effective working procedure and I am sure there are other forms to compile the R code.
On another hand one of then that comes to my mind is to import the content of word into R which I am unsure how to do. Have tried with read.table but it does not work, have look on internet as to how to import data, however most explanations are all for data tables etc or internet files in the form of data tables and similar. I have tried saving the document into csv. however word does not include csv have tried with Rich text format and XML package but again the instructions from the packages are for importing tables and similars. I am wondering if there is an effective way for R to import a word document as is in the word document.
Thank you
It's hard to say what the easiest solution would be, without examining the word document. Assuming it only contains code and nothing else, it should be pretty easy to convert it all to plain text from within Word. You can do that by going to File -> Save As, and use 'plain text' under 'Save as type'.
Then edit the filename extension to .R from .txt, download a proper text editor (I can recommend RStudio for R), and open your code in it. Then you will be able to run the code from inside the editor without using copy / paste.
No, read table won't do it.
Microsoft Word has its own format, which includes a lot of meta data over and above the text you enter into it. You'll need a reader/parser that understands the Word format.
A Java developer would use a library like Apache POI to read and parse it into word tokens and n-grams.
Look for Natural Language Processing tools, like this R module:
http://cran.r-project.org/web/views/NaturalLanguageProcessing.html
Many of the math textbooks and other literature I read is in PDF format, so I frequently find myself annotating these with the Adobe Reader comments tool.
I did find a helpful guide here, but sometimes I'd like the option of inserting math symbols, too. Has anyone found a reliable way to insert math symbols, TeX, or other arbitrary formatting into the annotations?
So far, the best I've come up with is to enter the unicode prefixed by "0x" and hit alt+X after it. Maybe with the Adobe javascript SDK you could write a script to shortcut this.
I don't think any of the current commercial editors make this easy, which is too bad. I am sure the vendors monitor this site, so there is hope.
In the meantime, here is a manual workaround.
Use tikz to create your comment boxes. Here are the two examples I found to be most relevant: Boxes and Positioning. Play around with the options to get both the shape and the placement you want. Generate a pdf file from the latex source that contains your comments.
IMPORTANT: if your comments end before the last page of the original document, insert:
\pagebreak{} % create empty page
\thispagestyle{empty} % get rid of page numbers et al
~ % put a space so the page gets generated
before your \end{document}, to get an empty last page. The following command will reuse the last page of your comments document on all subsequent pages of the original document.
Use a recent version of pdftk with the multistamp command to overlay your equations file with your original file like so:
pdftk original.pdf multistamp comments.pdf output out.pdf
Also see this question.
The free (as speech) PDF tool, Okular, supports this functionality by putting latex formula directly between $$...$$.