Add weight and average score compute.

This commit is contained in:
bohung committed 2021-10-13 17:15:47 +08:00
1 parent d35c12f1fc
commit 25f87ef24c
15 files changed
+259 -16

No files matched your search

+5
View File
@@ -32,6 +32,7 @@ function setData(l, length, optionsI, className) {
_title_translations: [id+l+"_title_translations", name+l+"][title_translations]", "questions_title_"+l,{"en":"","zh_tw":""}],
_description_translations: [id+l+"_description_translations", name+l+"][description_translations]", "questions_depiction_"+l,{"en":"","zh_tw":""}],
_type: [id+l+"_type", name+l+"][type]"],
_weight: [id+l+"_weight", name+l+"][weight]", 1],
_selectable_question: [name+l+"][selectable_question]", ''],
_selectable_question_type: [name+l+"][selectable_question_type]",''],
_question_type: [question_type_name,'',String(question_type_name).replaceAll(/\[|\]/g,'')],
@@ -73,6 +74,7 @@ function setEditData(l, length, d, optionsI, className) {
_title_translations: [id+l+"_title_translations", name+l+"][title_translations]", "questions_title_"+l,d.title_translations],
_description_translations: [id+l+"_description_translations", name+l+"][description_translations]", "questions_depiction_"+l,d.description_translations],
_type: [id+l+"_type", name+l+"][type]",d.type],
_weight: [id+l+"_weight", name+l+"][weight]", d.weight],
_selectable_question: [name+l+"][selectable_question]", d.selectable_question],
_selectable_question_type: [name+l+"][selectable_question_type]",d.selectable_question_type],
_question_type: [name+l+"][question_type]",d.question_type,String(name+l+"][question_type]").replaceAll(/\[|\]/g,'')],
@@ -213,10 +215,13 @@ function onQuestionTypeChanged ( $fieldType, _val ){
if(_val < 2) {
$fieldType.fadeOut(300);
$fieldType.next(".date-format").fadeOut(300);
$fieldType.siblings(".weight_block").addClass("hide");
}else if(_val == 6){
$fieldType.fadeOut(300);
$fieldType.next(".date-format").fadeIn(300);
$fieldType.siblings(".weight_block").addClass("hide");
} else {
$fieldType.siblings(".weight_block").removeClass("hide");
$fieldType.fadeIn(300);
$fieldType.next(".date-format").fadeOut(300);
if (_val == 7){