Skip to content

Revert "LUT-28957 Checking answer completeness before submission" #429

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 30, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -947,7 +947,6 @@ xpage.form.view.loadBackUp=Resuming backup of {0}
response.xpage.form.view.pageTitle=My response to the form
response.xpage.form.view.pagePathLabel=My response to the form

xpage.form.error.steps.validation=You have a validation error in the steps : {0}
xpage.form.error.control={0}
xpage.form.error.limitNumberResponse=You have already responded to this form, so you can no longer access it
xpage.listForms.pagetitle=List of forms
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -951,7 +951,6 @@ xpage.form.view.loadBackUp=Reprise de la sauvegarde du {0}
response.xpage.form.view.pageTitle=Ma r\u00e9ponse au formulaire
response.xpage.form.view.pagePathLabel=Ma r\u00e9ponse au formulaire

xpage.form.error.steps.validation=Vous avez une erreur de validation des \u00e9tapes : {0}
xpage.form.error.control={0}
xpage.form.error.limitNumberResponse=Vous avez d\u00e9j\u00e0 r\u00e9pondu \u00e0 ce formulaire, vous ne pouvez donc plus y acc\u00e9der
xpage.listForms.pagetitle=Liste des formulaires
Expand Down
27 changes: 0 additions & 27 deletions src/java/fr/paris/lutece/plugins/forms/web/FormXPage.java
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,6 @@ public class FormXPage extends MVCApplication
protected static final String MESSAGE_PATH = "forms.xpage.form.view.pagePathLabel";
protected static final String MESSAGE_ERROR_NOT_RESPONSE_AGAIN_FORM = "forms.xpage.form.error.limitNumberResponse";
protected static final String MESSAGE_ERROR_CONTROL = "forms.xpage.form.error.control";
protected static final String MESSAGE_ERROR_STEPS_VALIDATION = "forms.xpage.form.error.steps.validation";
protected static final String MESSAGE_LIST_FORMS_PAGETITLE = "forms.xpage.listForms.pagetitle";
protected static final String MESSAGE_LIST_FORMS_PATHLABEL = "forms.xpage.listForms.pathlabel";
private static final String MESSAGE_WARNING_LOST_SESSION = "forms.warning.lost.session";
Expand Down Expand Up @@ -609,18 +608,6 @@ public synchronized XPage doFormResponseSummary( HttpServletRequest request ) th
return getStepView( request );
}
FormsResponseUtils.fillResponseManagerWithResponses( request, true, _formResponseManager, _stepDisplayTree.getQuestions( ), false );
List<Step> stepList = StepHome.getStepsListByForm( form.getId( ) );
Set<Integer> validatedStepIds = _formResponseManager.getValidatedSteps( ).stream( ).map( Step::getId ).collect( Collectors.toSet( ) );

List<Step> invalidSteps = stepList.stream( ).filter( step -> !validatedStepIds.contains( step.getId( ) ) ).collect( Collectors.toList( ) );

if ( !invalidSteps.isEmpty( ) )
{
SiteMessageService.setMessage( request, MESSAGE_ERROR_STEPS_VALIDATION, new Object [ ] {
invalidSteps.stream( ).map(Step::getTitle).collect( Collectors.joining(", ") )
}, null, null, null, SiteMessage.TYPE_ERROR, null, getViewFullUrl( VIEW_STEP ) );
return getStepView( request );
}
boolean needValidation = form.isCaptchaStepFinal( );
if ( isCaptchaKO( request, needValidation ) )
{
Expand Down Expand Up @@ -726,20 +713,6 @@ public synchronized XPage doSaveFormResponse( HttpServletRequest request ) throw
return getStepView( request );
}
FormsResponseUtils.fillResponseManagerWithResponses( request, true, _formResponseManager, _stepDisplayTree.getQuestions( ), false );

List<Step> stepList = StepHome.getStepsListByForm( form.getId( ) );
Set<Integer> validatedStepIds = _formResponseManager.getValidatedSteps( ).stream( ).map( Step::getId ).collect( Collectors.toSet( ) );

List<Step> invalidSteps = stepList.stream( ).filter( step -> !validatedStepIds.contains( step.getId( ) ) ).collect( Collectors.toList( ) );

if ( !invalidSteps.isEmpty( ) )
{
SiteMessageService.setMessage( request, MESSAGE_ERROR_STEPS_VALIDATION, new Object [ ] {
invalidSteps.stream( ).map(Step::getTitle).collect( Collectors.joining(", ") )
}, null, null, null, SiteMessage.TYPE_ERROR, null, getViewFullUrl( VIEW_STEP ) );
return getStepView( request );
}

boolean needValidation = form.isCaptchaStepFinal( );
if ( isCaptchaKO( request, needValidation ) )
{
Expand Down