I need to randomize the SECTIONS (not questions) in my google form. The reason I need to do sections is because every section corresponds to a video so each needs to be a section.
This is the closest thing I've gotten to a solution:
https://developers.google.com/apps-script/reference/forms/page-break-item
// Create a form and add three page-break items.
var form = FormApp.create('Form Name');
var pageTwo = form.addPageBreakItem().setTitle('Page Two');
var pageThree = form.addPageBreakItem().setTitle('Page Three');
// Make the first two pages navigate elsewhere upon completion.
pageTwo.setGoToPage(pageThree); // At end of page one (start of page two), jump to page three
pageThree.setGoToPage(FormApp.PageNavigationType.RESTART); // At end of page two, restart form
I've already made the form and don't want to remake it (so many questions, so many videos). If I could use the .setGoToPage function shown above I think I could find a solution to randomize the sections aka pages. I just don't know what the names of my already existing pages are or how to find them. Please help!!!!
As you noticed yourself the methods applicable to a page are very limited
So, while you can add a page break, you cannot retrieve it in a subsequent code execution, and thus there is no way to shuffle it.
There is also no way to retrieve or set the questions belonging to each page in order to create new pages with questions on each script execution.
You have the possibility to file relevant feature requests on Google's Public Issue Tracker, chances are they will be implemented in the future if enough users show interest
In the mean time, as a workaround the only 2 things I can come up with is
a) Duplicate your form, shuffle the pages manually from the UI for each duplicate, create a WebApp that will arbitrary redirect the user to one of the URLs of the different form versions
b) Summarize all questions belonging to one page / section into one question item - it is easy to shuffle opposed to pages
In case it's helpful - further information:
How to shuffle questions each time a form is submitted
How to shuffle questions on time-driven trigger
Related
First I should explain my site structure. I have WordPress pages (with each their own page-{id}.php template to change what they look like), these are also the main pages on my website. Consider these an overview, so like a catalogue in a store (which my website is not, but it's a good comparison)
On these pages I show a list of links (to continue the metaphor, the products of that store) to other pages, when I click on one of these links I go to a new page with actual content (a detailed view of the product in our metaphor). These pages are WordPress posts and are influenced by the single_post.php template.
Now the problem, for four out of five pages there is no problem and the single_post.php template does a great job. But for the last page I wanted to go a different route, but I cannot change the contents of that page because if I do, I'd have to change the single_post.php template file and break the other pages.
So here's my question, I'm aware of the is_home function in WordPress and I was wondering if there is a way to check in the single_post.php file which page I'm on and depending on if I'm on one of the four good pages or the one bad page, I show different content? (Basically is there something like the is_home function where you change the "home" part to a specific name of a page?)
This doesn't have to be something specific like the is_home, a regular javascript or something would work just fine too.
You can use is_single function like below to check you are in which post:
if(is_single(123)) // Here check if post id equal 123
// some code
if(is_single("My post") // Here check if post title equal My post
// some code
if(is_single("my-post-slug") // Here check if post slug equal my-post-slug
// some code
A few months ago I used the excellent advice over here to create a survey in Qualtrics with some javascript code that saved people's responses (given by moving a slider) as embedded data. It all hinges on being able to call some functions when the "Next" button is clicked, as is found under $('NextButton').onclick = function (event) in the above link.
I wanted to reuse that survey this weekend, and found that the data was no longer being saved. After fiddling around a bit, I realised that currently, any such function will now only be run the first time the "next" button is clicked, and not on any subsequent time. In other words, precisely the same javascript will either work or do nothing depending on whether it happens to be the first time the next button is clicked.
I mailed Qualtrics asking for advice, and their support person mailed back with the following:
The old application that ran our surveys would reload the page each time you went to a new page in the survey. The current application that runs our surveys is a one page app and going to the next page in a survey does not refresh that entire page, it just presents a different section.
I couldn't find anything on the Qualtrics website giving more information about the aforementioned update, or indicating whether there's a new CSS selector that could be used to select the currently-displayed "next" button, replacing $("NextButton"), and I have no idea how to reverse engineer a Qualtrics survey web page to work it out for myself.
Can anyone suggest how the code in the linked answer above might be altered to work on the updated Qualtrics platform? Or can anyone confirm whether their old code still works, in which case I'm mis-identifying what the problem is.
I have insufficient reputation to comment on the above-linked solution to point out this issue, but perhaps someone else could do so. I'll update this if I get any more information from Qualtrics support.
Qualtrics uses two survey engines: the older SE and the newer JFE. Qualtrics Support was referring to JFE. You can force Qualtrics to use SE by adding the parameter Q_JFE=0 to your survey link. That might be a quick fix.
That said, adding an event listener to the NextButton has never worked reliably with either SE or JFE. Qualtrics has its own event listeners on the Next Button that interfere. The most reliable method is to use JavaScript to hide the NextButton, then add your own button that performs any process you need, then at the end clicks NextButton. See example here.
I haven't tried T. Gibbon's Q_JFE=0 suggestion above, and the suggestion to hide the Next button didn't work for me (though it's possible this was just because I did it wrong - perhaps someone could comment if it worked for them).
When I mailed Qualtrics, their suggestion was to add an event listener as follows, and then remove it before applying another.
document.getElementById('NextButton').addEventListener(function (event) {
doStuff();
});
However, since I'm just a psychologist who wants to get data quickly rather than a javascript programmer, I wasn't sure just how to go about 'removing an event listener', and decided to try what I thought was a simpler solution, in that it doesn't rely on having some functions run when the 'next' button is clicked.
For each question that contains a slider whose data I want to save (I had just one such question per page), I included the following, to save the ID for that particular question as embedded data. Each question's ID is saved with a unique tag ('q1ID' in the following). I had one such question per page.
Qualtrics.SurveyEngine.setEmbeddedData('q1ID', this.getQuestionInfo().QuestionID);
Then once all the slider-type questions had been presented, on the following page I included this code:
Qualtrics.SurveyEngine.addOnload(function()
{
var tags = ['q1','q2', 'q3'];
var pipedStrings = {'QID356':'${q://QID356/TotalSum}',
'QID357':'${q://QID357/TotalSum}',
'QID358':'${q://QID358/TotalSum}'};
tags.forEach(function(tag) {
var qID = Qualtrics.SurveyEngine.getEmbeddedData(tag + 'ID');
var response = pipedStrings[qID];
Qualtrics.SurveyEngine.setEmbeddedData(tag, response);
});
});
Initially, I'd tried what I thought was more sensible:
tags.forEach(function(tag) {
var qID = Qualtrics.SurveyEngine.getEmbeddedData(tag + 'ID');
var response = '${q://' + qID + '/TotalSum}';
Qualtrics.SurveyEngine.setEmbeddedData(tag, response);
});
But as pointed out here, Qualtrics won't allow you to fetch data by concatenating a variable into a string like this. Consequently, even though it seems a ridiculously roundabout what to do it, I created the pipedStrings object that has a list of all the question IDs I needed (which I found by exporting the survey to a text file and searching for my question tags).
This allowed me to save the responses to slider questions as embedded data, with the keys listed in tags. If anyone has a simpler approach, avoiding have to create the dictionary of pre-formatted strings, please do comment.
I have found many older suggestions and solutions, none of which work as expected and many that just cause more issues.
Assume my web app allows users to create invoices and print them. These invoices may have any number of line items (even 100 or more). If the number of line items exceeds the page size, they are placed on the second page. This is fine.
What isn't fine is that if the second page should ever become separated from the first, it can get hard to tell which invoice it belongs to.
Is it at all possible (css, js, html, hacks, etc) to have a block of content repeat at the beginning of each and every paper page printed from a web page?
The linked possible duplicate question is from a few years ago and has no accepted answer, while the top answer doesn't actually work (as shown in the comments)
If at all possible create a PHP module and put it on every page inside of your web app. I've had to do this a few times.
If you want it to have an invoice number you can script it to start at 1001 and go up every time a function is completed. (A print button is selected)
May I suggest using page-break-after:. With page break you can control wherethe page breaks then re-insert headers.
what is the easiest most efficient - from a performance standpoint - way to program an aspx that will have sections in it rendered as tabs and preferably to be loaded on demand?
I have a certain entity that can be edited by different groups of users, each user group being able to edit certain parts of it. I am thinking of rendering the parts accessible to a group in a tab on the page and then controlling access/load of the tabs based on user rights.
i know a couple of javascript frameworks that address this specific type of requirements do exist, however i am a novice js programmer, i never used it for anything more than handling control events and doing very basic stuff so i do not know how fast i can pick up and use one of them.
You don't really need tabs for that, have it a single page and just load/display data relevant to current user group.
One way to do this (since you're using ASP.NET) is to use MultiView control and display relevant View control for the current user group.
I'm new to ASP Web Pages. Trying to build a shopping like website. I have created Databases first, Now what I want is to display "some" items of users' interest only so as to keep page light. Later when user scrolls down, next "x" number of items are fetched from Database and are shown to the user. Its like something you can see on myntra.com, but definitely not like on ebay.com where number of items are fixed on one page. I know it will use javascript but can't figure out the correct timings of firing events and adding more items to page?? I saw on stackoverflow itself about scroll down event, but I think that was related to a particular ID on a page.
Here's how it's done on the client side:
http://www.youtube.com/watch?v=eziREnZPml4
In addition to that, you will need some server-side logic that will track what has been sent already, when a request for more contents comes in. One way you could achieve that is to always read the items in the same order, and have the browser send the "latest" item that it has with each subsequent request.