Skip to content

Commit

Permalink
MDL-13789 Fixed the index file issue (with a hack) and also documente…
Browse files Browse the repository at this point in the history
…d extra credits properly.
  • Loading branch information
nicolasconnault committed Mar 21, 2008
1 parent c49c221 commit 072901a
Show file tree
Hide file tree
Showing 6 changed files with 33 additions and 13 deletions.
4 changes: 2 additions & 2 deletions grade/edit/tree/item_form.php
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ function definition() {
$coefstring = ($coefstring=='' or $coefstring=='aggregationcoefextra') ? 'aggregationcoefextra' : 'aggregationcoef';

} else if ($cat->aggregation == GRADE_AGGREGATE_SUM) {
$coefstring = ($coefstring=='' or $coefstring=='aggregationcoefextrasump') ? 'aggregationcoefextrasum' : 'aggregationcoef';
$coefstring = ($coefstring=='' or $coefstring=='aggregationcoefextrasum') ? 'aggregationcoefextrasum' : 'aggregationcoef';

} else {
$coefstring = 'aggregationcoef';
Expand Down Expand Up @@ -280,7 +280,7 @@ function definition_after_data() {

if ($aggcoef !== '') {
$agg_el->setLabel(get_string($aggcoef, 'grades'));
$mform->setHelpButton('aggregationcoef', array('aggregationcoef', get_string('aggregationcoef', 'grades'), 'grade'), true);
$mform->setHelpButton('aggregationcoef', array($aggcoef, get_string($aggcoef, 'grades'), 'grade'), true);
}
}
}
Expand Down
4 changes: 4 additions & 0 deletions help.php
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,10 @@ function include_help_for_each_module($file, $langs, $helpdir) {
if (!$modules = get_records('modules', 'visible', 1)) {
error('No modules found!!'); // Should never happen
}

$grade = new stdClass();
$grade->name = 'grade';
$modules[] = $grade;

foreach ($modules as $mod) {
$strmodulename = get_string('modulename', $mod->name);
Expand Down
7 changes: 2 additions & 5 deletions lang/en_utf8/grades.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,9 @@
$string['aggregateweightedmean2'] = 'Simple weighted mean of grades';
$string['aggregation'] = 'Aggregation';
$string['aggregationcoef'] = 'Aggregation coefficient';
$string['aggregationcoefextra'] = 'Extra credit';
$string['aggregationcoefextrahelp'] = 'Extra credit for this grade item during aggregation.';
$string['aggregationcoefextrasum'] = 'Extra credit';
$string['aggregationcoefextrasumhelp'] = 'Extra credit for this grade item during aggregation.';
$string['aggregationcoefextra'] = 'Extra credit coefficient';
$string['aggregationcoefextrasum'] = 'Act as extra credit';
$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';
Expand Down
13 changes: 11 additions & 2 deletions lang/en_utf8/help/grade/aggregationcoefextra.html
Original file line number Diff line number Diff line change
@@ -1,2 +1,11 @@
<h1>Extra credit</h1>
<p>Extra credit for this grade item during aggregation.</p>
<h1>Extra credit coefficient</h1>
<p>A value greater than 0 treats this grade item's grades as Extra credit during aggregation. The number is a factor by which the grade value will be multiplied before it is added to the sum of all grades, but the item itself will not be counted in the division. For example:</p>

<ul>
<li>Item 1 is graded 0-100 and its "Extra credit" value is set to 2</li>
<li>Item 2 is graded 0-100 and its "Extra credit" value is left at 0.0000</li>
<li>Item 3 is graded 0-100 and its "Extra credit" value is left at 0.0000</li>
<li>All 3 items belong to Category 1, which has "Mean of grades (with extra credits)" as its aggregation strategy</li>
<li>A student gets graded 20 on Item 1, 40 on Item 2 and 70 on Item 3</li>
<li>The student's total for Category 1 will be 75/100 (20*2 + 40 + 70) / 2</li>
</ul>
14 changes: 12 additions & 2 deletions lang/en_utf8/help/grade/aggregationcoefextrasum.html
Original file line number Diff line number Diff line change
@@ -1,2 +1,12 @@
<h1>Extra credit</h1>
<p>Extra credit for this grade item during aggregation.</p>
<h1>Act as extra credit</h1>
<p>When the "Sum of grades" aggregation strategy is used, a grade item can act as Extra credit for the category. This means that the grade item's maximum grade will not be added to the category total's maximum grade, but the item's grade will. Following is an example:</p>

<ul>
<li>Item 1 is graded 0-100</li>
<li>Item 2 is graded 0-75</li>
<li>Item 1 has the "Act as extra credit" checkbox ticked, Item 2 doesn't.</li>
<li>Both items belong to Category 1, which has "Sum of grades" as its aggregation strategy</li>
<li>Category 1's total will be graded 0-75</li>
<li>A student gets graded 20 on Item 1 and 70 on Item 2</li>
<li>The student's total for Category 1 will be 75/75 (20+70 = 95 but Item 1 only acts as extra credit, so it brings the total to its maximum)</li>
</ul>
4 changes: 2 additions & 2 deletions lang/en_utf8/help/grade/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ <h2>Grade</h2>
<li><a href="help.php?module=grade&amp;file=aggregateoutcomes.html">Include outcomes in aggregation</a></li>
<li><a href="help.php?module=grade&amp;file=aggregatesubcats.html">Aggregate including subcategories</a></li>
<li><a href="help.php?module=grade&amp;file=aggregation.html">Category aggregation</a></li>
<li><a href="help.php?module=grade&amp;file=aggregationcoefextra.html">Extra credit</a></li>
<li><a href="help.php?module=grade&amp;file=aggregationcoefextrasum.html">Extra credit</a></li>
<li><a href="help.php?module=grade&amp;file=aggregationcoefextra.html">Extra credit coefficient</a></li>
<li><a href="help.php?module=grade&amp;file=aggregationcoefextrasum.html">Act as extra credit</a></li>
<li><a href="help.php?module=grade&amp;file=aggregationcoefweight.html">Item weight</a></li>
<li><a href="help.php?module=grade&amp;file=aggregationposition.html">Aggregation position</a></li>
<li><a href="help.php?module=grade&amp;file=aggregationview.html">Aggregation view</a></li>
Expand Down

0 comments on commit 072901a

Please sign in to comment.