I am trying to develop an application one of whose features is a survey form. This survey could change from time to time. So I thought, the best way to go about it would be to notify the user of a newer version of the survey and let him download it as a text file. Once downloaded, I would process the text file for some pre-defined tags and then load it as a survey form on to his screen with multiple text fields and textviews. Are there any sample codes available that show how we can code these different tags that can processed later before showing a survey scroll view.
For example: I can have [Question] for a textview and [Empty] for a textfield and [Multiple] for a multiple choice answer possibility. Similarly [[Start]] and [[End]] for starting and ending the text to be processed.
I have tried to search online for better methods of doing this. I came across this question where a webview is suggested, but I need the survey to be available offline so the user could save his answers and continue/change them later.
You should probably use 1 of the many standard formats used to store and manage data like XML:
<Question text="What is...?" />
for a basic user input question
<Question text="What is...?">
<Answer text="Option 1">
<Answer text="Option 2">
</Question>
for a multiple choice question
etc.
I don't know of any open source projects with text files, but there is an open source library that allows you to create a editable PDF. You can take a look at that and see if this library offers you what you are looking for. Anyway here is the link:
http://fastpdfkit.com/
Related
I am working on "Advanced integration" of a forms from Wufoo to Asana. SO far I have followed the Asana guide - https://asana.com/guide/help/api/wufoo
Guide is excellent and everything within the guide work as it says, but I need to go a bit further.
I notice that there is a bit of symbols that asana recognize from the forms( like quotes"" , equal ==, question mark ?), example of multiple choice menu:
"Chose person" == "asana tag" ? 1559453678421
"Chose person" == "asana person" ? blablabla#something.org
So in the following example I can have a multi choice menu that can assign task to a person and/or put a tag.
If I add a second person, that person become a follower, which is great.
My goal:
I want to make the form filler to add its email address, and that email address to be add as follower of the task.
What I know:
I have so far talked with Wufoo support and they told me that the text from the form goes in a straight text form to Asana, and asana actually recognize the form and create the specific tasks, for example:
<strong>This become BOLD text in asana</strong>
I keep on looking for the rest of the recognized symbols, but without success so far. If you have any kind of information regarding the "Advanced integration" I would love to know.
(I work at Asana.) Right now we only support routing through fields that are hidden (have the "hide" classname) with our Wufoo integration, but your use-case is very interesting. I'll take a look and see if we can enable this.
I have found a 2 workarounds to make this work for me.
Workaround 1
So far I have discover that asana recognize "hide" CSS Layout and the field labels : project,tag,assignee,follower . If these values are true then to make this editable I add a Wufoo form Rule that can show/hide fields. for example :
If "Email" contains "#" show "assignee"
And that rule does not change the CSS Layout Keyword "hide" so the form is send the same way with the only difference that the "hide" field is actually visible and that make it easily editable.
Workaround 2
By keeping the fields hide you can still edit them with "URL Modifications ". So basically have 2 forms linked together, so the first form fill up information that is send to the second form within the URL, so the fields remain hidden but being filled up by the URL. - I have not played with that much but Wufoo support briefly explain to me that its possible
URL Modification reference - http://help.wufoo.com/articles/en_US/SurveyMonkeyArticleType/URL-Modifications
I am surprised there isn't an Umbraco Contour field out-of-the-box that lets form editors write RichText or at least plain text instructions in-between the form fields, so that form authors can add more detailed instructions scattered throughout a form.
Does anyone know if this exists?
I found this suggestion in 2011: http://our.umbraco.org/forum/umbraco-pro/contour/22661-Place-plain-text-in-contour-form
My first attempt, I put together a custom field for Contour 3.0.21 and Umbraco 7.1.x, but I am not too keen on how the form results table now has an empty column. Instead, I would prefer that the content is placed in the form without creating a column in the result table, and also without emailing an empty field in the "Send Email" workflow email.
Have you tried taking a look at the Contour Contrib project for Contour?
http://our.umbraco.org/projects/developer-tools/contour-contrib
There is a Label fieldtype there that I believe does what you're looking for. If it does, you can get the source for that project and use that to create more field types that meet your needs. I hope that helps!
I use LibreOffice Writer and I want to insert an alternative text to a specific phrase in the document, how can I do it?
Example if we have an image in the document we can make double left click and add the alternative text like this:
Is it possible to make the same if we select a whole phrase of text? If yes how? And if No is there any other proposal?
The alternative text in 'word'/odt documents is actually intended as the 'alt' attribute in HTML (web) pages:
The alt attribute provides alternative information for an image if a
user for some reason cannot view it (because of slow connection, an
error in the src attribute, or if the user uses a screen reader).
(http://www.w3schools.com/tags/att_img_alt.asp)
It's only purpuse is thus to provide the user with information in case he/she can not view the image. Since having alternative text in case some text cannot be displayed is, well, silly, this 'alt' attribute is not defined for pieces of text. Alternatively, you could have a hyperlink pointing to nothing ("#"), which does provide a tooltip attribute.
What is it that you're intending to achieve anyway? It's not going to show up on any prints, which is the intended purpose of Writer... Footnotes (for prints) or Comments (for communication with co-editors) might suit you better.
I have a SharePoint Server 2007 installation. What I needed to do is to create a simple printable page/file which is populated with data from a list. For various bugs and reasons I can't do this with a word template in a word document library and I can't use workflows.
My solution so far is very rude and simple, but it gets the jobs done:
I created a new custom form called print.aspx
I insert a Custom List Form based on the display form.
Successfully pasted the text, put the data fields and added a couple of text fields for additional data that is required in the print form but not on the list item.
This print.aspx custom form won't save anything and it is not required.
Now what I want to do is place a link in the customized DispForm.aspx that leads to the printing page so when the user enters the list item and it is approved they can click to see it. At the bottom of the DispForm.aspx there will be a simple link to print.aspx saying "To print this click here". Unfortunately I have no idea how to link to the ID of the item in print.aspx.
Example:
In InternalPortal/Lists/ImportantList/DispForm.aspx?ID=5 I want the link to point to InternalPortal/Lists/ImportantList/print.aspx?ID=5
Already tried ID={#ID} and ID=item.ID but to be honest and not sure how to use them.
Edit: In summary - the link ends in ID={#ID} but it should be in the DataFormWebPart. This will not work outside of it.
I want to create a tagging system like seen here on Stack Overflow or on Quora. It'll be its own model, and I'm planning on using this autocomplete plugin to help users find tags. I have a couple of questions:
I want tags to be entirely user-generated. If a user inputs a new tag by typing it and pressing an "Add" button, then that tag is added to the db, but if a user types in an existing tag, then it uses that one. I'm thinking of using code like this:
def create
#video.tags = find_or_create_by_name(#video.tags.name)
end
Am I on the right track?
I'd like to implement something like on Stack Overflow or Quora such that when you click a tag from the suggested list or click an "Add" button, that tag gets added right above the text field with ajax. How would I go about implementing something like that?
I know this is kind of an open-ended question. I'm not really looking for the exact code as much as a general nudge in the right direction. Of course, code examples wouldn't hurt :)
Note I am NOT asking for help on how to set up the jQuery autocomplete plugin... I know how to do that. Rather, it seems like I'll have to modify the code in the plugin so that instead of the tags being added inside the text field, they are added above the text field. I'd appreciate any direction with this.
mbleigh's acts_as_taggable_on gem is a feature-complete solution that you should definitely look into a little more closely. The implementation is rock-solid and flexible to use. However, it is mostly concerned with attaching tags to objects, retrieving tags on objects, and searching for tagged items. This is all backend server stuff.
Most of the functionality you are looking to change (based on your comments) is actually related more to your front-end UI implementation, and the gem doesn't really do much for you there. I'll take your requests one-by-one.
If user inputs a new tag, that tag
gets added, if user inputs an
existing tag, the existing tag gets
used. acts_as_taggable_on does this.
Click a tag from suggested list to
add that tag. This is an
implementation issue - on the
back-end you'll need to collect the
suggested list of tags, then display
those in your presentation as links
to your processing function.
Autocomplete as user enters
potential tag. You'll use the jQuery
autocomplete plugin against a list
of items pulled off the tags table.
With additional jQuery, you can
capture when they've selected one of
the options, or completed entering
their new tag, and then call the
processing function.
Restrict users to entering only one
tag. This will be your UI
implementation - once they've
entered or selected a tag, you
process it. If they enter two words
separated by a comma, then before or
during processing you have to either
treat it as one tag, or take only
the text up to the first comma and
discard the rest.
When you process the addition of a
tag, you will have to do two things.
First, you'll need to handle the UI
display changes to reflect that a
tag has been entered/chosen. This
includes placing the tag in the
"seleted" area, removing it from the
"available" display, updating any
counters, etc. Second, you'll need
to send a request to the server to
actually add the tag to the object
and persist that fact to the
database (where the taggable gem will take over for you). You can either do this via
an individual AJAX request per tag,
or you can handle it when you submit
the form. If the latter, you'll need
a var to keep the running list of
tags that have been added/removed
and you'll need code to handle
adding/removing values to that var.
For an example of saving tags while editing but not sending to server/db until saving a form, you might take a look at the tagging functionality on Tumblr's new post page. You can add/remove tags at will while creating the post, but none of it goes to the database until you click save.
As you can see, most of this is on you to determine and code, but has very little to do with the backend part. The gem will take care of that for you quite nicely.
I hope this helps get you moving in the right direction.
The more I try to force the acts-as-taggable-on gem to work the more I think these are fundamentally different types of problems. Specifically because of aliases. The gem considers each tag to be its own special snowflake, making it difficult to create synonyms. In some cases it doesn't go far enough, if you want the Tag to have a description you'd need to edit the given migrations (which isn't hard to do).
Here's what I'm considering implementing, given the trouble I've had implementing via the gem. Let's assume you want to create a tagging system for Technologies.
Consider the following psuedo code, I haven't yet tested it.
rails g model Tech usage_count::integer description:text icon_url:string etc. Run the migration. Note the
Now in the controller you will need to increment usage_count each time something happens, the user submits a new question tagged with given text.
rails g model Name::Tech belongs_to:Tech name:string
Name::Tech model
belongs_to :tech
end
Then you could search via something like:
search = Name::Tech.where("name LIKE :prefix", prefix: "word_start%")
.joins(:tech)
.order(usage_count: desc)
.limit(5)
This is starting point. It's fundamentally different from the gem, as each tag is just a string on its own, but references a richer data table on the back end. I'll work on implementing and come back to update with a better solution.