define(['questAPI'], function(quest){
var API = new quest();
/**
Question-prototypes
**/
API.addQuestionsSet('basicSelect',
{
type: 'selectOne',
style:'multiButtons',
autoSubmit:true,
numericValues:true,
required:false,
errorMsg: {
required: "Please select an answer, or click 'decline to answer'"
}
});
// each stim
API.addQuestionsSet('infoQuest',
[
{
inherit : 'basicSelect',
name : 'infoQuest',
stem :
//'<p class="lead"><br/><br/><img src="/implicit/user/bkurdi/reinterpret1a/images/' + API.getGlobal().target1Photo[0] + '.jpg" height="250">'+
'<p class="lead"><br/><br/>You are about to read one more piece of information about Francis West on the next page.'+
'<br/><br/>Click “Continue” to begin. You must wait at least 5 seconds to proceed.'
+
'<br/><br/>',
onLoad: function(log, current) {
// hide continue button
document.querySelector('#task > div > div.ng-scope.ng-isolate-scope > div > div > div.page-buttons').style.opacity = 0;
var delayInMilliseconds = 5000;
setTimeout(function() {
//this code will be executed after 5 second
//console.log("done");
document.querySelector('#task > div > div.ng-scope.ng-isolate-scope > div > div > div.page-buttons').style.opacity = 100;
}, delayInMilliseconds);
} // function ends
}
]);
/**
Pages
**/
API.addPagesSet('basicPage',
{
decline:false,
v1style:2,
numbered: false,
noSubmit:false, //Change to true if you don't want to show the submit button.
submitText: "Continue"
});
/**
Sequence
**/
API.addSequence(
[
{inherit : 'basicPage',
questions : {inherit:{set:'infoQuest'}}}
]);
return API.script;
});
--
You received this message because you are subscribed to the Google Groups "Minno.js" group.
To unsubscribe from this group and stop receiving emails from it, send an email to minnojs+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/minnojs/c42f778d-04f8-47fe-9045-7132362543dan%40googlegroups.com.
1. Perhaps there's a more elegant solution, but here is a quick way of doing this:
(I switched to an actual question because the onLoad hook didn't work with the info question).define(['questAPI'], function(quest){
var API = new quest();
/** Question-prototypes **/
Question-prototypes
**/
API.addQuestionsSet('basicSelect',
{
type: 'selectOne',
style:'multiButtons',
autoSubmit:true,
numericValues:true,
required:false,
errorMsg: {
required: "Please select an answer, or click 'decline to answer'"
}
});
// each stim
API.addQuestionsSet('infoQuest',
[
{
inherit : 'basicSelect',
name : 'infoQuest',
stem :
//'<p class="lead"><br/><br/><img src="/implicit/user/bkurdi/reinterpret1a/images/' + API.getGlobal().target1Photo[0] + '.jpg" height="250">'+
'<p class="lead"><br/><br/>You are about to read one more piece of information about Francis West on the next page.'+
'<br/><br/>Click “Continue” to begin. You must wait at least 5 seconds to proceed.'+
'<br/><br/>',
onLoad: function(log, current) {
// hide continue button
document.querySelector('#task > div > div.ng-scope.ng-isolate-scope > div > div > div.page-buttons').style.opacity = 0;
var delayInMilliseconds = 5000;
setTimeout(function() {
//this code will be executed after 5 second
//console.log("done");
document.querySelector('#task > div > div.ng-scope.ng-isolate-scope > div > div > div.page-buttons').style.opacity = 100;
}, delayInMilliseconds);
} // function ends
}
]);
/** Pages **/
Pages
**/
API.addPagesSet('basicPage',
{
decline:false,
v1style:2,
numbered: false,
noSubmit:false, //Change to true if you don't want to show the submit button.
submitText: "Continue"
});
/** Sequence **/
Sequence
**/
API.addSequence(
[
{inherit : 'basicPage',
questions : {inherit:{set:'infoQuest'}}}
]);
return API.script;
});
You might need to change the CSS selector (this is the selector I got when running the task from the task's play button, rather than the expt file). For that, you'll need to right-click the Submit button and press inspect. Then, right-click the highlighted line of HTML code, press Copy -> Copy selector.
2. Do you need the stimuli before the seed task? If not, then you can keep the function there, and save 'rand' as global, for later use (in other tasks), with something like this: global.rand = rand.
// each stim
API.addQuestionsSet('infoQuest',
[
{
inherit : 'basicSelect',
name : 'infoQuest',
stem :
//'<p class="lead"><br/><br/><img src="/implicit/user/bkurdi/reinterpret1a/images/' + API.getGlobal().target1Photo[0] + '.jpg" height="250">'+
'<p class="lead"><br/><br/>You are about to read one more piece of information about Francis West on the next page.'+
'<br/><br/>Click “Continue” to begin. You must wait at least 5 seconds to proceed.'+
'<br/><br/>',
onLoad: function(log, current) {
// hide continue button
//document.querySelector('#task > div > div.ng-scope.ng-isolate-scope > div > div > div.page-buttons').style.opacity = 0;
document.querySelector('#task > div > div.ng-scope.ng-isolate-scope > div > div > div.page-buttons').style.visibility = "hidden";
var delayInMilliseconds = 5000;
setTimeout(function() {
//this code will be executed after 5 second
//console.log("done");
//document.querySelector('#task > div > div.ng-scope.ng-isolate-scope > div > div > div.page-buttons').style.opacity = 100;
document.querySelector('#task > div > div.ng-scope.ng-isolate-scope > div > div > div.page-buttons').style.visibility = "visible";
}, delayInMilliseconds);
} // function ends
}
]);
var API = new Quest();
var global = API.getGlobal();
var current = API.getCurrent();
API.addSettings('onEnd', function()
{
var questResp = current.questions.userconsent.response;
global.questResp = questResp;
console.log("global.questResp: " + global.questResp);
});
To view this discussion on the web visit https://groups.google.com/d/msgid/minnojs/CAPGF78E0sDx_jGKXmzOcJa_oVFrcg%2BrwjyRi-QO8CQutgZO46w%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/minnojs/CAPGF78GDnnqAj_K1nerSHcnGANE_nBOAz%2BLzBYPnNenLgTjmsA%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/minnojs/CAN9p%3DakA%3DDrfRGVWiyMpvRbPYLR_4jtqRvFNALOOhh6o1JYm6Q%40mail.gmail.com.
Great, just shared with you.On Sun, Mar 6, 2022 at 7:17 AM Mayan Navon <navm...@gmail.com> wrote:mayannaOn Sun, 6 Mar 2022 at 14:05, Jordan Axt <jorda...@gmail.com> wrote:Sure thing! Can you tell me your dashboard username?
On Sun, Mar 6, 2022 at 5:00 AM Mayan Navon <navm...@gmail.com> wrote:
Hi Jordan,Sorry for the delay in my response. I think that's still because the prompt question is not the first question being loaded.But, I want to check if I can still make it work. Could you please share your study with me?Thanks,Mayan
--To view this discussion on the web visit https://groups.google.com/d/msgid/minnojs/CAN9p%3Dan%3DNeM8-iy3hO%3DVmsVfvTFd_4TD3Qaf0z9d1OMb39fB5w%40mail.gmail.com.
Jordan Axt--Jordan Axt