MDL-11835 proper labels for aggregation coef - weight and extra credit

This commit is contained in:
skodak
2007-10-20 19:12:33 +00:00
parent 78358cd6a1
commit bfe0c0ddcf
3 changed files with 69 additions and 24 deletions
+32 -11
View File
@@ -101,8 +101,6 @@ class edit_item_form extends moodleform {
$mform->disabledIf('plusfactor', 'gradetype', 'eq', GRADE_TYPE_TEXT);
$mform->addElement('text', 'aggregationcoef', get_string('aggregationcoef', 'grades'));
$mform->setHelpButton('aggregationcoef', array(false, get_string('aggregationcoef', 'grades'),
false, true, false, get_string('aggregationcoefhelp', 'grades')));
/// grade display prefs
@@ -203,17 +201,29 @@ class edit_item_form extends moodleform {
if ($grade_item->is_course_item()) {
$mform->removeElement('aggregationcoef');
} else if ($grade_item->is_category_item()) {
$category = $grade_item->get_item_category();
$parent_category = $category->get_parent_category();
if (!$parent_category->is_aggregationcoef_used()) {
$mform->removeElement('aggregationcoef');
} else {
if ($grade_item->is_category_item()) {
$category = $grade_item->get_item_category();
$parent_category = $category->get_parent_category();
} else {
$parent_category = $grade_item->get_parent_category();
}
} else {
$parent_category = $grade_item->get_parent_category();
$parent_category->apply_forced_settings();
if (!$parent_category->is_aggregationcoef_used()) {
$mform->removeElement('aggregationcoef');
} else {
$agg_el =& $mform->getElement('aggregationcoef');
if ($parent_category->aggregation == GRADE_AGGREGATE_WEIGHTED_MEAN) {
$agg_el->setLabel(get_string('aggregationcoefweight', 'grades'));
$mform->setHelpButton('aggregationcoef', array(false, get_string('aggregationcoefweight', 'grades'),
false, true, false, get_string('aggregationcoefweighthelp', 'grades')));
} else if ($parent_category->aggregation == GRADE_AGGREGATE_EXTRACREDIT_MEAN) {
$agg_el->setLabel(get_string('aggregationcoefextra', 'grades'));
$mform->setHelpButton('aggregationcoef', array(false, get_string('aggregationcoefextra', 'grades'),
false, true, false, get_string('aggregationcoefextrahelp', 'grades')));
}
}
}
@@ -222,9 +232,20 @@ class edit_item_form extends moodleform {
$mform->removeElement('plusfactor');
$mform->removeElement('multfactor');
$course_category = grade_category::fetch_course_category($COURSE->id);
if (!$course_category->is_aggregationcoef_used()) {
$parent_category = grade_category::fetch_course_category($COURSE->id);
if (!$parent_category->is_aggregationcoef_used()) {
$mform->removeElement('aggregationcoef');
} else {
$agg_el =& $mform->getElement('aggregationcoef');
if ($parent_category->aggregation == GRADE_AGGREGATE_WEIGHTED_MEAN) {
$agg_el->setLabel(get_string('aggregationcoefweight', 'grades'));
$mform->setHelpButton('aggregationcoef', array(false, get_string('aggregationcoefweight', 'grades'),
false, true, false, get_string('aggregationcoefweighthelp', 'grades')));
} else if ($parent_category->aggregation == GRADE_AGGREGATE_EXTRACREDIT_MEAN) {
$agg_el->setLabel(get_string('aggregationcoefextra', 'grades'));
$mform->setHelpButton('aggregationcoef', array(false, get_string('aggregationcoefextra', 'grades'),
false, true, false, get_string('aggregationcoefextrahelp', 'grades')));
}
}
}
}
+33 -12
View File
@@ -76,8 +76,6 @@ class edit_outcomeitem_form extends moodleform {
false, true, false, get_string('gradepasshelp', 'grades')));*/
$mform->addElement('text', 'aggregationcoef', get_string('aggregationcoef', 'grades'));
$mform->setHelpButton('aggregationcoef', array(false, get_string('aggregationcoef', 'grades'),
false, true, false, get_string('aggregationcoefhelp', 'grades')));
/// hiding
/// advcheckbox is not compatible with disabledIf !!
@@ -123,24 +121,47 @@ class edit_outcomeitem_form extends moodleform {
if ($grade_item->is_course_item()) {
$mform->removeElement('aggregationcoef');
} else if ($grade_item->is_category_item()) {
$category = $grade_item->get_item_category();
$parent_category = $category->get_parent_category();
if (!$parent_category->is_aggregationcoef_used()) {
$mform->removeElement('aggregationcoef');
} else {
if ($grade_item->is_category_item()) {
$category = $grade_item->get_item_category();
$parent_category = $category->get_parent_category();
} else {
$parent_category = $grade_item->get_parent_category();
}
} else {
$parent_category = $grade_item->get_parent_category();
if (!$parent_category->is_aggregationcoef_used()) {
$parent_category->apply_forced_settings();
if (!$parent_category->is_aggregationcoef_used() or !$parent_category->aggregateoutcomes) {
$mform->removeElement('aggregationcoef');
} else {
$agg_el =& $mform->getElement('aggregationcoef');
if ($parent_category->aggregation == GRADE_AGGREGATE_WEIGHTED_MEAN) {
$agg_el->setLabel(get_string('aggregationcoefweight', 'grades'));
$mform->setHelpButton('aggregationcoef', array(false, get_string('aggregationcoefweight', 'grades'),
false, true, false, get_string('aggregationcoefweighthelp', 'grades')));
} else if ($parent_category->aggregation == GRADE_AGGREGATE_EXTRACREDIT_MEAN) {
$agg_el->setLabel(get_string('aggregationcoefextra', 'grades'));
$mform->setHelpButton('aggregationcoef', array(false, get_string('aggregationcoefextra', 'grades'),
false, true, false, get_string('aggregationcoefextrahelp', 'grades')));
}
}
}
} else {
$course_category = grade_category::fetch_course_category($COURSE->id);
if (!$course_category->is_aggregationcoef_used()) {
$parent_category = grade_category::fetch_course_category($COURSE->id);
if (!$parent_category->is_aggregationcoef_used() or !$parent_category->aggregateoutcomes) {
$mform->removeElement('aggregationcoef');
} else {
$agg_el =& $mform->getElement('aggregationcoef');
if ($parent_category->aggregation == GRADE_AGGREGATE_WEIGHTED_MEAN) {
$agg_el->setLabel(get_string('aggregationcoefweight', 'grades'));
$mform->setHelpButton('aggregationcoef', array(false, get_string('aggregationcoefweight', 'grades'),
false, true, false, get_string('aggregationcoefweighthelp', 'grades')));
} else if ($parent_category->aggregation == GRADE_AGGREGATE_EXTRACREDIT_MEAN) {
$agg_el->setLabel(get_string('aggregationcoefextra', 'grades'));
$mform->setHelpButton('aggregationcoef', array(false, get_string('aggregationcoefextra', 'grades'),
false, true, false, get_string('aggregationcoefextrahelp', 'grades')));
}
}
}
}
+4 -1
View File
@@ -27,7 +27,10 @@ $string['aggregatesonly'] = 'Aggregates only';
$string['aggregateweightedmean'] = 'Weighted mean of grades';
$string['aggregation'] = 'Aggregation';
$string['aggregationcoef'] = 'Aggregation coefficient';
$string['aggregationcoefhelp'] = 'Weight applied to all grades in this grade item during aggregation with other grade items.';
$string['aggregationcoefextra'] = 'Extra credit';
$string['aggregationcoefextrahelp'] = 'Extra credit for this grade item during aggregation.';
$string['aggregationcoefweight'] = 'Item weight';
$string['aggregationcoefweighthelp'] = 'Weight applied to all grades in this grade item during aggregation with other grade items.';
$string['aggregationhelp'] = 'Strategy used to aggregate grades across all students in a course.';
$string['aggregationposition'] = 'Aggregation position';
$string['aggregationview'] = 'Aggregation view';