mirror of
https://github.com/moodle/moodle.git
synced 2025-01-21 23:48:45 +01:00
Added League Table of Submissions (Final Phase); Rubric Assessment
Strategy; Grace time for new submissions; changed elementid to elementno in rubrics table.
This commit is contained in:
parent
eafc0b4470
commit
a94928f2f0
@ -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:
|
||||
@ -315,6 +315,7 @@
|
||||
if (!isset($elements[$i])) {
|
||||
$elements[$i]->description = '';
|
||||
$elements[$i]->scale =0;
|
||||
$elements[$i]->maxscore = 0;
|
||||
$elements[$i]->weight = 11;
|
||||
}
|
||||
}
|
||||
@ -362,17 +363,6 @@
|
||||
break;
|
||||
|
||||
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++) {
|
||||
$iplus1 = $i+1;
|
||||
echo "<TR valign=top>\n";
|
||||
@ -401,24 +391,17 @@
|
||||
}
|
||||
for ($i=0; $i<=$workshop->nelements; $i++) {
|
||||
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, "");
|
||||
echo "</TD></TR>\n";
|
||||
}
|
||||
echo "</TABLE></CENTER>\n";
|
||||
break;
|
||||
|
||||
case 3: // criteria 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;
|
||||
}
|
||||
}
|
||||
case 3: // criterion grading
|
||||
for ($j = 100; $j >= 0; $j--) {
|
||||
$numbers[$j] = $j;
|
||||
}
|
||||
@ -436,6 +419,42 @@
|
||||
echo "</TR>\n";
|
||||
}
|
||||
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\"> </TD>\n";
|
||||
echo "</TR>\n";
|
||||
}
|
||||
break;
|
||||
}
|
||||
// close table and form
|
||||
?>
|
||||
@ -471,7 +490,7 @@
|
||||
}
|
||||
// get the teacher's assessment first
|
||||
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);
|
||||
}
|
||||
// now the student's assessment (don't allow changes)
|
||||
@ -590,7 +609,7 @@
|
||||
break;
|
||||
|
||||
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
|
||||
foreach ($form->maxscore as $key => $themaxscore) {
|
||||
unset($element);
|
||||
@ -608,6 +627,42 @@
|
||||
}
|
||||
}
|
||||
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
|
||||
|
||||
echo "<P>\n";
|
||||
@ -766,6 +821,35 @@
|
||||
error("Could not insert workshop element!");
|
||||
}
|
||||
$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
|
||||
|
||||
// update the time of the assessment record (may be re-edited)...
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
|
@ -101,7 +101,7 @@ CREATE TABLE `prefix_workshop_elements` (
|
||||
CREATE TABLE `prefix_workshop_rubrics` (
|
||||
`id` int(10) unsigned NOT NULL auto_increment,
|
||||
`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',
|
||||
`description` text NOT NULL,
|
||||
PRIMARY KEY (`id`)
|
||||
|
@ -1,4 +1,4 @@
|
||||
<?PHP // $Id: lib.php,v 1.1 21 Aug 2003
|
||||
<?PHP // $Id: lib.php,v 1.1 22 Aug 2003
|
||||
|
||||
include_once("$CFG->dirroot/files/mimetypes.php");
|
||||
|
||||
@ -9,7 +9,8 @@ error_reporting(15);
|
||||
$WORKSHOP_TYPE = array (0 => get_string("notgraded", "workshop"),
|
||||
1 => get_string("accumulative", "workshop"),
|
||||
2 => get_string("errorbanded", "workshop"),
|
||||
3 => get_string("criteria", "workshop") );
|
||||
3 => get_string("criterion", "workshop"),
|
||||
4 => get_string("rubric", "workshop") );
|
||||
|
||||
$WORKSHOP_SHOWGRADES = array (0 => get_string("dontshowgrades", "workshop"),
|
||||
1 => get_string("showgrades", "workshop") );
|
||||
@ -29,7 +30,7 @@ $WORKSHOP_SCALES = array(
|
||||
$WORKSHOP_EWEIGHTS = array( 0 => -4.0, 1 => -2.0, 2 => -1.5, 3 => -1.0, 4 => -0.75, 5 => -0.5, 6 => -0.25,
|
||||
7 => 0.0, 8 => 0.25, 9 => 0.5, 10 => 0.75, 11=> 1.0, 12 => 1.5, 13=> 2.0, 14 => 4.0);
|
||||
|
||||
$WORKSHOP_FWEIGHTS = array( 0 => 0, 1 => 0.1, 2 => 0.25, 3 => 0.5, 4 => 0.75, 5 => 1, 6 => 1.5,
|
||||
$WORKSHOP_FWEIGHTS = array( 0 => 0, 1 => 0.1, 2 => 0.25, 3 => 0.5, 4 => 0.75, 5 => 1.0, 6 => 1.5,
|
||||
7 => 2.0, 8 => 3.0, 9 => 5.0, 10 => 7.5, 11=> 10.0);
|
||||
|
||||
if (!defined("COMMENTSCALE")) {
|
||||
@ -702,6 +703,7 @@ function workshop_print_assessments_by_user_for_admin($workshop, $user) {
|
||||
function workshop_print_assessments_for_admin($workshop, $submission) {
|
||||
function workshop_print_difference($time) {
|
||||
function workshop_print_feedback($course, $submission) {
|
||||
function workshop_print_league_table($workshop) {
|
||||
function workshop_print_submission_assessments($workshop, $submission, $type) {
|
||||
function workshop_print_submission_title($workshop, $user) {
|
||||
function workshop_print_tabbed_table($table) {
|
||||
@ -1074,6 +1076,9 @@ function workshop_get_student_submissions($workshop, $order = "title") {
|
||||
if ($order == "name") {
|
||||
$order = "a.firstname, a.lastname";
|
||||
}
|
||||
if ($order == "grade") {
|
||||
$order = "$workshop->teacherweight * s.teachergrade + $workshop->peerweight * s.peergrade DESC";
|
||||
}
|
||||
return get_records_sql("SELECT s.* FROM {$CFG->prefix}workshop_submissions s, {$CFG->prefix}user_students u,
|
||||
{$CFG->prefix}user a
|
||||
WHERE u.course = $workshop->course
|
||||
@ -1976,6 +1981,9 @@ function workshop_list_ungraded_assessments($workshop, $stype) {
|
||||
|
||||
|
||||
function workshop_list_user_submissions($workshop, $user) {
|
||||
global $CFG;
|
||||
|
||||
$timenow = time();
|
||||
$table->head = array (get_string("title", "workshop"), get_string("action", "workshop"),
|
||||
get_string("submitted", "assignment"), get_string("assessments", "workshop"));
|
||||
$table->align = array ("LEFT", "LEFT", "LEFT", "LEFT");
|
||||
@ -1985,8 +1993,8 @@ function workshop_list_user_submissions($workshop, $user) {
|
||||
|
||||
if ($submissions = workshop_get_user_submissions($workshop, $user)) {
|
||||
foreach ($submissions as $submission) {
|
||||
// allow user to delete submissions if there is more than one submission
|
||||
if (count($submissions) > 1) {
|
||||
// allow user to delete submissions if there is more than one submission or if it's fresh
|
||||
if ((count($submissions) > 1) or (($timenow - $submission->timecreated) < $CFG->maxeditingtime)) {
|
||||
$action = "<a href=\"submissions.php?action=userconfirmdelete&a=$workshop->id&sid=$submission->id\">".
|
||||
get_string("delete", "workshop")."</a>";
|
||||
}
|
||||
@ -2093,7 +2101,7 @@ function workshop_print_assessment($workshop, $assessment = false, $allowchanges
|
||||
// only show the grade if grading strategy > 0 and the grade is positive
|
||||
if ($showgrades and $assessment->grade >= 0) {
|
||||
echo "<CENTER><B>".get_string("thegradeis", "workshop").": ".number_format($assessment->grade, 2)."% (".
|
||||
get_string("maximumgrade")." ".number_format($workshop->grade)."%)</B></CENTER><BR CLEAR=ALL>\n";
|
||||
get_string("maximumgrade")." ".number_format($workshop->grade, 0)."%)</B></CENTER><BR CLEAR=ALL>\n";
|
||||
}
|
||||
}
|
||||
|
||||
@ -2407,12 +2415,71 @@ function workshop_print_assessment($workshop, $assessment = false, $allowchanges
|
||||
choose_from_menu($numbers, "grade[1]", 0, "");
|
||||
}
|
||||
echo "</TD></TR>\n";
|
||||
break;
|
||||
|
||||
case 4: // rubric grading
|
||||
// now run through the elements...
|
||||
for ($i=0; $i < count($elements); $i++) {
|
||||
$iplus1 = $i+1;
|
||||
echo "<TR valign=\"top\">\n";
|
||||
echo "<TD align=\"right\"><b>".get_string("element", "workshop")." $iplus1:</b></TD>\n";
|
||||
echo "<TD>".text_to_html($elements[$i]->description).
|
||||
"<P align=\"right\"><font size=\"1\">Weight: "
|
||||
.number_format($WORKSHOP_EWEIGHTS[$elements[$i]->weight], 2)."</font></TD></tr>\n";
|
||||
echo "<TR valign=\"top\">\n";
|
||||
echo " <TD BGCOLOR=\"$THEME->cellheading2\" align=\"center\"><B>".get_string("select", "workshop")."</B></TD>\n";
|
||||
echo " <TD BGCOLOR=\"$THEME->cellheading2\"><B>". get_string("criterion","workshop")."</B></TD></tr>\n";
|
||||
if (isset($grades[$i])) {
|
||||
$selection = $grades[$i]->grade;
|
||||
} else {
|
||||
$selection = 0;
|
||||
}
|
||||
// ...and the rubrics
|
||||
if ($rubricsraw = get_records_select("workshop_rubrics", "workshopid = $workshop->id AND
|
||||
elementno = $i", "rubricno ASC")) {
|
||||
unset($rubrics);
|
||||
foreach ($rubricsraw as $rubic) {
|
||||
$rubrics[] = $rubic; // to renumber index 0,1,2...
|
||||
}
|
||||
for ($j=0; $j<5; $j++) {
|
||||
if (empty($rubrics[$j]->description)) {
|
||||
break; // out of inner for loop
|
||||
}
|
||||
echo "<TR valign=top>\n";
|
||||
if ($selection == $j) {
|
||||
echo " <TD align=center><INPUT TYPE=\"RADIO\" NAME=\"grade[$i]\" VALUE=\"$j\" CHECKED></TD>\n";
|
||||
}else {
|
||||
echo " <TD align=center><INPUT TYPE=\"RADIO\" NAME=\"grade[$i]\" VALUE=\"$j\"></TD>\n";
|
||||
}
|
||||
echo "<TD>".text_to_html($rubrics[$j]->description)."</TD>\n";
|
||||
}
|
||||
echo "<TR valign=top>\n";
|
||||
echo " <TD align=right><P><B>". get_string("feedback").":</B></P></TD>\n";
|
||||
echo " <TD>\n";
|
||||
if ($allowchanges) {
|
||||
echo " <textarea name=\"feedback[]\" rows=3 cols=75 wrap=\"virtual\">\n";
|
||||
if (isset($grades[$i]->feedback)) {
|
||||
echo $grades[$i]->feedback;
|
||||
}
|
||||
echo "</textarea>\n";
|
||||
}
|
||||
else {
|
||||
echo text_to_html($grades[$i]->feedback);
|
||||
}
|
||||
echo " </td>\n";
|
||||
echo "</tr>\n";
|
||||
echo "<tr valign=\"top\">\n";
|
||||
echo " <td colspan=\"2\" bgcolor=\"$THEME->cellheading2\"> </TD>\n";
|
||||
echo "</tr>\n";
|
||||
}
|
||||
}
|
||||
break;
|
||||
} // end of outer switch
|
||||
|
||||
// now get the general comment (present in all types)
|
||||
echo "<TR valign=top>\n";
|
||||
echo " <TD align=right><P><B>". get_string("generalcomment", "workshop").":</B></P></TD>\n";
|
||||
echo " <TD>\n";
|
||||
echo "<tr valign=\"top\">\n";
|
||||
echo " <td align=\"right\"><P><B>". get_string("generalcomment", "workshop").":</B></P></TD>\n";
|
||||
echo " <td>\n";
|
||||
if ($allowchanges) {
|
||||
echo " <textarea name=\"generalcomment\" rows=5 cols=75 wrap=\"virtual\">\n";
|
||||
if (isset($assessment->generalcomment)) {
|
||||
@ -2430,53 +2497,53 @@ function workshop_print_assessment($workshop, $assessment = false, $allowchanges
|
||||
print_string("yourfeedbackgoeshere", "workshop");
|
||||
}
|
||||
}
|
||||
echo " </TD>\n";
|
||||
echo "</TR>\n";
|
||||
echo "<TR valign=top>\n";
|
||||
echo " <TD colspan=2 BGCOLOR=\"$THEME->cellheading2\"> </TD>\n";
|
||||
echo "</TR>\n";
|
||||
echo " </td>\n";
|
||||
echo "</tr>\n";
|
||||
echo "<tr valign=\"top\">\n";
|
||||
echo " <td colspan=\"2\" bgcolor=\"$THEME->cellheading2\"> </TD>\n";
|
||||
echo "</tr>\n";
|
||||
|
||||
$timenow = time();
|
||||
// now show the teacher's comment if available...
|
||||
if ($assessment->timegraded and (($timenow - $assessment->timegraded) > $CFG->maxeditingtime)) {
|
||||
echo "<TR valign=top>\n";
|
||||
echo " <TD align=right><P><B>". get_string("teacherscomment", "workshop").":</B></P></TD>\n";
|
||||
echo " <TD>\n";
|
||||
echo "<tr valign=top>\n";
|
||||
echo " <td align=\"right\"><p><b>". get_string("teacherscomment", "workshop").":</b></p></td>\n";
|
||||
echo " <td>\n";
|
||||
echo text_to_html($assessment->teachercomment);
|
||||
echo " </TD>\n";
|
||||
echo "</TR>\n";
|
||||
echo " </td>\n";
|
||||
echo "</tr>\n";
|
||||
// only show the grading grade if it's the teacher
|
||||
if (isteacher($course->id)) {
|
||||
echo "<TR valign=top>\n";
|
||||
echo " <TD align=right><P><B>". get_string("teachersgrade", "workshop").":</B></P></TD>\n";
|
||||
echo " <TD>\n";
|
||||
echo "<tr valign=\"top\">\n";
|
||||
echo " <td align=\"right\"><p><b>". get_string("teachersgrade", "workshop").":</b></p></td>\n";
|
||||
echo " <td>\n";
|
||||
echo number_format($assessment->gradinggrade * 100 / COMMENTSCALE, 0)."%";
|
||||
echo " </TD>\n";
|
||||
echo " </td>\n";
|
||||
echo "</tr>\n";
|
||||
}
|
||||
echo "</TR>\n";
|
||||
echo "<TR valign=top>\n";
|
||||
echo " <TD colspan=2 BGCOLOR=\"$THEME->cellheading2\"> </TD>\n";
|
||||
echo "</TR>\n";
|
||||
echo "<tr valign=\"top\">\n";
|
||||
echo "<td colspan=\"2\" bgcolor=\"$THEME->cellheading2\"> </td>\n";
|
||||
echo "</tr>\n";
|
||||
}
|
||||
|
||||
// ...and close the table, show submit button if needed...
|
||||
echo "</TABLE>\n";
|
||||
echo "</table>\n";
|
||||
if ($assessment) {
|
||||
if ($allowchanges) {
|
||||
echo "<INPUT TYPE=\"submit\" VALUE=\"".get_string("savemyassessment", "workshop")."\">\n";
|
||||
echo "<input type=\"submit\" VALUE=\"".get_string("savemyassessment", "workshop")."\">\n";
|
||||
}
|
||||
// ...if user is author, assessment not agreed, there's no comments, the showcommentlinks flag is set and
|
||||
// it's not self assessment then show some buttons!
|
||||
if (($submission->userid == $USER->id) and !$assessment->timeagreed and !$comments and $showcommentlinks and
|
||||
$submission->userid != $assessment->userid) {
|
||||
echo "<INPUT TYPE=button VALUE=\"".get_string("agreetothisassessment", "workshop")."\"
|
||||
ONCLICK=\"document.assessmentform.action.value='agreeassessment';document.assessmentform.submit();\">\n";
|
||||
echo "<INPUT TYPE=submit VALUE=\"".get_string("disagreewiththisassessment", "workshop")."\"
|
||||
ONCLICK=\"document.assessmentform.action.value='addcomment';document.assessmentform.submit();\">\n";
|
||||
echo "<input type=button VALUE=\"".get_string("agreetothisassessment", "workshop")."\"
|
||||
onclick=\"document.assessmentform.action.value='agreeassessment';document.assessmentform.submit();\">\n";
|
||||
echo "<input type=submit value=\"".get_string("disagreewiththisassessment", "workshop")."\"
|
||||
onclick=\"document.assessmentform.action.value='addcomment';document.assessmentform.submit();\">\n";
|
||||
}
|
||||
}
|
||||
echo "</CENTER>";
|
||||
echo "</FORM>\n";
|
||||
echo "</center>";
|
||||
echo "</form>\n";
|
||||
}
|
||||
|
||||
|
||||
@ -2553,6 +2620,36 @@ function workshop_print_feedback($course, $submission) {
|
||||
}
|
||||
|
||||
|
||||
function workshop_print_league_table($workshop) {
|
||||
// print an order table of (student) submissions showing teacher's and student's assessments
|
||||
if (! $course = get_record("course", "id", $workshop->course)) {
|
||||
error("Print league table: Course is misconfigured");
|
||||
}
|
||||
$table->head = array (get_string("title", "workshop"), get_string("name"),
|
||||
get_string("teacherassessments", "workshop", $course->teacher),
|
||||
get_string("studentassessments", "workshop", $course->student), get_string("overallgrade", "workshop"));
|
||||
$table->align = array ("left", "left", "center", "center", "center");
|
||||
$table->size = array ("*", "*", "*", "*", "*");
|
||||
$table->cellpadding = 2;
|
||||
$table->cellspacing = 0;
|
||||
|
||||
if ($submissions = workshop_get_student_submissions($workshop, "grade")) {
|
||||
foreach ($submissions as $submission) {
|
||||
if (!$user = get_record("user", "id", $submission->userid)) {
|
||||
error("Print league table: user not found");
|
||||
}
|
||||
$table->data[] = array(workshop_print_submission_title($workshop, $submission), $user->firstname." ".
|
||||
$user->lastname, workshop_print_submission_assessments($workshop, $submission, "teacher"),
|
||||
workshop_print_submission_assessments($workshop, $submission, "student"),
|
||||
number_format(($workshop->teacherweight * $submission->teachergrade + $workshop->peerweight *
|
||||
$submission->peergrade) / ($workshop->teacherweight + $workshop->peerweight), 1)) ;
|
||||
}
|
||||
print_heading(get_string("leaguetable", "workshop"));
|
||||
print_table($table);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function workshop_print_submission_assessments($workshop, $submission, $type) {
|
||||
// Returns the teacher or peer grade and a hyperlinked list of grades for this submission
|
||||
|
||||
@ -2591,6 +2688,9 @@ function workshop_print_submission_assessments($workshop, $submission, $type) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!$str) {
|
||||
$str = " "; // be kind to Mozilla browsers!
|
||||
}
|
||||
return $str;
|
||||
}
|
||||
|
||||
|
@ -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:
|
||||
@ -688,72 +688,74 @@
|
||||
|
||||
// show the final grades as stored in the tables...
|
||||
print_heading_with_help(get_string("displayoffinalgrades", "workshop"), "finalgrades", "workshop");
|
||||
echo "<CENTER><TABLE BORDER=1 WIDTH=\"90%\"><TR>
|
||||
<TD BGCOLOR=\"$THEME->cellheading2\"><B>".$course->student."</B></TD>";
|
||||
echo "<TD BGCOLOR=\"$THEME->cellheading2\"><B>".get_string("submissions", "workshop")."</B></TD>";
|
||||
echo "<center><table border=\"1\" width=\"90%\"><tr>
|
||||
<td bgcolor=\"$THEME->cellheading2\"><b>".$course->student."</b></td>";
|
||||
echo "<td bgcolor=\"$THEME->cellheading2\"><b>".get_string("submissions", "workshop")."</b></td>";
|
||||
if ($useteachersgrades) {
|
||||
echo "<TD BGCOLOR=\"$THEME->cellheading2\"><B>".get_string("assessmentsby", "workshop", $course->teachers)."</B></TD>";
|
||||
echo "<td bgcolor=\"$THEME->cellheading2\" align=\"center\"><b>".get_string("assessmentsby", "workshop", $course->teachers)."</b></td>";
|
||||
}
|
||||
if ($usepeergrades) {
|
||||
echo "<TD BGCOLOR=\"$THEME->cellheading2\"><B>".get_string("assessmentsby", "workshop", $course->students)."</B></TD>";
|
||||
echo "<td bgcolor=\"$THEME->cellheading2\" align=\"center\"><b>".get_string("assessmentsby", "workshop", $course->students)."</b></td>";
|
||||
}
|
||||
echo "<TD BGCOLOR=\"$THEME->cellheading2\"><B>".get_string("assessmentsdone", "workshop")."</B></TD>";
|
||||
echo "<td bgcolor=\"$THEME->cellheading2\" align=\"center\"><b>".get_string("assessmentsdone", "workshop")."</b></td>";
|
||||
if ($usebiasgrades) {
|
||||
echo "<TD BGCOLOR=\"$THEME->cellheading2\"><B>".get_string("gradeforbias", "workshop")."</B></TD>";
|
||||
echo "<td bgcolor=\"$THEME->cellheading2\" align=\"center\"><b>".get_string("gradeforbias", "workshop")."</b></td>";
|
||||
}
|
||||
if ($usereliabilitygrades) {
|
||||
echo "<TD BGCOLOR=\"$THEME->cellheading2\"><B>".get_string("gradeforreliability", "workshop")."</B></TD>";
|
||||
echo "<td bgcolor=\"$THEME->cellheading2\" align=\"center\"><b>".get_string("gradeforreliability", "workshop")."</b></td>";
|
||||
}
|
||||
if ($usegradinggrades) {
|
||||
echo "<TD BGCOLOR=\"$THEME->cellheading2\"><B>".get_string("gradeforassessments", "workshop")."</B></TD>";
|
||||
echo "<td bgcolor=\"$THEME->cellheading2\" align=\"center\"><b>".get_string("gradeforassessments", "workshop")."</b></td>";
|
||||
}
|
||||
echo "<TD BGCOLOR=\"$THEME->cellheading2\"><B>".get_string("overallgrade", "workshop")."</B></TD></TR>\n";
|
||||
echo "<td bgcolor=\"$THEME->cellheading2\" align=\"center\"><b>".get_string("overallgrade", "workshop")."</b></td></TR>\n";
|
||||
// now the weights
|
||||
echo "<TR><TD BGCOLOR=\"$THEME->cellheading2\"><B>".get_string("weights", "workshop")."</B></TD>";
|
||||
echo "<TD BGCOLOR=\"$THEME->cellheading2\"><B> </B></TD>\n";
|
||||
echo "<TR><td bgcolor=\"$THEME->cellheading2\"><b>".get_string("weights", "workshop")."</b></td>";
|
||||
echo "<td bgcolor=\"$THEME->cellheading2\" align=\"center\"><b> </b></td>\n";
|
||||
if ($useteachersgrades) {
|
||||
echo "<TD BGCOLOR=\"$THEME->cellheading2\"><B>$WORKSHOP_FWEIGHTS[$teacherweight]</B></TD>\n";
|
||||
echo "<td bgcolor=\"$THEME->cellheading2\" align=\"center\"><b>$WORKSHOP_FWEIGHTS[$teacherweight]</b></td>\n";
|
||||
}
|
||||
if ($usepeergrades) {
|
||||
echo "<TD BGCOLOR=\"$THEME->cellheading2\"><B>$WORKSHOP_FWEIGHTS[$peerweight]</B></TD>\n";
|
||||
echo "<td bgcolor=\"$THEME->cellheading2\" align=\"center\"><b>$WORKSHOP_FWEIGHTS[$peerweight]</b></td>\n";
|
||||
}
|
||||
echo "<TD BGCOLOR=\"$THEME->cellheading2\"><B> </B></TD>\n";
|
||||
echo "<td bgcolor=\"$THEME->cellheading2\" align=\"center\"><b> </b></td>\n";
|
||||
if ($usebiasgrades) {
|
||||
echo "<TD BGCOLOR=\"$THEME->cellheading2\"><B>$WORKSHOP_FWEIGHTS[$biasweight]</B></TD>\n";
|
||||
echo "<td bgcolor=\"$THEME->cellheading2\" align=\"center\"><b>$WORKSHOP_FWEIGHTS[$biasweight]</b></td>\n";
|
||||
}
|
||||
if ($usereliabilitygrades) {
|
||||
echo "<TD BGCOLOR=\"$THEME->cellheading2\"><B>$WORKSHOP_FWEIGHTS[$reliabilityweight]</B></TD>\n";
|
||||
echo "<td bgcolor=\"$THEME->cellheading2\" align=\"center\"><b>$WORKSHOP_FWEIGHTS[$reliabilityweight]</b></td>\n";
|
||||
}
|
||||
if ($usegradinggrades) {
|
||||
echo "<TD BGCOLOR=\"$THEME->cellheading2\"><B>$WORKSHOP_FWEIGHTS[$gradingweight]</B></TD>\n";
|
||||
echo "<td bgcolor=\"$THEME->cellheading2\" align=\"center\"><b>$WORKSHOP_FWEIGHTS[$gradingweight]</b></td>\n";
|
||||
}
|
||||
echo "<TD BGCOLOR=\"$THEME->cellheading2\"><B> </B></TD></TR>\n";
|
||||
echo "<td bgcolor=\"$THEME->cellheading2\"><b> </b></td></tr>\n";
|
||||
foreach ($users as $user) {
|
||||
if ($submissions = workshop_get_user_submissions($workshop, $user)) {
|
||||
foreach ($submissions as $submission) {
|
||||
echo "<TR><TD>$user->firstname $user->lastname</TD>";
|
||||
echo "<TD>".workshop_print_submission_title($workshop, $submission)."</TD>\n";
|
||||
echo "<tr><td>$user->firstname $user->lastname</td>";
|
||||
echo "<td>".workshop_print_submission_title($workshop, $submission)."</td>\n";
|
||||
if ($useteachersgrades) {
|
||||
echo "<TD>".workshop_print_submission_assessments($workshop, $submission, "teacher")."</TD>";
|
||||
echo "<td align=\"center\">".workshop_print_submission_assessments($workshop, $submission, "teacher")."</td>";
|
||||
}
|
||||
if ($usepeergrades) {
|
||||
echo "<TD>".workshop_print_submission_assessments($workshop, $submission, "student")."</TD>";
|
||||
echo "<td align=\"center\">".workshop_print_submission_assessments($workshop, $submission, "student")."</td>";
|
||||
}
|
||||
echo "<TD>".workshop_print_user_assessments($workshop, $user)."</TD>";
|
||||
echo "<td align=\"center\">".workshop_print_user_assessments($workshop, $user)."</td>";
|
||||
if ($usebiasgrades) {
|
||||
echo "<TD>$submission->biasgrade</TD>";
|
||||
echo "<td align=\"center\">$submission->biasgrade</td>";
|
||||
}
|
||||
if ($usereliabilitygrades) {
|
||||
echo "<TD>$submission->reliabilitygrade</TD>";
|
||||
echo "<td align=\"center\">$submission->reliabilitygrade</td>";
|
||||
}
|
||||
if ($usegradinggrades) {
|
||||
echo "<TD>$submission->gradinggrade</TD>";
|
||||
echo "<td align=\"center\">$submission->gradinggrade</td>";
|
||||
}
|
||||
echo "<TD>$submission->finalgrade</TD></TR>\n";
|
||||
echo "<td align=\"center\">$submission->finalgrade</td></tr>\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
echo "</TABLE><BR CLEAR=ALL>\n";
|
||||
echo "</table><br clear=\"all\">\n";
|
||||
workshop_print_league_table($workshop);
|
||||
echo "<br clear=\"all\">\n";
|
||||
print_string("allgradeshaveamaximumof", "workshop", $workshop->grade);
|
||||
print_continue("view.php?a=$workshop->id");
|
||||
}
|
||||
@ -790,9 +792,9 @@
|
||||
// now show the weights used in the final grades
|
||||
print_heading_with_help(get_string("calculationoffinalgrades", "workshop"), "calculatingfinalgrade", "workshop");
|
||||
echo "<TABLE WIDTH=\"50%\" BORDER=\"1\">\n";
|
||||
echo "<TR><TD COLSPAN=\"2\" BGCOLOR=\"$THEME->cellheading2\"><CENTER><B>".
|
||||
echo "<TR><td COLSPAN=\"2\" bgcolor=\"$THEME->cellheading2\"><CENTER><B>".
|
||||
get_string("weightsusedforfinalgrade", "workshop")."</B></CENTER></TD></TR>\n";
|
||||
echo "<TR><TD ALIGN=\"right\">".get_string("weightforteachersassessment", "workshop").":</TD>\n";
|
||||
echo "<tr><td align=\"right\">".get_string("weightforteacherassessments", "workshop", $course->teacher).":</td>\n";
|
||||
echo "<TD>";
|
||||
workshop_choose_from_menu($WORKSHOP_FWEIGHTS, "teacherweight", $teacherweight, "");
|
||||
echo "</TD></TR>\n";
|
||||
@ -812,7 +814,7 @@
|
||||
echo "<TD>";
|
||||
workshop_choose_from_menu($WORKSHOP_FWEIGHTS, "gradingweight", $gradingweight, "");
|
||||
echo "</TD></TR>\n";
|
||||
echo "<TR><TD COLSPAN=\"2\" BGCOLOR=\"$THEME->cellheading2\"><CENTER><B>".
|
||||
echo "<TR><TD COLSPAN=\"2\" bgcolor=\"$THEME->cellheading2\"><CENTER><B>".
|
||||
get_string("optionforpeergrade", "workshop")."</B></CENTER></TD></TR>\n";
|
||||
echo "<TR><TD ALIGN=\"right\">".get_string("includeteachersgrade", "workshop").":</TD>\n";
|
||||
echo "<TD>";
|
||||
|
@ -5,7 +5,7 @@
|
||||
// This fragment is called by /admin/index.php
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
$module->version = 2003051400;
|
||||
$module->version = 2003082200;
|
||||
$module->cron = 60;
|
||||
|
||||
?>
|
||||
|
@ -1,4 +1,4 @@
|
||||
<?PHP // $Id: view.php, v1.1 21 Aug 2003
|
||||
<?PHP // $Id: view.php, v1.1 22 Aug 2003
|
||||
|
||||
/*************************************************
|
||||
ACTIONS handled are:
|
||||
@ -156,68 +156,68 @@
|
||||
// show the final grades as stored in the tables...
|
||||
print_heading_with_help(get_string("displayoffinalgrades", "workshop"), "finalgrades", "workshop");
|
||||
if ($submissions = workshop_get_user_submissions($workshop, $USER)) { // any submissions from user?
|
||||
echo "<CENTER><TABLE BORDER=1 WIDTH=\"90%\"><TR>";
|
||||
echo "<TD><B>".get_string("submissions", "workshop")."</B></TD>";
|
||||
echo "<center><table border=\"1\" width=\"90%\"><tr>";
|
||||
echo "<td><b>".get_string("submissions", "workshop")."</b></td>";
|
||||
if ($useteachersgrades) {
|
||||
echo "<TD><B>".get_string("teachersassessment", "workshop")."</B></TD>";
|
||||
echo "<td align=\"center\"><b>".get_string("teacherassessments", "workshop", $course->teacher)."</b></td>";
|
||||
}
|
||||
if ($usepeergrades) {
|
||||
echo "<TD><B>".get_string("studentsassessment", "workshop")."</B></TD>";
|
||||
echo "<td align=\"center\"><b>".get_string("studentassessments", "workshop", $course->student)."</b></td>";
|
||||
}
|
||||
echo "<TD><B>".get_string("assessmentsdone", "workshop")."</B></TD>";
|
||||
echo "<td align=\"center\"><b>".get_string("assessmentsdone", "workshop")."</b></td>";
|
||||
if ($usebiasgrades) {
|
||||
echo "<TD><B>".get_string("gradeforbias", "workshop")."</B></TD>";
|
||||
echo "<td align=\"center\"><b>".get_string("gradeforbias", "workshop")."</b></td>";
|
||||
}
|
||||
if ($usereliabilitygrades) {
|
||||
echo "<TD><B>".get_string("gradeforreliability", "workshop")."</B></TD>";
|
||||
echo "<td align=\"center\"><b>".get_string("gradeforreliability", "workshop")."</b></td>";
|
||||
}
|
||||
if ($usegradinggrades) {
|
||||
echo "<TD><B>".get_string("gradeforassessments", "workshop")."</B></TD>";
|
||||
echo "<td align=\"center\"><b>".get_string("gradeforassessments", "workshop")."</b></td>";
|
||||
}
|
||||
echo "<TD><B>".get_string("overallgrade", "workshop")."</B></TD></TR>\n";
|
||||
echo "<td align=\"center\"><b>".get_string("overallgrade", "workshop")."</b></td></TR>\n";
|
||||
// now the weights
|
||||
echo "<TR><TD><B>".get_string("weights", "workshop")."</B></TD>";
|
||||
echo "<TR><td><b>".get_string("weights", "workshop")."</b></td>";
|
||||
if ($useteachersgrades) {
|
||||
echo "<TD><B>$workshop_FWEIGHTS[$teacherweight]</B></TD>\n";
|
||||
echo "<td align=\"center\"><b>$WORKSHOP_FWEIGHTS[$teacherweight]</b></td>\n";
|
||||
}
|
||||
if ($usepeergrades) {
|
||||
echo "<TD><B>$workshop_FWEIGHTS[$peerweight]</B></TD>\n";
|
||||
echo "<td align=\"center\"><b>$WORKSHOP_FWEIGHTS[$peerweight]</b></td>\n";
|
||||
}
|
||||
echo "<TD><B> </B></TD>\n";
|
||||
echo "<td><b> </b></td>\n";
|
||||
if ($usebiasgrades) {
|
||||
echo "<TD><B>$workshop_FWEIGHTS[$biasweight]</B></TD>\n";
|
||||
echo "<td align=\"center\"><b>$WORKSHOP_FWEIGHTS[$biasweight]</b></td>\n";
|
||||
}
|
||||
if ($usereliabilitygrades) {
|
||||
echo "<TD><B>$workshop_FWEIGHTS[$reliabilityweight]</B></TD>\n";
|
||||
echo "<td align=\"center\"><b>$WORKSHOP_FWEIGHTS[$reliabilityweight]</b></td>\n";
|
||||
}
|
||||
if ($usegradinggrades) {
|
||||
echo "<TD><B>$workshop_FWEIGHTS[$gradingweight]</B></TD>\n";
|
||||
echo "<td align=\"center\"><b>$WORKSHOP_FWEIGHTS[$gradingweight]</b></td>\n";
|
||||
}
|
||||
echo "<TD><B> </B></TD></TR>\n";
|
||||
echo "<td><b> </b></td></TR>\n";
|
||||
foreach ($submissions as $submission) {
|
||||
echo "<TR><TD>".workshop_print_submission_title($workshop, $submission)."</TD>\n";
|
||||
echo "<TR><td>".workshop_print_submission_title($workshop, $submission)."</td>\n";
|
||||
if ($useteachersgrades) {
|
||||
echo "<TD>".workshop_print_submission_assessments($workshop, $submission, "teacher")."</TD>";
|
||||
echo "<td align=\"center\">".workshop_print_submission_assessments($workshop, $submission, "teacher")."</td>";
|
||||
}
|
||||
if ($usepeergrades) {
|
||||
echo "<TD>".workshop_print_submission_assessments($workshop, $submission, "student")."</TD>";
|
||||
echo "<td align=\"center\">".workshop_print_submission_assessments($workshop, $submission, "student")."</td>";
|
||||
}
|
||||
echo "<TD>".workshop_print_user_assessments($workshop, $USER)."</TD>";
|
||||
echo "<td align=\"center\">".workshop_print_user_assessments($workshop, $USER)."</td>";
|
||||
if ($usebiasgrades) {
|
||||
echo "<TD>$submission->biasgrade</TD>";
|
||||
echo "<td align=\"center\">$submission->biasgrade</td>";
|
||||
}
|
||||
if ($usereliabilitygrades) {
|
||||
echo "<TD>$submission->reliabilitygrade</TD>";
|
||||
echo "<td align=\"center\">$submission->reliabilitygrade</td>";
|
||||
}
|
||||
if ($usegradinggrades) {
|
||||
echo "<TD>$submission->gradinggrade</TD>";
|
||||
echo "<td align=\"center\">$submission->gradinggrade</td>";
|
||||
}
|
||||
echo "<TD>$submission->finalgrade</TD></TR>\n";
|
||||
echo "<td align=\"center\">$submission->finalgrade</td></TR>\n";
|
||||
}
|
||||
}
|
||||
echo "</TABLE><BR CLEAR=ALL>\n";
|
||||
workshop_print_league_table($workshop);
|
||||
print_string("allgradeshaveamaximumof", "workshop", $workshop->grade);
|
||||
print_continue("view.php?a=$workshop->id");
|
||||
}
|
||||
|
||||
|
||||
@ -332,12 +332,12 @@
|
||||
// list previous submissions
|
||||
print_heading(get_string("submissions", "workshop"));
|
||||
workshop_list_user_submissions($workshop, $USER);
|
||||
echo "<HR SIZE=1 NOSHADE>";
|
||||
echo "<hr size=\"1\" noshade>";
|
||||
if ($workshop->resubmit) {
|
||||
// if resubmissions allowed print upload form
|
||||
print_heading(get_string("submitassignment", "assignment").":");
|
||||
workshop_print_upload_form($workshop);
|
||||
echo "<HR SIZE=1 NOSHADE>";
|
||||
echo "<hr size=\"1\" noshade>";
|
||||
}
|
||||
// allow user to list their submissions and assessments in a general way????
|
||||
// print_heading("<A HREF=\"submissions.php?action=listallsubmissions&id=$cm->id\">".
|
||||
@ -396,7 +396,7 @@
|
||||
}
|
||||
|
||||
print_heading_with_help(get_string("managingassignment", "workshop"), "managing", "workshop");
|
||||
$tabs->names = array("1. ".get_string("phase1", "workshop"), "2. ".get_string("phase2", "workshop"),
|
||||
$tabs->names = array("1. ".get_string("phase1", "workshop"), "2. ".get_string("phase2", "workshop", $course->student),
|
||||
"3. ".get_string("phase3", "workshop"), "4. ".get_string("phase4", "workshop"));
|
||||
$tabs->urls = array("view.php?id=$cm->id&action=setupassignment",
|
||||
"view.php?id=$cm->id&action=openworkshop",
|
||||
|
Loading…
x
Reference in New Issue
Block a user