Skip to content
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

Tag required in Q&A #7

Open
Scrik opened this issue Mar 3, 2020 · 5 comments
Open

Tag required in Q&A #7

Scrik opened this issue Mar 3, 2020 · 5 comments

Comments

@Scrik
Copy link

Scrik commented Mar 3, 2020

Please tell me how not to send ready-made answers if they are not completely filled? But leave the opportunity to save in a draft, even if not all answered.

@dolphinotaku
Copy link
Owner

I am not sure what you are going to achieve, could you further explain your situation?

@Scrik
Copy link
Author

Scrik commented Mar 10, 2020

I have 60 questions. Suppose I answer a questionnaire and answer 20 questions. In order not to lose progress, I save in a draft.
But suppose there is a problem, by answering 20 questions I can also immediately send the questionnaire and 40 questions will remain unanswered. How to make sure that when sending the questionnaire it is checked that everything is filled out (excluding questions with a comment)

@dolphinotaku
Copy link
Owner

you may implement your validation logic in front-end or back-end.

for front-end, override the $scope.ValidateBuffer() in create-evaluation-entry.html
you can manipulate the scope or controller in this function
return false if will abort the form submission

$scope.ValidateBuffer = function(scope, iElement, iAttrs, controller){
    console.log("<"+iElement[0].tagName+">" +" Directive overried ValidateBuffer()");
    //controller.ngModel.DepartmentCode = "ABC"
    return true;
}

for back-end

  • add your validation logic in ep01de.php ProcessData()
  • update $responseArray to return the status and/or message to the client

@Scrik
Copy link
Author

Scrik commented Feb 6, 2021

can make an 1 example for Open End Question? In create-evaluation-entry.html , in $scope.ValidateBuffer()

you would help me a lot

<legend>Part 2 - Open End Question</legend> <div class="form-group" ng-repeat="qtnRcd in qtnnaireModel.openEndQtnList"> <label for="inputQtn{{$index}}">Q{{$index+1+qtnnaireModel.ratingMarksQtnList.length}}. {{qtnRcd.Question}}</label> <textarea type="text" class="form-control" id="qtnComment{{qtnRcd.QuestionID}}" ng-model="qtnnaireModel.qtnAns[qtnRcd.QuestionID]" rows="3"></textarea> </div>

i added ng-required, ng-valid but didn't help

@dolphinotaku
Copy link
Owner

where did you added, paste your added source code here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants