Revert "FEATURE: new 'required' survey attribute to control if all the fields"

Revert “FEATURE: new ‘required’ survey attribute to control if all the fields”

This reverts commit 9d13c5943feff161789660c349f839e48e307eba.

diff --git a/assets/javascripts/initializers/extend-for-survey.js.es6 b/assets/javascripts/initializers/extend-for-survey.js.es6
index cf7133c..9b0ca7c 100644
--- a/assets/javascripts/initializers/extend-for-survey.js.es6
+++ b/assets/javascripts/initializers/extend-for-survey.js.es6
@@ -71,7 +71,6 @@ function initializeSurveys(api) {
     $surveys.each((idx, surveyElem) => {
       const $survey = $(surveyElem);
       const surveyName = $survey.data("survey-name");
-      const fieldsRequired = $survey.data("survey-required");
       let survey = surveys[surveyName];
 
       if (survey) {
@@ -79,7 +78,6 @@ function initializeSurveys(api) {
           id: `${surveyName}-${post.id}`,
           post,
           survey,
-          fieldsRequired,
           response: {}
         };
         const glue = new WidgetGlue("discourse-survey", register, attrs);
diff --git a/assets/javascripts/lib/discourse-markdown/survey.js.es6 b/assets/javascripts/lib/discourse-markdown/survey.js.es6
index e9c0f1e..0865be0 100644
--- a/assets/javascripts/lib/discourse-markdown/survey.js.es6
+++ b/assets/javascripts/lib/discourse-markdown/survey.js.es6
@@ -4,7 +4,6 @@ import I18n from "I18n";
 const DATA_PREFIX = "data-survey-";
 const DEFAULT_SURVEY_NAME = "survey";
 const WHITELISTED_ATTRIBUTES = [
-  "required",
   "max",
   "min",
   "name",
diff --git a/assets/javascripts/widgets/discourse-survey.js.es6 b/assets/javascripts/widgets/discourse-survey.js.es6
index 9bdab6a..02ff5c2 100644
--- a/assets/javascripts/widgets/discourse-survey.js.es6
+++ b/assets/javascripts/widgets/discourse-survey.js.es6
@@ -360,7 +360,8 @@ export default createWidget("discourse-survey", {
     let cssClasses = "survey";
     return {
       class: cssClasses,
-      "data-survey-name": attrs.survey.get("name")
+      "data-survey-name": attrs.survey.get("name"),
+      "data-survey-type": attrs.survey.get("type")
     };
   },
 
@@ -425,11 +426,8 @@ export default createWidget("discourse-survey", {
     }
 
     const respondedFieldCount = Object.keys(attrs.response).length;
-    if (!attrs.fieldsRequired && respondedFieldCount > 0) {
-      return true;
-    }
-
     const totalFieldCount = attrs.survey.fields.length;
+
     return totalFieldCount === respondedFieldCount;
   },
 

GitHub sha: e4d47903