Skip to content

Commit

Permalink
Added League Table of Submissions (Final Phase); Rubric Assessment
Browse files Browse the repository at this point in the history
Strategy; Grace time for new submissions; changed elementid to elementno
in rubrics table.
  • Loading branch information
rkingdon committed Aug 22, 2003
1 parent eafc0b4 commit a94928f
Show file tree
Hide file tree
Showing 7 changed files with 326 additions and 133 deletions.
136 changes: 110 additions & 26 deletions mod/workshop/assessments.php
@@ -1,4 +1,4 @@
<?PHP // $Id: lib.php,v 1.0 14 Aug 2003 <?PHP // $Id: lib.php,v 1.1 22 Aug 2003


/************************************************* /*************************************************
ACTIONS handled are: ACTIONS handled are:
Expand Down Expand Up @@ -315,6 +315,7 @@
if (!isset($elements[$i])) { if (!isset($elements[$i])) {
$elements[$i]->description = ''; $elements[$i]->description = '';
$elements[$i]->scale =0; $elements[$i]->scale =0;
$elements[$i]->maxscore = 0;
$elements[$i]->weight = 11; $elements[$i]->weight = 11;
} }
} }
Expand Down Expand Up @@ -362,17 +363,6 @@
break; break;


case 2: // error banded grading case 2: // error banded grading
if ($elementsraw = get_records("workshop_elements", "workshopid", $workshop->id, "elementno ASC" )) {
foreach ($elementsraw as $element) {
$elements[] = $element; // to renumber index 0,1,2...
}
}
else { // set up the elements array with default values
for ($i=0; $i<=$workshop->nelements; $i++) {
$elements[$i]->description = '';
$elements[$i]->maxscore =0;
}
}
for ($i=0; $i<$workshop->nelements; $i++) { for ($i=0; $i<$workshop->nelements; $i++) {
$iplus1 = $i+1; $iplus1 = $i+1;
echo "<TR valign=top>\n"; echo "<TR valign=top>\n";
Expand Down Expand Up @@ -401,24 +391,17 @@
} }
for ($i=0; $i<=$workshop->nelements; $i++) { for ($i=0; $i<=$workshop->nelements; $i++) {
echo "<TR><TD ALIGN=\"CENTER\">$i</TD><TD ALIGN=\"CENTER\">"; echo "<TR><TD ALIGN=\"CENTER\">$i</TD><TD ALIGN=\"CENTER\">";
if (!isset($elements[$i])) { // the "last one" will be!
$elements[$i]->description = "";
$elements[$i]->maxscore = 0;
}
choose_from_menu($numbers, "maxscore[$i]", $elements[$i]->maxscore, ""); choose_from_menu($numbers, "maxscore[$i]", $elements[$i]->maxscore, "");
echo "</TD></TR>\n"; echo "</TD></TR>\n";
} }
echo "</TABLE></CENTER>\n"; echo "</TABLE></CENTER>\n";
break; break;


case 3: // criteria grading case 3: // criterion grading
if ($elementsraw = get_records("workshop_elements", "workshopid", $workshop->id, "elementno ASC" )) {
foreach ($elementsraw as $element) {
$elements[] = $element; // to renumber index 0,1,2...
}
}
else { // set up the elements array with default values
for ($i=0; $i<=$workshop->nelements; $i++) {
$elements[$i]->description = '';
$elements[$i]->maxscore =0;
}
}
for ($j = 100; $j >= 0; $j--) { for ($j = 100; $j >= 0; $j--) {
$numbers[$j] = $j; $numbers[$j] = $j;
} }
Expand All @@ -436,6 +419,42 @@
echo "</TR>\n"; echo "</TR>\n";
} }
break; break;

case 4: // rubric
for ($j = 100; $j >= 0; $j--) {
$numbers[$j] = $j;
}
if ($rubricsraw = get_records("workshop_rubrics", "workshopid", $workshop->id)) {
foreach ($rubricsraw as $rubric) {
$rubrics[$rubric->elementno][$rubric->rubricno] = $rubric->description; // reindex 0,1,2...
}
}
for ($i=0; $i<$workshop->nelements; $i++) {
$iplus1 = $i+1;
echo "<TR valign=top>\n";
echo " <TD ALIGN=RIGHT><P><B>". get_string("element","workshop")." $iplus1:</B></TD>\n";
echo "<TD><textarea name=\"description[$i]\" rows=3 cols=75 wrap=\"virtual\">".$elements[$i]->description."</textarea>\n";
echo " </TD></TR>\n";
echo "<TR valign=top><TD ALIGN=RIGHT><B>".get_string("elementweight", "workshop").":</B></TD><TD>\n";
workshop_choose_from_menu($WORKSHOP_EWEIGHTS, "weight[]", $elements[$i]->weight, "");
echo " </TD>\n";
echo "</TR>\n";

for ($j=0; $j<5; $j++) {
$jplus1 = $j+1;
if (empty($rubrics[$i][$j])) {
$rubrics[$i][$j] = "";
}
echo "<TR valign=top>\n";
echo " <TD ALIGN=RIGHT><P><B>". get_string("grade","workshop")." $j:</B></TD>\n";
echo "<TD><textarea name=\"rubric[$i][$j]\" rows=3 cols=75 wrap=\"virtual\">".$rubrics[$i][$j]."</textarea>\n";
echo " </TD></TR>\n";
}
echo "<TR valign=top>\n";
echo " <TD colspan=2 BGCOLOR=\"$THEME->cellheading2\">&nbsp;</TD>\n";
echo "</TR>\n";
}
break;
} }
// close table and form // close table and form
?> ?>
Expand Down Expand Up @@ -471,7 +490,7 @@
} }
// get the teacher's assessment first // get the teacher's assessment first
if ($teachersassessment = workshop_get_submission_assessment($submission, $USER)) { if ($teachersassessment = workshop_get_submission_assessment($submission, $USER)) {
echo "<P><CENTER><B>".get_string("teachersassessment", "workshop")."</B></CENTER>\n"; echo "<P><CENTER><B>".get_string("teacherassessments", "workshop", $course->teacher)."</B></CENTER>\n";
workshop_print_assessment($workshop, $teachersassessment); workshop_print_assessment($workshop, $teachersassessment);
} }
// now the student's assessment (don't allow changes) // now the student's assessment (don't allow changes)
Expand Down Expand Up @@ -590,7 +609,7 @@
break; break;


case 2: // error banded grading... case 2: // error banded grading...
case 3: // ...and criteria grading case 3: // ...and criterion grading
// Insert all the elements that contain something, the number of descriptions is one less than the number of grades // Insert all the elements that contain something, the number of descriptions is one less than the number of grades
foreach ($form->maxscore as $key => $themaxscore) { foreach ($form->maxscore as $key => $themaxscore) {
unset($element); unset($element);
Expand All @@ -608,6 +627,42 @@
} }
} }
break; break;

case 4: // ...and criteria grading
// Insert all the elements that contain something
foreach ($form->description as $key => $description) {
unset($element);
$element->workshopid = $workshop->id;
$element->elementno = $key;
$element->description = $description;
$element->weight = $form->weight[$key];
for ($j=0;$j<5;$j++) {
if (empty($form->rubric[$key][$j]))
break;
}
$element->maxscore = $j - 1;
if (!$element->id = insert_record("workshop_elements", $element)) {
error("Could not insert workshop element!");
}
}
// let's not fool around here, dump the junk!
delete_records("workshop_rubrics", "workshopid", $workshop->id);
for ($i=0;$i<$workshop->nelements;$i++) {
for ($j=0;$j<5;$j++) {
unset($element);
if (empty($form->rubric[$i][$j])) { // OK to have an element with fewer than 5 items
break;
}
$element->workshopid = $workshop->id;
$element->elementno = $i;
$element->rubricno = $j;
$element->description = $form->rubric[$i][$j];
if (!$element->id = insert_record("workshop_rubrics", $element)) {
error("Could not insert workshop element!");
}
}
}
break;
} // end of switch } // end of switch


echo "<P>\n"; echo "<P>\n";
Expand Down Expand Up @@ -766,6 +821,35 @@
error("Could not insert workshop element!"); error("Could not insert workshop element!");
} }
$grade = ($elements[$form->grade[0]]->maxscore + $form->grade[1]) * $workshop->grade / 100; $grade = ($elements[$form->grade[0]]->maxscore + $form->grade[1]) * $workshop->grade / 100;
break;

case 4: // rubric grading (identical to accumulative grading)
// Insert all the elements that contain something
foreach ($form->grade as $key => $thegrade) {
unset($element);
$element->workshopid = $workshop->id;
$element->assessmentid = $assessment->id;
$element->elementno = $key;
$element->feedback = $form->feedback[$key];
$element->grade = $thegrade;
if (!$element->id = insert_record("workshop_grades", $element)) {
error("Could not insert workshop element!");
}
}
// now work out the grade...
$rawgrade=0;
$totalweight=0;
foreach ($form->grade as $key => $grade) {
$maxscore = $elements[$key]->maxscore;
$weight = $WORKSHOP_EWEIGHTS[$elements[$key]->weight];
if ($weight > 0) {
$totalweight += $weight;
}
$rawgrade += ($grade / $maxscore) * $weight;
}
$grade = $workshop->grade * ($rawgrade / $totalweight);
break;

} // end of switch } // end of switch


// update the time of the assessment record (may be re-edited)... // update the time of the assessment record (may be re-edited)...
Expand Down
7 changes: 7 additions & 0 deletions mod/workshop/db/mysql.php
Expand Up @@ -45,6 +45,13 @@ function workshop_upgrade($oldversion) {
"); ");


} }

if ($oldversion < 2003082200) {

execute_sql(" ALTER TABLE `{$CFG->prefix}workshop_rubrics` CHANGE `elementid` `elementno` INT(10) UNSIGNED NOT NULL DEFAULT '0'");

}

return true; return true;
} }


Expand Down
2 changes: 1 addition & 1 deletion mod/workshop/db/mysql.sql
Expand Up @@ -101,7 +101,7 @@ CREATE TABLE `prefix_workshop_elements` (
CREATE TABLE `prefix_workshop_rubrics` ( CREATE TABLE `prefix_workshop_rubrics` (
`id` int(10) unsigned NOT NULL auto_increment, `id` int(10) unsigned NOT NULL auto_increment,
`workshopid` int(10) unsigned NOT NULL default '0', `workshopid` int(10) unsigned NOT NULL default '0',
`elementid` int(10) unsigned NOT NULL default '0', `elementno` int(10) unsigned NOT NULL default '0',
`rubricno` tinyint(3) unsigned NOT NULL default '0', `rubricno` tinyint(3) unsigned NOT NULL default '0',
`description` text NOT NULL, `description` text NOT NULL,
PRIMARY KEY (`id`) PRIMARY KEY (`id`)
Expand Down

0 comments on commit a94928f

Please sign in to comment.