Hi @nitneuq22,
At the moment only forms support such a feature as mentioned in this doc:
https://wpmudev.com/docs/wpmu-dev-plugins/forminator/#enable-logged-in-submission-only
Quiz doesn’t support submission limits.
You’ll have to check the possibility of whether the Quiz could be created using the Form to implement the limits.
If you are looking to change the behaviour within Quiz then it’ll require custom coding. I’m afraid custom coding is outside the scope of support we can provide.
For that, you’ll need to hire a developer to provide the required custom code for you. WordPress provides a jobs directory here https://jobs.wordpress.net/, if you need further advice about it, feel free to email wpsupport@incsub.com.
Subject: ATTN: WPMU DEV support – wp.org”
Regards,
Nithin
Thank you for your quick answer !
Could you guide me on where I can find the system for the “classic” forms (the plugin’s files) ? maybe I can adapt the code and use an other hook to get this to work.
Thank you 🙂
Hi @nitneuq22
I pinged our Forminator Team to review your query. We will post an update here as soon as more information is available.
Kind Regards,
Kris
Hi @wpmudevsupport13 !
Thank you 😀 I’ll be waiting then ^^
Hello @nitneuq22
We got further feedback from our development team.
You can check the code in this directory /wp-content/plugins/forminator/library/model/class-base-form-model.php starting from line number 1632. You can see how it’s implemented for the forms.
Hope that helps you achieve your goal.
Kind Regards
Amin
Hello @nitneuq22 ,
I hope the information provided above helped with resolving the issue.
As we haven’t heard back from you for a while, I’m marking this thread as resolved. Please feel free to reopen it in case you still need our assistance.
Best Regards,
Dmytro
Hi !
Sorry for the delay, I tried this :
add_filter( 'forminator_quiz_is_submittable', 'custom_limit_quiz_submission', 10, 3 );
function custom_limit_quiz_submission( $can_submit, $quiz_id, $quiz_settings ) {
// Limite des soumissions à 1 par utilisateur
if ( ! empty( $quiz_settings['logged-users'] ) && filter_var( $quiz_settings['logged-users'], FILTER_VALIDATE_BOOLEAN ) ) {
if ( is_user_logged_in() ) {
$user_submitted = Forminator_Form_Entry_Model::count_user_entries( $quiz_id );
if ( $user_submitted >= 1 ) {
$can_submit = array(
'can_submit' => false,
'error' => esc_html__( 'You’ve already taken this quiz.', 'forminator' ),
);
}
} else {
$can_submit = array(
'can_submit' => false,
'error' => esc_html__( 'You must be logged in to take this quiz.', 'forminator' ),
);
}
}
return $can_submit;
}
But unfortunately it won’t work, i don’t know why, the system is the same, maybe it’s the filter
Hi @nitneuq22,
Sorry to know the code failed.
As mentioned in our previous response, custom coding is beyond the scope of the support provided here. To proceed with this, you will need to hire a developer. You can explore the WordPress job board to find a developer who can assist you.
https://jobs.wordpress.net/
For any additional information, please feel free to reach out to us at wpsupport@incsub.com using the following subject line.
Subject: ATTN: WPMU DEV support – wp.org
Best Regards,
Nebu John