PennController for IBEX › Forums › Support › disabling continue button
- This topic has 0 replies, 1 voice, and was last updated 3 weeks ago by
didemkurt.
-
AuthorPosts
-
February 23, 2025 at 3:11 pm #11096
didemkurt
ParticipantHello,
I am trying to use PCIBEX to conduct a research where my participants read a text with some target words which have pop-up definitions appearing just next to them. The only data I want to get is to be sure that my participants clicked on the target words I provided. At first I tried to get data for the counts of clicks but I couldnt succeed it. Now I am trying to disable continue button until they click on each target word and enable it again.
This is just a part of an ELT study so just being sure that the words are clicked will help me argue that my participants read the definitions. can you please help me because I am dealing with this for days and I have no idea about coding this is what I did with the help of AI.
I will provide the comprehension questions on paper as well. Please only help me to either save the data for click counts or disable the continue button and activate it only after the target words clicked. this is what I have so far:
PennController.ResetPrefix(null);
PennController.DebugOff();// PARTICIPANT ID INPUT PAGE
Sequence(“ParticipantID”, “Experiment”, “End”);// INITIALIZE CLICK COUNTS
newVar(“ExpanseClicks”).global().set(0);
newVar(“ObsessionClicks”).global().set(0);
newVar(“AngleClicks”).global().set(0);
newVar(“OffendedClicks”).global().set(0);
newVar(“IntenseClicks”).global().set(0);// PARTICIPANT ID INPUT PAGE
newTrial(“ParticipantID”,
newText(“You will read three texts and answer their comprehension questions. You can see the meaning of the bold words by clicking on them. Do not use any additional sources or leave this page during the test. Your Participant Number: “).print(),
newTextInput(“ParticipantNumber”).print(),
newButton(“Continue”).print().wait(),
newVar(“ParticipantNumber”).global().set(getTextInput(“ParticipantNumber”))
)
.log(“ParticipantNumber”, getVar(“ParticipantNumber”));// READING PASSAGE WITH CLICKABLE WORDS
newTrial(“Experiment”,
newTimer(“StartReadingTime”, 1).start().wait(), // Start timing
newVar(“ReadingStartTime”).global().set(v => Date.now()),newText(“Passage”, “<p>Successful architect Mary Arnold-Forster gave up her life in London to live in the north of Scotland on the Isle of Skye.</p><p>Mary Arnold-Forster lives in an isolated place, even by the standards of Skye, so when visitors from London come to the house she has built in a spectacularly beautiful location on the southernmost tip of the island, the emptiness of the landscape can come as a shock. A surprising number have made the long trip north, from experienced travelers to nervous stay-at-homes. ‘Whoever they are, they look at the wide <b id=’expanse’>expanse</b> before them and seem a bit overwhelmed at first – as if they don’t quite know what to do with it,’ says Mary.</p><p>A couple of years ago, Mary was one of many architects in London. What set her apart, though, was her other life, far away from the concerns of London, in the empty Highlands of Scotland. As a child, Mary had often visited her grandmother in Edinburgh, Scotland’s capital city. And when she grew up she developed an<b id=’obsession’>obsession</b> for hillwalking and climbing. On Fridays, as the working week ended, she was increasingly to be found taking a sleeper train from London to somewhere in Scotland, returning on Monday morning to go straight to work. Then she met two brothers who had already set up a successful architectural practice on Skye. The three architects found they got on so well that it seemed natural for the brothers to invite Mary to become a partner in the growing practice.</p><p>At first, she slept on various friends’ floors on Skye, but she’d always planned to build her own house. ‘Building your own home is usually associated with starting a family and nest-building, but life is too short,’ she says. ‘Sometimes I think about me not having a partner, but then I realize that friends are just as important as having a family, so maybe it isn’t the worst thing that could happen to you.’ Mary found a spot on the Sleat peninsula for sale at a reasonable price. ‘I spent hours and hours over a couple of months just sitting here and watching the sun and tracking the light, so that I knew just what width the house should be and what <b id=’angle’>angle</b> it should be set at and how I wanted it to feel inside. I knew if I got that right then everything would be fine.’ Work started in April 2000 and by the following August Mary had moved in.</p><p>Many of Mary’s friends were excited by the idea of her moving to a place of space and beauty, and impressed by her ability to get things done on her own. However, there were others who thought she was completely mad, and were even<b id=’offended’>offended</b> that a woman with many friends would take herself off from her home and connections in London, build her own house and decide to live alone.</p><p>‘I love people coming to stay here,’ she says. ‘That’s why the house has got so many bedrooms and such a huge kitchen table. I certainly wasn’t trying to get away from people, but just from the daily hustle and bustle. When London friends come to stay now, we get to talk in a way that we hardly ever got the chance to before. Here, we can have lovely, long gossipy walks day after day. Some friends wouldn’t dream of coming up from London to visit me, though, because they just can’t see what there is to do here.’ There is, in fact, quite a lot to do. There seems to be an <b id=’intense’>intense</b> social scene on the island which, she says, goes across the generations.</p><p>Mary admits to feeling lonely occasionally during the winter: ‘Not as lonely as I sometimes felt in London, though, when I was imagining everyone else sharing a joke at a party I wasn’t at and probably wouldn’t want to have been invited to anyway. Any time I have felt really lonely here, it goes away more quickly because I can always change my mood by going out climbing or walking.’</p>”)
.print()
.css(“width”, “80%”),// JavaScript to handle click events on words
newFunction(“trackClicks”, function() {
let words = {
“expanse”: “a large open area of land”,
“obsession”: “something you think about all the time”,
“angle”: “a position from which something is looked at”,
“offended”: “upset and angry, often because someone was rude”,
“intense”: “extreme, very strong”
};Object.keys(words).forEach(word => {
document.getElementById(word).addEventListener(“click”, function() {
let def = words[word];// Create the definition box (popup)
let defBox = document.createElement(“div”);
defBox.innerText = def;
defBox.style.position = “absolute”; // Absolute positioning to place it dynamically
defBox.style.backgroundColor = “yellow”;
defBox.style.border = “1px solid black”;
defBox.style.padding = “5px”;
defBox.style.zIndex = “1000”; // Make sure it’s on top of other elements// Get the position of the clicked word
let wordElement = document.getElementById(word);
let wordRect = wordElement.getBoundingClientRect();// Position the definition box just next to the word (to the right)
defBox.style.top = (wordRect.bottom + window.scrollY + 5) + “px”; // 5px below the word
defBox.style.left = (wordRect.left + window.scrollX) + “px”; // Same horizontal position// Append the definition box to the document
document.body.appendChild(defBox);// Automatically remove the definition box after 3 seconds
setTimeout(() => defBox.remove(), 3000);// Track the click count for this word
// Use the global variable and increment it by 1
let wordVar = getVar(word.charAt(0).toUpperCase() + word.slice(1) + “Clicks”);
wordVar.set(wordVar.value + 1);
});
});
}).call(),newButton(“Continue”).print().wait(),
newVar(“ReadingEndTime”).global().set(v => Date.now()),
newVar(“TotalReadingTime”).global().set(v => getVar(“ReadingEndTime”).value – getVar(“ReadingStartTime”).value)
)
.log(“ExpanseClicks”, getVar(“ExpanseClicks”))
.log(“ObsessionClicks”, getVar(“ObsessionClicks”))
.log(“AngleClicks”, getVar(“AngleClicks”))
.log(“OffendedClicks”, getVar(“OffendedClicks”))
.log(“IntenseClicks”, getVar(“IntenseClicks”))
.log(“TotalReadingTime”, getVar(“TotalReadingTime”));// END SCREEN
newTrial(“End”,
newText(“This is the end of the experiment. You can close the window.”).print(),
newButton(“Close”).print().wait()
); -
AuthorPosts
- You must be logged in to reply to this topic.