Cycling through database entries on dynamic page - with Next Previous - wrong data appearing (not ready?)

I have a dynamic page for a category (students) for which I am cycling through using the next previous buttons homework content.

Based on some flag fields I am trying to conditionally display or not display items. My current code works only for the first item because I am clearly not running the code on the next/previous updates.

How can I cycle through and evaluate each instance. Here’s my example based on the the dataset which is a filtered version on the dynamic page (which has already filtered by student).

How can I get this to be properly revaluated on the next click. The values don’t appear to be consistently evaluated.

export function dataset11_ready() {
// This function was added from the Properties & Events panel. To learn more, visit Velo: Working with the Properties & Events Panel | Help Center | Wix.com
// Add your code for this event here:

var enableaud = $w( ‘#dataset11’ ).getCurrentItem().audioenabled;
var enablevid = $w( ‘#dataset11’ ).getCurrentItem().videoEnabled;
var enableprint = $w( ‘#dataset11’ ).getCurrentItem().printenabled;

if (!enableaud) {
$w( ‘#group1’ ).hide();
$w( ‘#text95’ ).hide();

    } 

console.log( “enable print is” , enableprint);
if (!enableprint) {
console.log( “enable print is” , enableprint);
$w( ‘#image43’ ).hide();
$w( ‘#text94’ ).hide();
}

//console.log(“video enabled”,itemData.videoEnabled);
if (enablevid === “no” ) {

    $w( '#image44' ).hide(); 
    $w( '#text96' ).hide(); 
    } 

}

export function button10_click(event) {

dataset11_ready(); 

// This function was added from the Properties & Events panel. To learn more, visit Velo: Working with the Properties & Events Panel | Help Center | Wix.com
// Add your code for this event here:
}

export function button9_click(event) {
// This function was added from the Properties & Events panel. To learn more, visit Velo: Working with the Properties & Events Panel | Help Center | Wix.com
// Add your code for this event here:
dataset11_ready();
}