Version 2004092700 - tidy up of simple assignment case; addition of
password and submission late flag.
This commit is contained in:
@@ -102,6 +102,23 @@ function workshop_upgrade($oldversion) {
|
||||
execute_sql("ALTER TABLE `{$CFG->prefix}workshop_assessments` ADD INDEX (`userid`)");
|
||||
}
|
||||
|
||||
if ($oldversion < 2004092700) {
|
||||
table_column("workshop", "", "wtype", "INTEGER", "4", "UNSIGNED", "0", "NOT NULL", "description");
|
||||
table_column("workshop", "", "usepassword", "INTEGER", "4", "UNSIGNED", "0", "NOT NULL");
|
||||
table_column("workshop", "", "password", "VARCHAR", "32", "", "", "NOT NULL");
|
||||
table_column("workshop_submissions", "", "late", "INTEGER", "4", "UNSIGNED", "0", "NOT NULL");
|
||||
|
||||
// update wkey value
|
||||
if ($workshops = get_records("workshop")) {
|
||||
foreach ($workshops as $workshop) {
|
||||
$wtype = 0; // 3 phases, no grading grades
|
||||
if ($workshop->includeself or $workshop->ntassessments) $wtype = 1; // 3 phases with grading grades
|
||||
if ($workshop->nsassessments) $wtype = 2; // 5 phases with grading grades
|
||||
set_field("workshop", "wtype", $wtype, "id", $workshop->id);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -7,6 +7,7 @@ CREATE TABLE `prefix_workshop` (
|
||||
`course` int(10) unsigned NOT NULL default '0',
|
||||
`name` varchar(255) NOT NULL default '',
|
||||
`description` text NOT NULL,
|
||||
`wtype` tinyint(3) unsigned NOT NULL default '0',
|
||||
`nelements` tinyint(3) unsigned NOT NULL default '1',
|
||||
`nattachments` tinyint(3) unsigned NOT NULL default '0',
|
||||
`phase` tinyint(2) unsigned NOT NULL default '0',
|
||||
@@ -28,6 +29,8 @@ CREATE TABLE `prefix_workshop` (
|
||||
`timemodified` int(10) unsigned NOT NULL default '0',
|
||||
`teacherweight` tinyint(3) unsigned NOT NULL default '1',
|
||||
`showleaguetable` tinyint(3) unsigned NOT NULL default '0',
|
||||
`usepassword` tinyint(3) unsigned NOT NULL default '0',
|
||||
`password` varchar(32) NOT NULL default '',
|
||||
PRIMARY KEY (`id`)
|
||||
) COMMENT='Defines workshop';
|
||||
# --------------------------------------------------------
|
||||
@@ -50,6 +53,7 @@ CREATE TABLE `prefix_workshop_submissions` (
|
||||
`reliabilitygrade` int(3) unsigned NOT NULL default '0',
|
||||
`gradinggrade` int(3) unsigned NOT NULL default '0',
|
||||
`finalgrade` int(3) unsigned NOT NULL default '0',
|
||||
`late` int(3) unsigned NOT NULL default '0',
|
||||
PRIMARY KEY (`id`),
|
||||
INDEX `userid` (`userid`)
|
||||
) COMMENT='Info about submitted work from teacher and students';
|
||||
|
||||
@@ -80,8 +80,13 @@
|
||||
$link .= " ($submission->title)"; // show students the title of their submission(s)
|
||||
$gradinggrade = workshop_gradinggrade($workshop, $USER);
|
||||
$grade = workshop_submission_grade($workshop, $submission);
|
||||
$info = get_string("gradeforassessments", "workshop").": $gradinggrade/$workshop->gradinggrade; ".
|
||||
get_string("gradeforsubmission", "workshop").": $grade/$workshop->grade";
|
||||
if ($workshop->wtype) {
|
||||
$info = get_string("gradeforassessments", "workshop").
|
||||
": $gradinggrade/$workshop->gradinggrade; ".get_string("gradeforsubmission", "workshop").
|
||||
": $grade/$workshop->grade";
|
||||
} else { // simple assignemnt, don't show grading grade
|
||||
$info = get_string("gradeforsubmission", "workshop").": $grade/$workshop->grade";
|
||||
}
|
||||
}
|
||||
if ($course->format == "weeks" or $course->format == "topics") {
|
||||
$table->data[] = array ($workshop->section, $link, $info, $submitted, $due);
|
||||
|
||||
+28
-3
@@ -619,11 +619,19 @@ global $CFG;
|
||||
if ($workshop->phase > 1) {
|
||||
if ($students = get_course_students($workshop->course)) {
|
||||
foreach ($students as $student) {
|
||||
$gradinggrade = workshop_gradinggrade($workshop, $student);
|
||||
if ($workshop->wtype) {
|
||||
$gradinggrade = workshop_gradinggrade($workshop, $student);
|
||||
} else { // ignore grading grades for simple assignments
|
||||
$gradinggrade = 0;
|
||||
}
|
||||
$bestgrade = 0;
|
||||
if ($submissions = workshop_get_user_submissions($workshop, $student)) {
|
||||
foreach ($submissions as $submission) {
|
||||
$grade = workshop_submission_grade($workshop, $submission);
|
||||
if (!$submission->late) {
|
||||
$grade = workshop_submission_grade($workshop, $submission);
|
||||
} else {
|
||||
$grade = 0.01;
|
||||
}
|
||||
if ($grade > $bestgrade) {
|
||||
$bestgrade = $grade;
|
||||
}
|
||||
@@ -633,7 +641,11 @@ global $CFG;
|
||||
}
|
||||
}
|
||||
}
|
||||
$return->maxgrade = $workshop->grade + $workshop->gradinggrade;
|
||||
if ($workshop->wtype) {
|
||||
$return->maxgrade = $workshop->grade + $workshop->gradinggrade;
|
||||
} else { // ignore grading grades for simple assignemnts
|
||||
$return->maxgrade = $workshop->grade;
|
||||
}
|
||||
}
|
||||
return $return;
|
||||
}
|
||||
@@ -916,6 +928,19 @@ function workshop_update_instance($workshop) {
|
||||
$workshop->deadlinemonth, $workshop->deadlineday, $workshop->deadlinehour,
|
||||
$workshop->deadlineminute);
|
||||
|
||||
// set the workshop's type
|
||||
$wtype = 0; // 3 phases, no grading grades
|
||||
if ($workshop->includeself or $workshop->ntassessments) $wtype = 1; // 3 phases with grading grades
|
||||
if ($workshop->nsassessments) $wtype = 2; // 5 phases with grading grades
|
||||
$workshop->wtype = $wtype;
|
||||
|
||||
// encode password if necessary
|
||||
if (!empty($workshop->password)) {
|
||||
$workshop->password = md5($workshop->password);
|
||||
} else {
|
||||
unset($workshop->password);
|
||||
}
|
||||
|
||||
$workshop->id = $workshop->instance;
|
||||
|
||||
if ($returnid = update_record("workshop", $workshop)) {
|
||||
|
||||
@@ -1352,16 +1352,18 @@ function workshop_list_submissions_for_admin($workshop, $order) {
|
||||
switch ($order) {
|
||||
case "title" :
|
||||
$table->head = array("<a href=\"submissions.php?action=adminlist&id=$cm->id&order=name\">".
|
||||
get_string("submittedby", "workshop")."</a>", get_string("title", "workshop"), get_string("action", "workshop"));
|
||||
get_string("submittedby", "workshop")."</a>", get_string("title", "workshop"),
|
||||
get_string("submitted", "workshop"), get_string("action", "workshop"));
|
||||
break;
|
||||
case "name" :
|
||||
$table->head = array (get_string("submittedby", "workshop"),
|
||||
"<a href=\"submissions.php?action=adminlist&id=$cm->id&order=title\">".
|
||||
get_string("title", "workshop")."</a>", get_string("action", "workshop"));
|
||||
get_string("title", "workshop")."</a>", get_string("submitted", "workshop"),
|
||||
get_string("action", "workshop"));
|
||||
break;
|
||||
}
|
||||
$table->align = array ("left", "left", "left");
|
||||
$table->size = array ("*", "*", "*");
|
||||
$table->align = array ("left", "left", "left", "left");
|
||||
$table->size = array ("*", "*", "*", "*");
|
||||
$table->cellpadding = 2;
|
||||
$table->cellspacing = 0;
|
||||
|
||||
@@ -1377,6 +1379,10 @@ function workshop_list_submissions_for_admin($workshop, $order) {
|
||||
continue; // skip this user
|
||||
}
|
||||
}
|
||||
$datesubmitted = userdate($submission->timecreated);
|
||||
if ($submission->late) {
|
||||
$datesubmitted = "<font color=\"red\">".$datesubmitted."</font>";
|
||||
}
|
||||
$action = "<a href=\"submissions.php?action=adminamendtitle&id=$cm->id&sid=$submission->id\">".
|
||||
get_string("amendtitle", "workshop")."</a>";
|
||||
// has teacher already assessed this submission
|
||||
@@ -1400,12 +1406,17 @@ function workshop_list_submissions_for_admin($workshop, $order) {
|
||||
$action .= " | <a href=\"assessments.php?action=adminlist&id=$cm->id&sid=$submission->id\">".
|
||||
get_string("listassessments", "workshop")." ($nassessments)</a>";
|
||||
}
|
||||
if ($submission->late) {
|
||||
$action .= " | <a href=\"submissions.php?action=adminlateflag&id=$cm->id&sid=$submission->id\">".
|
||||
get_string("clearlateflag", "workshop")."</a>";
|
||||
}
|
||||
$action .= " | <a href=\"submissions.php?action=adminconfirmdelete&id=$cm->id&sid=$submission->id\">".
|
||||
get_string("delete", "workshop")."</a>";
|
||||
$table->data[] = array("$user->firstname $user->lastname", $submission->title.
|
||||
" (".get_string("grade").": ".workshop_submission_grade($workshop, $submission)." ".
|
||||
workshop_print_submission_assessments($workshop, $submission, "teacher").
|
||||
" ".workshop_print_submission_assessments($workshop, $submission, "student").")", $action);
|
||||
" ".workshop_print_submission_assessments($workshop, $submission, "student").")", $datesubmitted,
|
||||
$action);
|
||||
}
|
||||
print_heading(get_string("studentsubmissions", "workshop", $course->student), "center");
|
||||
print_table($table);
|
||||
@@ -1754,10 +1765,14 @@ function workshop_list_user_submissions($workshop, $user) {
|
||||
else {
|
||||
$action = '';
|
||||
}
|
||||
$datesubmitted = userdate($submission->timecreated);
|
||||
if ($submission->late) {
|
||||
$datesubmitted = "<font color=\"red\">".$datesubmitted."</font>";
|
||||
}
|
||||
$n = count_records_select("workshop_assessments", "submissionid = $submission->id AND
|
||||
timecreated < ($timenow - $CFG->maxeditingtime)");
|
||||
$table->data[] = array(workshop_print_submission_title($workshop, $submission), $action,
|
||||
userdate($submission->timecreated), $n);
|
||||
$datesubmitted, $n);
|
||||
}
|
||||
print_table($table);
|
||||
}
|
||||
@@ -2599,9 +2614,12 @@ function workshop_print_submission_assessments($workshop, $submission, $type) {
|
||||
$str .= "<".number_format($assessment->grade, 0)." (0)></a> ";
|
||||
}
|
||||
} else {
|
||||
$str .= "[".number_format($assessment->grade, 0)." ((".
|
||||
number_format($assessment->gradinggrade * $workshop->gradinggrade / 100, 0).
|
||||
"))]</a> ";
|
||||
$str .= "[".number_format($assessment->grade, 0);
|
||||
if ($workshop->wtype) { // print null grade if there are student assessments
|
||||
$str .= " ((".number_format($assessment->gradinggrade * $workshop->gradinggrade / 100,
|
||||
0)."))";
|
||||
}
|
||||
$str .= "]</a> ";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -310,6 +310,25 @@
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td align="right"><p><b><?php print_string("usepassword", "workshop"); ?>:</b></p></td>
|
||||
<td>
|
||||
<?php
|
||||
$options[0] = get_string("no"); $options[1] = get_string("yes");
|
||||
choose_from_menu($options, "usepassword", $form->usepassword, "");
|
||||
helpbutton("usepassword", get_string("usepassword", "workshop"), "workshop");
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td align="right"><p><b><?php print_string("password"); ?>:</b></p></td>
|
||||
<td>
|
||||
<input type="text" name="password" size="10" value="" /> <?php echo " (".get_string("leavetokeep").")"; ?>
|
||||
<?php helpbutton("password", get_string("password"), "workshop"); ?>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr valign="top">
|
||||
<td align="right"><p><b><?php print_string("maximumsize", "workshop") ?>:</b></p></td>
|
||||
<td>
|
||||
|
||||
@@ -89,6 +89,29 @@
|
||||
}
|
||||
|
||||
|
||||
/******************* admin clear late (flag) ************************************/
|
||||
elseif ($action == 'adminclearlate' ) {
|
||||
|
||||
if (!isteacher($course->id)) {
|
||||
error("Only teachers can look at this page");
|
||||
}
|
||||
if (empty($_GET['sid'])) {
|
||||
error("Admin clear late flag: submission id missing");
|
||||
}
|
||||
|
||||
if (!$submission = get_record("workshop_submissions", "id", $_GET['sid'])) {
|
||||
error("Admin clear late flag: can not get submission record");
|
||||
}
|
||||
if (set_field("workshop_submissions", "late", 0, "id", $_GET['sid'])) {
|
||||
print_heading(get_string("clearlateflag", "workshop")." ".get_string("ok"));
|
||||
}
|
||||
|
||||
add_to_log($course->id, "workshop", "late flag cleared", "view.php?id=$cm->id", "submission $submission->id");
|
||||
|
||||
redirect("submissions.php?id=$cm->id&action=adminlist");
|
||||
}
|
||||
|
||||
|
||||
/******************* admin confirm delete ************************************/
|
||||
elseif ($action == 'adminconfirmdelete' ) {
|
||||
|
||||
@@ -138,6 +161,25 @@
|
||||
}
|
||||
|
||||
|
||||
/******************* admin (confirm) late flag ************************************/
|
||||
elseif ($action == 'adminlateflag' ) {
|
||||
|
||||
if (!isteacher($course->id)) {
|
||||
error("Only teachers can look at this page");
|
||||
}
|
||||
if (empty($_GET['sid'])) {
|
||||
error("Admin confirm late flag: submission id missing");
|
||||
}
|
||||
if (!$submission = get_record("workshop_submissions", "id", $_GET['sid'])) {
|
||||
error("Admin confirm late flag: can not get submission record");
|
||||
}
|
||||
|
||||
notice_yesno(get_string("clearlateflag","workshop")."?",
|
||||
"submissions.php?action=adminclearlate&id=$cm->id&sid=$_GET[sid]",
|
||||
"submissions.php?id=$cm->id&action=adminlist");
|
||||
}
|
||||
|
||||
|
||||
/******************* list all submissions ************************************/
|
||||
elseif ($action == 'adminlist' ) {
|
||||
|
||||
@@ -210,14 +252,18 @@
|
||||
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("submission", "workshop")."</b></td>";
|
||||
echo "<td bgcolor=\"$THEME->cellheading2\" align=\"center\"><b>".get_string("assessmentsdone", "workshop").
|
||||
if ($workshop->wtype) {
|
||||
echo "<td bgcolor=\"$THEME->cellheading2\" align=\"center\"><b>".get_string("assessmentsdone", "workshop").
|
||||
"</b></td>";
|
||||
echo "<td bgcolor=\"$THEME->cellheading2\" align=\"center\"><b>".get_string("gradeforassessments",
|
||||
echo "<td bgcolor=\"$THEME->cellheading2\" align=\"center\"><b>".get_string("gradeforassessments",
|
||||
"workshop")."</b></td>";
|
||||
}
|
||||
echo "<td bgcolor=\"$THEME->cellheading2\" align=\"center\"><b>".get_string("assessmentsby", "workshop",
|
||||
$course->teachers)."</b></td>";
|
||||
echo "<td bgcolor=\"$THEME->cellheading2\" align=\"center\"><b>".get_string("assessmentsby", "workshop",
|
||||
if ($workshop->wtype) {
|
||||
echo "<td bgcolor=\"$THEME->cellheading2\" align=\"center\"><b>".get_string("assessmentsby", "workshop",
|
||||
$course->students)."</b></td>";
|
||||
}
|
||||
echo "<td bgcolor=\"$THEME->cellheading2\" align=\"center\"><b>".get_string("gradeforsubmission",
|
||||
"workshop")."</b></td>";
|
||||
echo "<td bgcolor=\"$THEME->cellheading2\" align=\"center\"><b>".get_string("overallgrade", "workshop").
|
||||
@@ -236,12 +282,16 @@
|
||||
$grade = workshop_submission_grade($workshop, $submission);
|
||||
echo "<tr><td>$user->firstname $user->lastname</td>";
|
||||
echo "<td>".workshop_print_submission_title($workshop, $submission)."</td>\n";
|
||||
echo "<td align=\"center\">".workshop_print_user_assessments($workshop, $user)."</td>";
|
||||
echo "<td align=\"center\">$gradinggrade</td>";
|
||||
if ($workshop->wtype) {
|
||||
echo "<td align=\"center\">".workshop_print_user_assessments($workshop, $user)."</td>";
|
||||
echo "<td align=\"center\">$gradinggrade</td>";
|
||||
}
|
||||
echo "<td align=\"center\">".workshop_print_submission_assessments($workshop, $submission,
|
||||
"teacher")."</td>";
|
||||
echo "<td align=\"center\">".workshop_print_submission_assessments($workshop, $submission,
|
||||
if ($workshop->wtype) {
|
||||
echo "<td align=\"center\">".workshop_print_submission_assessments($workshop, $submission,
|
||||
"student")."</td>";
|
||||
}
|
||||
echo "<td align=\"center\">$grade</td>";
|
||||
echo "<td align=\"center\">".number_format($gradinggrade + $grade, 1)."</td></tr>\n";
|
||||
}
|
||||
|
||||
@@ -43,7 +43,10 @@
|
||||
$newsubmission->userid = $USER->id;
|
||||
$newsubmission->title = $title;
|
||||
$newsubmission->description = trim($form->description);
|
||||
$newsubmission->timecreated = time();
|
||||
$newsubmission->timecreated = $timenow;
|
||||
if ($timenow > $workshop->deadline) {
|
||||
$newsubmission->late = 1;
|
||||
}
|
||||
if (!$newsubmission->id = insert_record("workshop_submissions", $newsubmission)) {
|
||||
error("Workshop upload: Failure to create new submission record!");
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
// This fragment is called by /admin/index.php
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
$module->version = 2004092400;
|
||||
$module->version = 2004092700;
|
||||
$module->requires = 2004091700; // Requires this Moodle version
|
||||
$module->cron = 60;
|
||||
|
||||
|
||||
+138
-81
@@ -11,7 +11,7 @@
|
||||
notavailable (for students)
|
||||
setupassignment (for teachers)
|
||||
studentsview
|
||||
submitassignment
|
||||
submitexample
|
||||
teachersview
|
||||
|
||||
************************************************/
|
||||
@@ -138,24 +138,32 @@
|
||||
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 "<td align=\"center\"><b>".get_string("assessmentsdone", "workshop")."</b></td>";
|
||||
echo "<td align=\"center\"><b>".get_string("gradeforassessments", "workshop")."</b></td>";
|
||||
if ($workshop->wtype) {
|
||||
echo "<td align=\"center\"><b>".get_string("assessmentsdone", "workshop")."</b></td>";
|
||||
echo "<td align=\"center\"><b>".get_string("gradeforassessments", "workshop")."</b></td>";
|
||||
}
|
||||
echo "<td align=\"center\"><b>".get_string("teacherassessments", "workshop",
|
||||
$course->teacher)."</b></td>";
|
||||
echo "<td align=\"center\"><b>".get_string("studentassessments", "workshop",
|
||||
if ($workshop->wtype) {
|
||||
echo "<td align=\"center\"><b>".get_string("studentassessments", "workshop",
|
||||
$course->student)."</b></td>";
|
||||
}
|
||||
echo "<td align=\"center\"><b>".get_string("gradeforsubmission", "workshop")."</b></td>";
|
||||
echo "<td align=\"center\"><b>".get_string("overallgrade", "workshop")."</b></td></tr>\n";
|
||||
$gradinggrade = workshop_gradinggrade($workshop, $USER);
|
||||
foreach ($submissions as $submission) {
|
||||
$grade = workshop_submission_grade($workshop, $submission);
|
||||
echo "<tr><td>".workshop_print_submission_title($workshop, $submission)."</td>\n";
|
||||
echo "<td align=\"center\">".workshop_print_user_assessments($workshop, $USER)."</td>";
|
||||
echo "<td align=\"center\">$gradinggrade</td>";
|
||||
if ($workshop->wtype) {
|
||||
echo "<td align=\"center\">".workshop_print_user_assessments($workshop, $USER)."</td>";
|
||||
echo "<td align=\"center\">$gradinggrade</td>";
|
||||
}
|
||||
echo "<td align=\"center\">".workshop_print_submission_assessments($workshop,
|
||||
$submission, "teacher")."</td>";
|
||||
echo "<td align=\"center\">".workshop_print_submission_assessments($workshop,
|
||||
if ($workshop->wtype) {
|
||||
echo "<td align=\"center\">".workshop_print_submission_assessments($workshop,
|
||||
$submission, "student")."</td>";
|
||||
}
|
||||
echo "<td align=\"center\">$grade</td>";
|
||||
echo "<td align=\"center\">".number_format($gradinggrade + $grade, 1)."</td></tr>\n";
|
||||
}
|
||||
@@ -203,6 +211,42 @@
|
||||
/****************** student's view could be in 1 of 4 stages ***********************/
|
||||
elseif ($action == 'studentsview') {
|
||||
workshop_print_assignment_info($workshop);
|
||||
// is a password needed?
|
||||
if ($workshop->usepassword) {
|
||||
$correctpass = false;
|
||||
if (isset($_POST['userpassword'])) {
|
||||
if ($workshop->password == md5(trim($_POST['userpassword']))) {
|
||||
$USER->workshoploggedin[$workshop->id] = true;
|
||||
$correctpass = true;
|
||||
}
|
||||
} elseif (isset($USER->workshoploggedin[$workshop->id])) {
|
||||
$correctpass = true;
|
||||
}
|
||||
|
||||
if (!$correctpass) {
|
||||
print_simple_box_start("center");
|
||||
echo "<form name=\"password\" method=\"post\" action=\"view.php\">\n";
|
||||
echo "<input type=\"hidden\" name=\"id\" value=\"$cm->id\" />\n";
|
||||
echo "<table cellpadding=\"7px\">";
|
||||
if (isset($_POST['userpassword'])) {
|
||||
echo "<tr align=\"center\" style='color:#DF041E;'><td>".get_string("wrongpassword", "workshop").
|
||||
"</td></tr>";
|
||||
}
|
||||
echo "<tr align=\"center\"><td>".get_string("passwordprotectedworkshop", "workshop", $workshop->name).
|
||||
"</td></tr>";
|
||||
echo "<tr align=\"center\"><td>".get_string("enterpassword", "workshop").
|
||||
" <input type=\"password\" name=\"userpassword\" /></td></tr>";
|
||||
|
||||
echo "<tr align=\"center\"><td>";
|
||||
echo "<input type=\"button\" value=\"".get_string("cancel").
|
||||
"\" onclick=\"parent.location='../../course/view.php?id=$course->id';\"> ";
|
||||
echo "<input type=\"button\" value=\"".get_string("continue").
|
||||
"\" onclick=\"document.password.submit();\" />";
|
||||
echo "</td></tr></table>";
|
||||
print_simple_box_end();
|
||||
exit();
|
||||
}
|
||||
}
|
||||
// in Stage 1? - are there any teacher's submissions? and...
|
||||
// ...has student assessed the required number of the teacher's submissions
|
||||
if ($workshop->ntassessments and (!workshop_test_user_assessments($workshop, $USER))) {
|
||||
@@ -287,8 +331,8 @@
|
||||
}
|
||||
|
||||
|
||||
/****************** submission of assignment by teacher only***********************/
|
||||
elseif ($action == 'submitassignment') {
|
||||
/****************** submission of example by teacher only***********************/
|
||||
elseif ($action == 'submitexample') {
|
||||
|
||||
if (!isteacher($course->id)) {
|
||||
error("Only teachers can look at this page");
|
||||
@@ -308,7 +352,7 @@
|
||||
echo "<hr size=\"1\" noshade=\"noshade\" />";
|
||||
|
||||
// print upload form
|
||||
print_heading(get_string("submitassignment", "assignment").":");
|
||||
print_heading(get_string("submitexampleassignment", "workshop").":");
|
||||
workshop_print_upload_form($workshop);
|
||||
}
|
||||
|
||||
@@ -337,16 +381,25 @@
|
||||
|
||||
workshop_print_assignment_info($workshop);
|
||||
|
||||
$tabs->names = array("1. ".get_string("phase1", "workshop"),
|
||||
"2. ".get_string("phase2", "workshop", $course->student),
|
||||
"3. ".get_string("phase3", "workshop", $course->student),
|
||||
"4. ".get_string("phase4", "workshop", $course->student),
|
||||
"5. ".get_string("phase5", "workshop"));
|
||||
$tabs->urls = array("view.php?id=$cm->id&action=setupassignment",
|
||||
"view.php?id=$cm->id&action=allowsubmissions",
|
||||
"view.php?id=$cm->id&action=allowboth",
|
||||
"view.php?id=$cm->id&action=allowassessments",
|
||||
"view.php?id=$cm->id&action=makefinalgradesavailable");
|
||||
if ($workshop->wtype < 2) {
|
||||
$tabs->names = array("1. ".get_string("phase1", "workshop"),
|
||||
"2. ".get_string("phase2", "workshop", $course->student),
|
||||
"3. ".get_string("phase5", "workshop"));
|
||||
$tabs->urls = array("view.php?id=$cm->id&action=setupassignment",
|
||||
"view.php?id=$cm->id&action=allowsubmissions",
|
||||
"view.php?id=$cm->id&action=makefinalgradesavailable");
|
||||
} else {
|
||||
$tabs->names = array("1. ".get_string("phase1", "workshop"),
|
||||
"2. ".get_string("phase2", "workshop", $course->student),
|
||||
"3. ".get_string("phase3", "workshop", $course->student),
|
||||
"4. ".get_string("phase4", "workshop", $course->student),
|
||||
"5. ".get_string("phase5", "workshop"));
|
||||
$tabs->urls = array("view.php?id=$cm->id&action=setupassignment",
|
||||
"view.php?id=$cm->id&action=allowsubmissions",
|
||||
"view.php?id=$cm->id&action=allowboth",
|
||||
"view.php?id=$cm->id&action=allowassessments",
|
||||
"view.php?id=$cm->id&action=makefinalgradesavailable");
|
||||
}
|
||||
if ($workshop->phase) { // phase 1 or more
|
||||
$tabs->highlight = $workshop->phase - 1;
|
||||
} else {
|
||||
@@ -354,72 +407,76 @@
|
||||
}
|
||||
workshop_print_tabbed_heading($tabs);
|
||||
echo "<center>\n";
|
||||
switch ($workshop->phase) {
|
||||
case 0:
|
||||
case 1: // set up assignment
|
||||
if ($workshop->nelements) {
|
||||
echo "<p><b><a href=\"assessments.php?id=$cm->id&action=editelements\">".
|
||||
get_string("amendassessmentelements", "workshop")."</a></b> \n";
|
||||
helpbutton("elements", get_string("amendassessmentelements", "workshop"), "workshop");
|
||||
}
|
||||
if ($workshop->ntassessments) {
|
||||
// if teacher examples show submission and assessment links
|
||||
echo "<p><b><a href=\"view.php?id=$cm->id&action=submitassignment\">".
|
||||
get_string("submitexampleassignment", "workshop")."</a></b> \n";
|
||||
helpbutton("submissionofexamples", get_string("submitexampleassignment", "workshop"),
|
||||
"workshop");
|
||||
switch ($workshop->phase) {
|
||||
case 0:
|
||||
case 1: // set up assignment
|
||||
if ($workshop->nelements) {
|
||||
echo "<p><b><a href=\"assessments.php?id=$cm->id&action=editelements\">".
|
||||
get_string("amendassessmentelements", "workshop")."</a></b> \n";
|
||||
helpbutton("elements", get_string("amendassessmentelements", "workshop"), "workshop");
|
||||
}
|
||||
if ($workshop->ntassessments) {
|
||||
// if teacher examples show submission and assessment links
|
||||
echo "<p><b><a href=\"view.php?id=$cm->id&action=submitexample\">".
|
||||
get_string("submitexampleassignment", "workshop")."</a></b> \n";
|
||||
helpbutton("submissionofexamples", get_string("submitexampleassignment", "workshop"),
|
||||
"workshop");
|
||||
echo "<p><b><a href=\"submissions.php?id=$cm->id&action=listforassessmentteacher\">".
|
||||
get_string("teachersubmissionsforassessment", "workshop",
|
||||
workshop_count_teacher_submissions_for_assessment($workshop, $USER)).
|
||||
"</a></b> \n";
|
||||
helpbutton("assessmentofexamples", get_string("teachersubmissionsforassessment",
|
||||
"workshop"), "workshop");
|
||||
}
|
||||
break;
|
||||
|
||||
case 2: // submissions and assessments
|
||||
case 3:
|
||||
case 4:
|
||||
if ($workshop->ntassessments) { // if teacher examples show student assessments link
|
||||
if ($n = workshop_count_teacher_submissions_for_assessment($workshop, $USER)) {
|
||||
echo "<p><b><a href=\"submissions.php?id=$cm->id&action=listforassessmentteacher\">".
|
||||
get_string("teachersubmissionsforassessment", "workshop",
|
||||
workshop_count_teacher_submissions_for_assessment($workshop, $USER)).
|
||||
"</a></b> \n";
|
||||
get_string("teachersubmissionsforassessment", "workshop", $n)."</a></b> \n";
|
||||
helpbutton("assessmentofexamples", get_string("teachersubmissionsforassessment",
|
||||
"workshop"), "workshop");
|
||||
}
|
||||
break;
|
||||
|
||||
case 2: // submissions and assessments
|
||||
case 3:
|
||||
case 4:
|
||||
if ($workshop->ntassessments) { // if teacher examples show student assessments link
|
||||
if ($n = workshop_count_teacher_submissions_for_assessment($workshop, $USER)) {
|
||||
echo "<p><b><a href=\"submissions.php?id=$cm->id&action=listforassessmentteacher\">".
|
||||
get_string("teachersubmissionsforassessment", "workshop", $n)."</a></b> \n";
|
||||
helpbutton("assessmentofexamples", get_string("teachersubmissionsforassessment",
|
||||
}
|
||||
if ($workshop->wtype) {
|
||||
echo "<p><b><a href=\"assessments.php?id=$cm->id&action=gradeallassessments\">".
|
||||
get_string("ungradedassessments", "workshop",
|
||||
workshop_count_ungraded_assessments($workshop))."</a></b> \n";
|
||||
helpbutton("ungradedassessments",
|
||||
get_string("ungradedassessments", "workshop"), "workshop");
|
||||
}
|
||||
echo "<p><b><a href=\"submissions.php?id=$cm->id&action=listforassessmentstudent\">".
|
||||
get_string("studentsubmissionsforassessment", "workshop",
|
||||
workshop_count_student_submissions_for_assessment($workshop, $USER))."</a></b> \n";
|
||||
helpbutton("gradingsubmissions",
|
||||
get_string("studentsubmissionsforassessment", "workshop"), "workshop");
|
||||
break;
|
||||
|
||||
case 5: // Show "Final" Grades
|
||||
if ($workshop->ntassessments) { // if teacher examples show student assessments link
|
||||
if ($n = workshop_count_teacher_submissions_for_assessment($workshop, $USER)) {
|
||||
echo "<p><b><a href=\"submissions.php?id=$cm->id&action=listforassessmentteacher\">".
|
||||
get_string("teachersubmissionsforassessment", "workshop", $n)."</a></b> \n";
|
||||
helpbutton("assessmentofexamples", get_string("teachersubmissionsforassessment",
|
||||
"workshop"), "workshop");
|
||||
}
|
||||
}
|
||||
echo "<p><b><a href=\"assessments.php?id=$cm->id&action=gradeallassessments\">".
|
||||
get_string("ungradedassessments", "workshop",
|
||||
workshop_count_ungraded_assessments($workshop))."</a></b> \n";
|
||||
helpbutton("ungradedassessments",
|
||||
get_string("ungradedassessments", "workshop"), "workshop");
|
||||
echo "<p><b><a href=\"submissions.php?id=$cm->id&action=listforassessmentstudent\">".
|
||||
get_string("studentsubmissionsforassessment", "workshop",
|
||||
workshop_count_student_submissions_for_assessment($workshop, $USER))."</a></b> \n";
|
||||
helpbutton("gradingsubmissions",
|
||||
get_string("studentsubmissionsforassessment", "workshop"), "workshop");
|
||||
break;
|
||||
|
||||
case 5: // Show "Final" Grades
|
||||
if ($workshop->ntassessments) { // if teacher examples show student assessments link
|
||||
if ($n = workshop_count_teacher_submissions_for_assessment($workshop, $USER)) {
|
||||
echo "<p><b><a href=\"submissions.php?id=$cm->id&action=listforassessmentteacher\">".
|
||||
get_string("teachersubmissionsforassessment", "workshop", $n)."</a></b> \n";
|
||||
helpbutton("assessmentofexamples", get_string("teachersubmissionsforassessment",
|
||||
"workshop"), "workshop");
|
||||
}
|
||||
}
|
||||
echo "<p><b><a href=\"assessments.php?id=$cm->id&action=gradeallassessments\">".
|
||||
get_string("ungradedassessments", "workshop",
|
||||
workshop_count_ungraded_assessments($workshop))."</a></b> \n";
|
||||
helpbutton("ungradedassessments", get_string("ungradedassessments", "workshop"), "workshop");
|
||||
echo "<p><b><a href=\"submissions.php?id=$cm->id&action=listforassessmentstudent\">".
|
||||
get_string("studentsubmissionsforassessment", "workshop",
|
||||
workshop_count_student_submissions_for_assessment($workshop, $USER))."</a></b> \n";
|
||||
helpbutton("gradingsubmissions",
|
||||
get_string("studentsubmissionsforassessment", "workshop"), "workshop");
|
||||
print_heading("<a href=\"submissions.php?id=$cm->id&action=displayfinalgrades\">".
|
||||
get_string("displayoffinalgrades", "workshop")."</a>");
|
||||
}
|
||||
}
|
||||
if ($workshop->wtype) {
|
||||
echo "<p><b><a href=\"assessments.php?id=$cm->id&action=gradeallassessments\">".
|
||||
get_string("ungradedassessments", "workshop",
|
||||
workshop_count_ungraded_assessments($workshop))."</a></b> \n";
|
||||
helpbutton("ungradedassessments", get_string("ungradedassessments", "workshop"), "workshop");
|
||||
}
|
||||
echo "<p><b><a href=\"submissions.php?id=$cm->id&action=listforassessmentstudent\">".
|
||||
get_string("studentsubmissionsforassessment", "workshop",
|
||||
workshop_count_student_submissions_for_assessment($workshop, $USER))."</a></b> \n";
|
||||
helpbutton("gradingsubmissions",
|
||||
get_string("studentsubmissionsforassessment", "workshop"), "workshop");
|
||||
print_heading("<a href=\"submissions.php?id=$cm->id&action=displayfinalgrades\">".
|
||||
get_string("displayoffinalgrades", "workshop")."</a>");
|
||||
}
|
||||
print_heading("<a href=\"submissions.php?id=$cm->id&action=adminlist\">".
|
||||
get_string("administration")."</a>");
|
||||
|
||||
Reference in New Issue
Block a user