Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Minor errors fixed; Student can delete submissions and assessments;

Teachers see student names; Tabbed Admin screen.
  • Loading branch information...
commit 0e29a0b1d8568afe58c60ee8a396de3d5ed639e9 1 parent db7def8
authored July 28, 2003
54  mod/workshop/assessments.php
@@ -5,6 +5,8 @@
5 5
 	ACTIONS handled are:
6 6
 
7 7
 	addcomment
  8
+	adminconfirmdelete
  9
+	admindelete
8 10
 	adminlist
9 11
 	agreeassessment
10 12
 	assesssubmission
@@ -20,6 +22,8 @@
20 22
 	updateassessment
21 23
 	updatecomment
22 24
 	updategrading
  25
+	userconfirmdelete
  26
+	userdelete
23 27
 	viewassessment
24 28
 
25 29
 ************************************************/
@@ -121,7 +125,7 @@
121 125
 			error("Admin confirm delete: assessment id missing");
122 126
 			}
123 127
 			
124  
-		notice_yesno(get_string("confirmdeletionofthisitem","workshop"), 
  128
+		notice_yesno(get_string("confirmdeletionofthisitem","workshop", get_string("assessment", "workshop")), 
125 129
 			 "assessments.php?action=admindelete&id=$cm->id&aid=$_GET[aid]", "submissions.php?action=adminlist&id=$cm->id");
126 130
 		}
127 131
 	
@@ -147,7 +151,7 @@
147 151
 		}
148 152
 	
149 153
 
150  
-	/*********************** admin list of asssessments (by teachers)***********************/
  154
+	/*********************** admin list of asssessments (of a submission) (by teachers)**************/
151 155
 	elseif ($action == 'adminlist') {
152 156
 
153 157
 		if (!isteacher($course->id)) {
@@ -163,6 +167,22 @@
163 167
 		}
164 168
 
165 169
 
  170
+	/*********************** admin list of asssessments by a student (used by teachers only )******************/
  171
+	elseif ($action == 'adminlistbystudent') {
  172
+
  173
+		if (!isteacher($course->id)) {
  174
+			error("Only teachers can look at this page");
  175
+			}
  176
+			
  177
+		if (empty($_GET['userid'])) {
  178
+			error ("Workshop asssessments: adminlistbystudent called with no userid");
  179
+			}
  180
+		$user = get_record("user", "id", $_GET['userid']);
  181
+		workshop_print_assessments_by_user_for_admin($workshop, $user);
  182
+		print_continue("submissions.php?action=adminlist&a=$workshop->id");
  183
+		}
  184
+
  185
+
166 186
 	/*************** agree (to) assessment (by student) ***************************/
167 187
 	elseif ($action == 'agreeassessment') {
168 188
 		$timenow = time();
@@ -844,6 +864,36 @@
844 864
 		}
845 865
 
846 866
 
  867
+	/******************* user confirm delete ************************************/
  868
+	elseif ($action == 'userconfirmdelete' ) {
  869
+
  870
+		if (empty($_GET['aid'])) {
  871
+			error("User confirm delete: assessment id missing");
  872
+			}
  873
+			
  874
+		notice_yesno(get_string("confirmdeletionofthisitem","workshop", get_string("assessment", "workshop")), 
  875
+			 "assessments.php?action=userdelete&id=$cm->id&aid=$_GET[aid]", "view.php?id=$cm->id");
  876
+		}
  877
+	
  878
+
  879
+	/******************* user delete ************************************/
  880
+	elseif ($action == 'userdelete' ) {
  881
+
  882
+		if (empty($_GET['aid'])) {
  883
+			error("User delete: assessment id missing");
  884
+			}
  885
+			
  886
+		print_string("deleting", "workshop");
  887
+		// first delete all the associated records...
  888
+		delete_records("workshop_comments", "assessmentid", $_GET['aid']);
  889
+		delete_records("workshop_grades", "assessmentid", $_GET['aid']);
  890
+		// ...now delete the assessment...
  891
+		delete_records("workshop_assessments", "id", $_GET['aid']);
  892
+		
  893
+		print_continue("view.php?id=$cm->id");
  894
+		}
  895
+	
  896
+
847 897
 	/*********************** view all assessments ***********************/
848 898
 	elseif ($action == 'viewallassessments') {
849 899
 		
325  mod/workshop/lib.php
@@ -2,6 +2,8 @@
2 2
 
3 3
 include_once("$CFG->dirroot/files/mimetypes.php");
4 4
 
  5
+error_reporting(15);
  6
+
5 7
 /*** Constants **********************************/
6 8
 
7 9
 $WORKSHOP_TYPE = array (0 => get_string("notgraded", "workshop"),
@@ -653,10 +655,11 @@ function workshop_log_info($log) {
653 655
 
654 656
 /*** Functions for the workshop module ******
655 657
 
656  
-function workshop_count_all_assessments($workshop, $user) {
657 658
 function workshop_count_all_submissions_for_assessment($workshop, $user) {
  659
+function workshop_count_assessments($submission) {
658 660
 function workshop_count_comments($assessment) {
659 661
 function workshop_count_peer_assessments($workshop, $user) {
  662
+function workshop_count_self_assessments($workshop, $user) {
660 663
 function workshop_count_student_submissions($workshop) {
661 664
 function workshop_count_student_submissions_for_assessment($workshop, $user) {
662 665
 function workshop_count_teacher_assessments($workshop, $user) {
@@ -664,6 +667,7 @@ function workshop_count_teacher_submissions($workshop) {
664 667
 function workshop_count_teacher_submissions_for_assessment($workshop, $user) {
665 668
 function workshop_count_ungraded_assessments_student($workshop) {
666 669
 function workshop_count_ungraded_assessments_teacher($workshop) {
  670
+function workshop_count_user_assessments($worshop, $user, $type = "all") { $type is all, student or teacher
667 671
 
668 672
 function workshop_delete_submitted_files($workshop, $submission) {
669 673
 function workshop_delete_user_files($workshop, $user, $exception) {
@@ -701,10 +705,13 @@ function workshop_list_user_submissions($workshop, $user) {
701 705
 
702 706
 
703 707
 function workshop_print_assessment($workshop, $assessment, $allowchanges, $showcommentlinks)
  708
+function workshop_print_assessments_by_user_for_admin($workshop, $user) {
  709
+function workshop_print_assessments_for_admin($workshop, $submission) {
704 710
 function workshop_print_difference($time) {
705 711
 function workshop_print_feedback($course, $submission) {
706 712
 function workshop_print_submission_assessments($workshop, $submission, $type) {
707 713
 function workshop_print_submission_title($workshop, $user) {
  714
+function workshop_print_tabbed_table($table) {
708 715
 function workshop_print_time_to_deadline($time) {
709 716
 function workshop_print_upload_form($workshop) {
710 717
 function workshop_print_user_assessments($workshop, $user) {
@@ -712,10 +719,6 @@ function workshop_print_user_assessments($workshop, $user) {
712 719
 function workshop_test_user_assessments($workshop, $user) {
713 720
 ***************************************/
714 721
 
715  
-function workshop_count_all_assessments($workshop, $user) {
716  
-	return count_records("workshop_assessments", "workshopid", $workshop->id, "userid", $user->id);
717  
-	}
718  
-
719 722
 
720 723
 function workshop_count_all_submissions_for_assessment($workshop, $user) {
721 724
 	// looks at all submissions and deducts the number which has been assessed by this user
@@ -730,31 +733,13 @@ function workshop_count_all_submissions_for_assessment($workshop, $user) {
730 733
 	}
731 734
 
732 735
 
733  
-function workshop_count_assessments($workshop, $stype, $user) {
734  
-	// returns the number of assessments made by a user on either the student or teacher submissions
735  
-	// the maxeditingtime is NOT taken into account here
736  
-	
737  
-	switch ($stype) {
738  
-	case "student" :
739  
-		$submissions = workshop_get_student_submissions($workshop);
740  
-		break;
741  
-	case "teacher" :
742  
-		$submissions = workshop_get_teacher_submissions($workshop);
743  
-		break;
744  
-		}
745  
-	$n = 0;
746  
-	if ($submissions) {
747  
-		foreach ($submissions as $submission) {
748  
-			$n += count_records_select("workshop_assessments", "(submissionid = $submission->id) AND 
749  
-				(userid = $user->id)");
750  
-			}
751  
-		}
752  
-	return $n;
753  
-	}
754  
-
  736
+function workshop_count_assessments($submission) {
  737
+	// Return the assessments for this submission, 
  738
+   return count_records_select("workshop_assessments", "submissionid = $submission->id");
  739
+}
755 740
 
756 741
 function workshop_count_comments($assessment) {
757  
-	// Return the number comments for this assessment provided they are newer than the assessment, 
  742
+	// Return the number of comments for this assessment provided they are newer than the assessment, 
758 743
    return count_records_select("workshop_comments", "(assessmentid = $assessment->id) AND 
759 744
 		timecreated > $assessment->timecreated");
760 745
 }
@@ -780,6 +765,22 @@ function workshop_count_peer_assessments($workshop, $user) {
780 765
 	}
781 766
 
782 767
 
  768
+function workshop_count_self_assessments($workshop, $user) {
  769
+	// returns the number of assessments made by user on their own submissions
  770
+	
  771
+	$n = 0;
  772
+	if ($submissions = workshop_get_user_submissions($workshop, $user)) {
  773
+		foreach ($submissions as $submission) {
  774
+			if ($assessment = get_record_select("workshop_assessments", "userid = $user->id AND 
  775
+					submissionid = $submission->id")) {
  776
+				$n++;
  777
+				}
  778
+			}
  779
+		}
  780
+	return $n;
  781
+	}
  782
+
  783
+
783 784
 function workshop_count_student_submissions($workshop) {
784 785
 	global $CFG;
785 786
 	
@@ -899,6 +900,37 @@ function workshop_count_ungraded_assessments_teacher($workshop) {
899 900
 	}
900 901
 
901 902
 
  903
+function workshop_count_user_assessments($workshop, $user, $stype = "all") {
  904
+	// returns the number of assessments made by a user, all of them, or just those for the student or teacher submissions
  905
+	// the student's self assessments are included in the count
  906
+	// the maxeditingtime is NOT taken into account here
  907
+	
  908
+	$n = 0;
  909
+	if ($assessments = workshop_get_user_assessments($workshop, $user)) {
  910
+		 foreach ($assessments as $assessment) {
  911
+			switch ($stype) {
  912
+				case "all" :
  913
+					$n++;
  914
+					break;
  915
+				case "student" :
  916
+					 $submission = get_record("workshop_submissions", "id", $assessment->submissionid);
  917
+					if (isstudent($workshop->course, $submission->userid)) {
  918
+						$n++;
  919
+						}
  920
+					break;
  921
+				case "teacher" :
  922
+					 $submission = get_record("workshop_submissions", "id", $assessment->submissionid);
  923
+					if (isteacher($workshop->course, $submission->userid)) {
  924
+						$n++;
  925
+						}
  926
+					break;
  927
+				}
  928
+			}
  929
+		}
  930
+	return $n;
  931
+	}
  932
+
  933
+
902 934
 function workshop_delete_submitted_files($workshop, $submission) {
903 935
 // Deletes the files in the workshop area for this submission
904 936
 
@@ -1005,11 +1037,11 @@ function workshop_get_student_submissions($workshop, $order = "title") {
1005 1037
 // Return all  ENROLLED student submissions
1006 1038
 	global $CFG;
1007 1039
 	
1008  
-	if ($order = "title") {
  1040
+	if ($order == "title") {
1009 1041
 		$order = "s.title";
1010 1042
 		}
1011 1043
 	if ($order == "name") {
1012  
-		$order = "firstname, lastname";
  1044
+		$order = "a.firstname, a.lastname";
1013 1045
 		}
1014 1046
     return get_records_sql("SELECT s.* FROM {$CFG->prefix}workshop_submissions s, {$CFG->prefix}user_students u,
1015 1047
 							{$CFG->prefix}user a 
@@ -1319,9 +1351,13 @@ function workshop_list_assessed_submissions($workshop, $user) {
1319 1351
 				}
1320 1352
 			else { // there's still time left to edit...
1321 1353
 				$action = "<A HREF=\"assessments.php?action=assesssubmission&a=$workshop->id&sid=$submission->id\">".
1322  
-					get_string("edit", "workshop")."</A>";
  1354
+					get_string("edit", "workshop")."</A> | <A HREF=\"assessments.php?action=userconfirmdelete&a=$workshop->id&aid=$assessment->id\">".
  1355
+					get_string("delete", "workshop")."</A>";
1323 1356
 				}
1324 1357
 			$comment = get_string("assessedon", "workshop", userdate($assessment->timecreated));
  1358
+			if ($submission->userid == $user->id) { // self assessment?
  1359
+				$comment .= "; ".get_string("ownwork", "workshop"); // just in case they don't know!
  1360
+				}
1325 1361
 			// has teacher commented on user's assessment?
1326 1362
 			if ($assessment->timegraded and ($timenow - $assessment->timegraded > $CFG->maxeditingtime)) {
1327 1363
 				$comment .= "; ".get_string("gradedbyteacher", "workshop", $course->teacher);
@@ -1365,7 +1401,8 @@ function workshop_list_peer_assessments($workshop, $user) {
1365 1401
 			// get the assessments
1366 1402
 			if ($assessments = workshop_get_assessments($submission)) {
1367 1403
 				foreach ($assessments as $assessment) {
1368  
-					if (isstudent($workshop->course, $assessment->userid)) { // assessments by students only
  1404
+					// assessments by students only and exclude any self assessments
  1405
+					if (isstudent($workshop->course, $assessment->userid) and ($assessment->userid != $user->id)) { 
1369 1406
 						$timenow = time();
1370 1407
 						if (($timenow - $assessment->timecreated) > $CFG->maxeditingtime) {
1371 1408
 							$action = "<A HREF=\"assessments.php?action=viewassessment&a=$workshop->id&aid=$assessment->id&".
@@ -1402,6 +1439,42 @@ function workshop_list_peer_assessments($workshop, $user) {
1402 1439
 
1403 1440
 
1404 1441
 
  1442
+function workshop_list_self_assessments($workshop, $user) {
  1443
+	// list  user's submissions for the user to assess
  1444
+	global $CFG;
  1445
+	
  1446
+	if (! $course = get_record("course", "id", $workshop->course)) {
  1447
+        error("Course is misconfigured");
  1448
+        }
  1449
+	$table->head = array (get_string("title", "workshop"), get_string("action", "workshop"), get_string("comment", "workshop"));
  1450
+	$table->align = array ("LEFT", "LEFT", "LEFT");
  1451
+	$table->size = array ("*", "*", "*");
  1452
+	$table->cellpadding = 2;
  1453
+	$table->cellspacing = 0;
  1454
+
  1455
+	// get the user's submissions 
  1456
+	if ($submissions = workshop_get_user_submissions($workshop, $user)) {
  1457
+		foreach ($submissions as $submission) {
  1458
+			$comment = "";
  1459
+			if (!$assessment = get_record_select("workshop_assessments", "submissionid = $submission->id AND
  1460
+					userid = $user->id")) {
  1461
+				if ($submission->userid == $user->id) { // this will always be true
  1462
+					$comment = get_string("ownwork", "workshop"); // just in case they don't know!
  1463
+					}
  1464
+				$action = "<A HREF=\"assessments.php?action=assesssubmission&a=$workshop->id&sid=$submission->id\">".
  1465
+					get_string("assess", "workshop")."</A>";
  1466
+				$table->data[] = array(workshop_print_submission_title($workshop, $submission), $action, $comment);
  1467
+				}
  1468
+			}
  1469
+		}
  1470
+	if (isset($table->data)) {
  1471
+		echo "<P><CENTER><B>".get_string("pleaseassessyoursubmissions", "workshop", $course->student).
  1472
+			"</B></CENTER><BR>\n";
  1473
+		print_table($table);
  1474
+		}
  1475
+	}
  1476
+
  1477
+
1405 1478
 function workshop_list_student_submissions($workshop, $user) {
1406 1479
 	// list available submissions for this user to assess, submissions with the least number 
1407 1480
 	// of assessments are show first
@@ -1416,8 +1489,9 @@ function workshop_list_student_submissions($workshop, $user) {
1416 1489
 	$table->cellpadding = 2;
1417 1490
 	$table->cellspacing = 0;
1418 1491
 
1419  
-	// get the number of assessments this user has done
1420  
-	$nassessed = workshop_count_assessments($workshop, "student", $user);
  1492
+	// get the number of assessments this user has done on student submission, deduct self assessments
  1493
+	$nassessed = workshop_count_user_assessments($workshop, $user, "student") - 
  1494
+		workshop_count_self_assessments($workshop, $user);
1421 1495
 
1422 1496
 	// count the number of assessments for each student submission
1423 1497
 	if ($submissions = workshop_get_student_submissions($workshop)) {
@@ -1432,13 +1506,10 @@ function workshop_list_student_submissions($workshop, $user) {
1432 1506
 		asort($nassessments);
1433 1507
 		reset($nassessments);
1434 1508
 		$nsassessments = $workshop->nsassessments;
1435  
-		if ($workshop->includeself) { // add one if self assessment flag is set
1436  
-			$nsassessments++;
1437  
-			}
1438 1509
 		foreach ($nassessments as $submissionid =>$n) {
1439 1510
 			$comment = "";
1440 1511
 			$submission = get_record("workshop_submissions", "id", $submissionid);
1441  
-			if (($submission->userid != $user->id) or $workshop->includeself) {
  1512
+			if ($submission->userid != $user->id) {
1442 1513
 				// add if user has NOT already assessed this submission
1443 1514
 				if (!$assessment = get_record_select("workshop_assessments", "submissionid = $submissionid
1444 1515
 						AND userid = $user->id")) {
@@ -1519,12 +1590,13 @@ function workshop_list_submissions_for_admin($workshop, $order) {
1519 1590
 	unset($table);
1520 1591
 	switch ($order) {
1521 1592
 		case "title" :
1522  
-			$table->head = array (get_string("title", "workshop"), "<a href=\"submissions.php?action=adminlist&a=$workshop->id&order=name\">".
1523  
-				get_string("submittedby", "workshop")."</a>", get_string("action", "workshop"));
  1593
+			$table->head = array("<a href=\"submissions.php?action=adminlist&a=$workshop->id&order=name\">".
  1594
+				 get_string("submittedby", "workshop")."</a>", get_string("title", "workshop"), get_string("action", "workshop"));
1524 1595
 			break;
1525 1596
 		case "name" :
1526  
-			$table->head = array ("<a href=\"submissions.php?action=adminlist&a=$workshop->id&order=title\">".
1527  
-				get_string("title", "workshop")."</a>", get_string("submittedby", "workshop"), get_string("action", "workshop"));
  1597
+			$table->head = array (get_string("submittedby", "workshop"), 
  1598
+				"<a href=\"submissions.php?action=adminlist&a=$workshop->id&order=title\">".
  1599
+				get_string("title", "workshop")."</a>", get_string("action", "workshop"));
1528 1600
 			break;
1529 1601
 		}
1530 1602
 	$table->align = array ("left", "left", "left");
@@ -1556,13 +1628,18 @@ function workshop_list_submissions_for_admin($workshop, $order) {
1556 1628
 				$action .= " | <a href=\"assessments.php?action=assesssubmission&a=$workshop->id&sid=$submission->id\">".
1557 1629
 					get_string("assess", "workshop")."</a>";
1558 1630
 				}
1559  
-			if ($assessments = workshop_get_assessments($submission)) {
  1631
+			if ($nassessments = workshop_count_assessments($submission)) {
1560 1632
 				$action .= " | <a href=\"assessments.php?action=adminlist&a=$workshop->id&sid=$submission->id\">".
1561  
-					get_string("listassessments", "workshop")."</a>";
  1633
+					get_string("listassessments", "workshop")." ($nassessments)</a>";
  1634
+				}
  1635
+			if ($nassessments = workshop_count_user_assessments($workshop, $user, "all")) { // has user assessed anything?
  1636
+				$action .= " | <a href=\"assessments.php?action=adminlistbystudent&a=$workshop->id&userid=$user->id\">".
  1637
+					get_string("liststudentsassessments", "workshop")." ($nassessments)</a>";
1562 1638
 				}
1563 1639
 			$action .= " | <a href=\"submissions.php?action=adminconfirmdelete&a=$workshop->id&sid=$submission->id\">".
1564 1640
 				get_string("delete", "workshop")."</a>";
1565  
-			$table->data[] = array(workshop_print_submission_title($workshop, $submission), "$user->firstname $user->lastname", $action);
  1641
+			$table->data[] = array("$user->firstname $user->lastname", workshop_print_submission_title($workshop, $submission), 
  1642
+				$action);
1566 1643
 			}
1567 1644
 		print_table($table);
1568 1645
 		}
@@ -1812,16 +1889,26 @@ function workshop_list_ungraded_assessments($workshop, $stype) {
1812 1889
 	
1813 1890
 
1814 1891
 function workshop_list_user_submissions($workshop, $user) {
1815  
-	$table->head = array (get_string("title", "workshop"),  get_string("submitted", "assignment"), get_string("assessments", "workshop"));
1816  
-	$table->align = array ("LEFT", "LEFT", "LEFT");
1817  
-	$table->size = array ("*", "*", "*");
  1892
+	$table->head = array (get_string("title", "workshop"),  get_string("action", "workshop"),
  1893
+		get_string("submitted", "assignment"),  get_string("assessments", "workshop"));
  1894
+	$table->align = array ("LEFT", "LEFT", "LEFT", "LEFT");
  1895
+	$table->size = array ("*", "*", "*", "*");
1818 1896
 	$table->cellpadding = 2;
1819 1897
 	$table->cellspacing = 0;
1820 1898
 
1821 1899
 	if ($submissions = workshop_get_user_submissions($workshop, $user)) {
1822 1900
 		foreach ($submissions as $submission) {
1823  
-			$n = count_records("workshop_assessments", "submissionid", $submission->id);
1824  
-			$table->data[] = array(workshop_print_submission_title($workshop, $submission), userdate($submission->timecreated), $n);
  1901
+			// allow user to delete submissions if there is more than one submission 
  1902
+			if (count($submissions) > 1) {
  1903
+				$action = "<a href=\"submissions.php?action=userconfirmdelete&a=$workshop->id&sid=$submission->id\">".
  1904
+					get_string("delete", "workshop")."</a>";
  1905
+				}
  1906
+			else {
  1907
+				$action = '';
  1908
+				}
  1909
+				$n = count_records("workshop_assessments", "submissionid", $submission->id);
  1910
+			$table->data[] = array(workshop_print_submission_title($workshop, $submission), $action,
  1911
+				userdate($submission->timecreated), $n);
1825 1912
 			}
1826 1913
 		print_table($table);
1827 1914
 		}
@@ -2303,6 +2390,19 @@ function workshop_print_assessment($workshop, $assessment = false, $allowchanges
2303 2390
 	}
2304 2391
 
2305 2392
 
  2393
+function workshop_print_assessments_by_user_for_admin($workshop, $user) {
  2394
+
  2395
+	if ($assessments =workshop_get_user_assessments($workshop, $user)) {
  2396
+		foreach ($assessments as $assessment) {
  2397
+			echo "<p><center><b>".get_string("assessmentby", "workshop", $user->firstname." ".$user->lastname)."</b></center></p>\n";
  2398
+			workshop_print_assessment($workshop, $assessment);
  2399
+			echo "<p align=\"right\"><a href=\"assessments.php?action=adminconfirmdelete&a=$workshop->id&aid=$assessment->id\">".
  2400
+				get_string("delete", "workshop")."</a></p><hr>\n";
  2401
+			}
  2402
+		}
  2403
+	}
  2404
+
  2405
+
2306 2406
 function workshop_print_assessments_for_admin($workshop, $submission) {
2307 2407
 
2308 2408
 	if ($assessments =workshop_get_assessments($submission)) {
@@ -2421,31 +2521,89 @@ function workshop_print_submission_title($workshop, $submission) {
2421 2521
 }
2422 2522
 
2423 2523
 
2424  
-function workshop_print_user_assessments($workshop, $user) {
2425  
-	// Returns the number of assessments and a hyperlinked list of grading grades for the assessments made by this user
  2524
+function workshop_print_tabbed_heading($tabs) {
  2525
+// Prints a tabbed heading where one of the tabs highlighted.
  2526
+// $tabs is an object with several properties.
  2527
+// 		$tabs->names      is an array of tab names
  2528
+//		$tabs->urls       is an array of links
  2529
+// 		$tabs->align     is an array of column alignments (defaults to "center")
  2530
+// 		$tabs->size      is an array of column sizes
  2531
+// 		$tabs->wrap      is an array of "nowrap"s or nothing
  2532
+// 		$tabs->highlight    is an index (zero based) of "active" heading .
  2533
+// 		$tabs->width     is an percentage of the page (defualts to 80%)
  2534
+// 		$tabs->cellpadding    padding on each cell (defaults to 5)
2426 2535
 
2427  
-	if ($assessments = workshop_get_user_assessments($workshop, $user)) {
2428  
-		$n = count($assessments);
2429  
-		$str = "$n  (";
2430  
-		foreach ($assessments as $assessment) {
2431  
-			if ($assessment->timegraded) {
2432  
-				$gradingscaled = intval($assessment->gradinggrade * $workshop->grade / COMMENTSCALE);
2433  
-				$str .= "<A HREF=\"assessments.php?action=viewassessment&a=$workshop->id&aid=$assessment->id\">";
2434  
-				$str .= "$gradingscaled</A> ";
2435  
-				}
2436  
-			else {
2437  
-				$str .= "<A HREF=\"assessments.php?action=viewassessment&a=$workshop->id&aid=$assessment->id\">";
2438  
-				$str .= "-</A> ";
  2536
+	global $CFG, $THEME;
  2537
+	
  2538
+    if (isset($tabs->names)) {
  2539
+        foreach ($tabs->names as $key => $name) {
  2540
+            if (!empty($tabs->urls[$key])) {
  2541
+				$url =$tabs->urls[$key];
  2542
+				if ($tabs->highlight == $key) {
  2543
+					$tabcontents[$key] = "<b>$name</b>";
  2544
+				} else {
  2545
+					$tabcontents[$key] = "<a class= \"dimmed\" href=\"$url\"><b>$name</b></a>";
2439 2546
 				}
  2547
+            } else {
  2548
+                $tabcontents[$key] = "<b>$name</b>";
  2549
+            }
  2550
+        }
  2551
+    }
  2552
+
  2553
+    if (empty($tabs->width)) {
  2554
+        $tabs->width = "80%";
  2555
+    }
  2556
+
  2557
+    if (empty($tabs->cellpadding)) {
  2558
+        $tabs->cellpadding = "5";
  2559
+    }
  2560
+
  2561
+    // print_simple_box_start("center", "$table->width", "#ffffff", 0);
  2562
+    echo "<table width=\"$tabs-width\" border=\"0\" valign=\"top\" align=\"center\" ";
  2563
+    echo " cellpadding=\"$tabs->cellpadding\" cellspacing=\"0\" class=\"generaltable\">\n";
  2564
+
  2565
+    if (!empty($tabs->names)) {
  2566
+        echo "<tr>";
  2567
+		echo "<td  class=\"generaltablecell\">".
  2568
+			"<img width=\"10\" src=\"$CFG->wwwroot/pix/spacer.gif\" alt=\"\"></td>\n";
  2569
+        foreach ($tabcontents as $key => $tab) {
  2570
+            if (isset($align[$key])) {
  2571
+				$alignment = "align=\"$align[$key]\"";
  2572
+			} else {
  2573
+                $alignment = "align=\"center\"";
  2574
+            }
  2575
+            if (isset($size[$key])) {
  2576
+                $width = "width=\"$size[$key]\"";
  2577
+            } else {
  2578
+				$width = "";
2440 2579
 			}
2441  
-		$str .= ")";
2442  
-		}
2443  
-	else {
2444  
-		$str ="0";
2445  
-		}
2446  
-    return $str;
  2580
+            if (isset($wrap[$key])) {
  2581
+				$wrapping = "no wrap";
  2582
+			} else {
  2583
+                $wrapping = "";
  2584
+            }
  2585
+			if ($key == $tabs->highlight) {
  2586
+				echo "<td valign=top $alignment $width $wrapping bgcolor=\"$THEME->cellheading2\">$tab</td>\n";
  2587
+			} else {
  2588
+				echo "<td valign=top $alignment $width $wrapping bgcolor=\"$THEME->body\">$tab</td>\n";
  2589
+			}
  2590
+		echo "<td  class=\"generaltablecell\">".
  2591
+			"<img width=\"10\" src=\"$CFG->wwwroot/pix/spacer.gif\" alt=\"\"></td>\n";
  2592
+        }
  2593
+        echo "</tr>\n";
  2594
+    } else {
  2595
+		echo "<tr><td>No names specified</td></tr>\n";
2447 2596
 	}
  2597
+	// bottom stripe
  2598
+	$ncells = count($tabs->names)*2 +1;
  2599
+	$height = 2;
  2600
+	echo "<tr><td colspan=\"$ncells\" bgcolor=\"$THEME->cellheading2\">".
  2601
+		"<img height=\"$height\" src=\"$CFG->wwwroot/pix/spacer.gif\" alt=\"\"></td></tr>\n";
  2602
+    echo "</table>\n";
  2603
+	// print_simple_box_end();
2448 2604
 
  2605
+    return true;
  2606
+}
2449 2607
 
2450 2608
 function workshop_print_time_to_deadline($time) {
2451 2609
     if ($time < 0) {
@@ -2472,6 +2630,33 @@ function workshop_print_upload_form($workshop) {
2472 2630
     echo "</DIV>";
2473 2631
 }
2474 2632
 
  2633
+
  2634
+function workshop_print_user_assessments($workshop, $user) {
  2635
+	// Returns the number of assessments and a hyperlinked list of grading grades for the assessments made by this user
  2636
+
  2637
+	if ($assessments = workshop_get_user_assessments($workshop, $user)) {
  2638
+		$n = count($assessments);
  2639
+		$str = "$n  (";
  2640
+		foreach ($assessments as $assessment) {
  2641
+			if ($assessment->timegraded) {
  2642
+				$gradingscaled = intval($assessment->gradinggrade * $workshop->grade / COMMENTSCALE);
  2643
+				$str .= "<A HREF=\"assessments.php?action=viewassessment&a=$workshop->id&aid=$assessment->id\">";
  2644
+				$str .= "$gradingscaled</A> ";
  2645
+				}
  2646
+			else {
  2647
+				$str .= "<A HREF=\"assessments.php?action=viewassessment&a=$workshop->id&aid=$assessment->id\">";
  2648
+				$str .= "-</A> ";
  2649
+				}
  2650
+			}
  2651
+		$str .= ")";
  2652
+		}
  2653
+	else {
  2654
+		$str ="0";
  2655
+		}
  2656
+    return $str;
  2657
+	}
  2658
+
  2659
+
2475 2660
 function workshop_test_user_assessments($workshop, $user) {
2476 2661
 	// see if user has passed the required number of assessments of teachers submissions
2477 2662
 	global $CFG;
51  mod/workshop/submissions.php
@@ -13,6 +13,8 @@
13 13
 	listallsubmissions
14 14
 	listforassessmentstudent
15 15
 	listforassessmentteacher
  16
+	userconfirmdelete
  17
+	userdelete
16 18
 	
17 19
 
18 20
 ************************************************/
@@ -72,7 +74,7 @@
72 74
 		}
73 75
 
74 76
 
75  
-	/******************* admin confirm delete ************************************/
  77
+	/******************* admin amend title ************************************/
76 78
 	if ($action == 'adminamendtitle' ) {
77 79
 
78 80
 		if (!isteacher($course->id)) {
@@ -115,7 +117,7 @@
115 117
 			error("Admin confirm delete: submission id missing");
116 118
 			}
117 119
 			
118  
-		notice_yesno(get_string("confirmdeletionofthisitem","workshop"), 
  120
+		notice_yesno(get_string("confirmdeletionofthisitem","workshop", get_string("submission", "workshop")), 
119 121
 			 "submissions.php?action=admindelete&id=$cm->id&sid=$_GET[sid]", "submissions.php?id=$cm->id&action=adminlist");
120 122
 		}
121 123
 	
@@ -161,7 +163,7 @@
161 163
 			error("Only teachers can look at this page");
162 164
 			}
163 165
 		if (empty($_GET['order'])) {
164  
-			$order = "title";
  166
+			$order = "name";
165 167
 			}
166 168
 		else {
167 169
 			$order = $_GET['order'];
@@ -867,6 +869,49 @@
867 869
 		}
868 870
 	
869 871
 
  872
+	/******************* user confirm delete ************************************/
  873
+	elseif ($action == 'userconfirmdelete' ) {
  874
+
  875
+		if (empty($_GET['sid'])) {
  876
+			error("User Confirm Delete: submission id missing");
  877
+			}
  878
+			
  879
+		notice_yesno(get_string("confirmdeletionofthisitem","workshop", get_string("submission", "workshop")), 
  880
+			 "submissions.php?action=userdelete&id=$cm->id&sid=$_GET[sid]", "view.php?id=$cm->id");
  881
+		}
  882
+	
  883
+
  884
+	/******************* user delete ************************************/
  885
+	elseif ($action == 'userdelete' ) {
  886
+
  887
+		if (empty($_GET['sid'])) {
  888
+			error("User Delete: submission id missing");
  889
+			}
  890
+	
  891
+		if (!$submission = get_record("workshop_submissions", "id", $_GET['sid'])) {
  892
+			error("User Delete: can not get submission record");
  893
+			}
  894
+		print_string("deleting", "workshop");
  895
+		// first get any assessments...
  896
+		if ($assessments = workshop_get_assessments($submission)) {
  897
+			foreach($assessments as $assessment) {
  898
+				// ...and all the associated records...
  899
+				delete_records("workshop_comments", "assessmentid", $assessment->id);
  900
+				delete_records("workshop_grades", "assessmentid", $assessment->id);
  901
+				echo ".";
  902
+				}
  903
+			// ...now delete the assessments...
  904
+			delete_records("workshop_assessments", "submissionid", $submission->id);
  905
+			}
  906
+		// ...and the submission record...
  907
+		delete_records("workshop_submissions", "id", $submission->id);
  908
+		// ..and finally the submitted file
  909
+		workshop_delete_submitted_files($workshop, $submission);
  910
+		
  911
+		print_continue("view.php?id=$cm->id");
  912
+		}
  913
+	
  914
+
870 915
 	/*************** no man's land **************************************/
871 916
 	else {
872 917
 		error("Fatal Error: Unknown Action: ".$action."\n");
12  mod/workshop/todo.txt
@@ -11,15 +11,17 @@ Comments are seen by a third party, is this standard Moodle behaviour?
11 11
 Cron function should email something to the assessor when an assessment is
12 12
 	agreed.
13 13
 	
14  
-Self assessments may need special handling, remove duplication in student 
15  
-	view
  14
+Add a league table of submissions in the final phase for students.
16 15
 
17  
-Add student names to assessments and submissions for teachers.
  16
+---
18 17
 
19  
-Add a league table of submissions in the final phase for students.
  18
+Self assessments may need special handling, remove duplication in student 
  19
+	view - Done
  20
+
  21
+Add student names to assessments and submissions for teachers - Done
20 22
 
21 23
 
22 24
 Ray Kingdon
23  
-17 June 2003
  25
+28 July 2003
24 26
 
25 27
 
159  mod/workshop/view.php
@@ -5,7 +5,6 @@
5 5
 
6 6
 	close workshop( for teachers)
7 7
 	displayfinalgrade (for students)
8  
-	makefinalgradesunavailable (for teachers)
9 8
 	notavailable (for students)
10 9
 	open workshop (for teachers)
11 10
 	setupassignment (for teachers)
@@ -101,15 +100,9 @@
101 100
 			error("Only teachers can look at this page");
102 101
 			}
103 102
 
104  
-		// move phase along
105  
-		if ($workshop->phase == 2) { // force phase to open workshop
106  
-			set_field("workshop", "phase", 3, "id", "$workshop->id");
107  
-			echo "<CENTER><B>".get_string("movedtophase", "workshop", 3)."</B></CENTER>\n";
108  
-			add_to_log($course->id, "workshop", "close", "view.php?a=$workshop->id", "$workshop->id");
109  
-			}
110  
-			
111  
-		print_continue("view.php?a=$workshop->id");
112  
-
  103
+		// move tp phase 3
  104
+		set_field("workshop", "phase", 3, "id", "$workshop->id");
  105
+		redirect("view.php?a=$workshop->id", get_string("movingtophase", "workshop", 3));
113 106
 		}
114 107
 	
115 108
 
@@ -235,37 +228,12 @@
235 228
 			error("Only teachers can look at this page");
236 229
 			}
237 230
 
238  
-		if ($workshop->phase == 3) { // is this at the expected phase?
239  
-			set_field("workshop", "phase", 4, "id", "$workshop->id");
240  
-			echo "<CENTER><B>".get_string("movedtophase", "workshop", 4)."</B></CENTER>\n";
241  
-			}
242  
-		else {
243  
-			echo "<CENTER><B>".get_string("assignmentnotinthecorrectphase", "workshop")."</B></CENTER>\n";
244  
-			}
245  
-		print_continue("view.php?a=$workshop->id");
  231
+		set_field("workshop", "phase", 4, "id", "$workshop->id");
  232
+		redirect("view.php?a=$workshop->id", get_string("movingtophase", "workshop", 4));
246 233
 		add_to_log($course->id, "workshop", "display grades", "view.php?a=$workshop->id", "$workshop->id");
247 234
 		}
248 235
 	
249 236
 	
250  
-	/*********************** make final grades unavailable (for teachers only)**************/
251  
-	elseif ($action == 'makefinalgradesunavailable') {
252  
-
253  
-		if (!isteacher($course->id)) {
254  
-			error("Only teachers can look at this page");
255  
-			}
256  
-
257  
-		if ($workshop->phase == 4) { // is this at the expected phase?
258  
-			set_field("workshop", "phase", 3, "id", "$workshop->id");
259  
-			echo "<CENTER><B>".get_string("movedtophase", "workshop", 3)."</B></CENTER>\n";
260  
-			}
261  
-		else {
262  
-			echo "<CENTER><B>".get_string("assignmentnotinthecorrectphase", "workshop")."</B></CENTER>\n";
263  
-			}
264  
-		print_continue("view.php?a=$workshop->id");
265  
-		add_to_log($course->id, "workshop", "hide grades", "view.php?a=$workshop->id", "$workshop->id");
266  
-		}
267  
-	
268  
-	
269 237
 	/*********************** assignment not available (for students)***********************/
270 238
 	elseif ($action == 'notavailable') {
271 239
 		echo "<p><center>".get_string("notavailable", "workshop")."</center>\n";
@@ -279,14 +247,9 @@
279 247
 			error("Only teachers can look at this page");
280 248
 			}
281 249
 
282  
-		// move phase along
283  
-		if (!($workshop->phase == 2)) { // force phase to open workshop
284  
-			set_field("workshop", "phase", 2, "id", "$workshop->id");
285  
-			echo "<CENTER><B>".get_string("movedtophase", "workshop", 2)."</B></CENTER>\n";
286  
-			}
287  
-			
288  
-		print_continue("view.php?id=$cm->id");
289  
-
  250
+		// move to phase 2
  251
+		set_field("workshop", "phase", 2, "id", "$workshop->id");
  252
+		redirect("view.php?id=$cm->id", get_string("movingtophase", "workshop", 2));
290 253
 		add_to_log($course->id, "workshop", "open", "view.php?a=$workshop->id", "$workshop->id");
291 254
 		}
292 255
 
@@ -298,14 +261,8 @@
298 261
 			error("Only teachers can look at this page");
299 262
 			}
300 263
 
301  
-		if ($workshop->phase == 2) { // phase must be correct
302  
-			set_field("workshop", "phase", 1, "id", "$workshop->id");
303  
-			echo "<CENTER><B>".get_string("movedtophase", "workshop", 1)."</B></CENTER>\n";
304  
-			}
305  
-		else {
306  
-			echo "<CENTER><B>".get_string("assignmentnotinthecorrectphase", "workshop")."</B></CENTER>\n";
307  
-			}
308  
-		print_continue("view.php?a=$workshop->id");
  264
+		set_field("workshop", "phase", 1, "id", "$workshop->id");
  265
+		redirect("view.php?a=$workshop->id", get_string("movingtophase", "workshop", 1));
309 266
 		}
310 267
 	
311 268
 	
@@ -354,17 +311,24 @@
354 311
 					print_heading(get_string("assessmentsby", "workshop", $course->teachers));
355 312
 					workshop_list_teacher_assessments($workshop, $USER);
356 313
 					}
  314
+				// is self assessment used in this workshop?
  315
+				if ($workshop->includeself) {
  316
+					// prints a table if there are any submissions which have not been self assessed yet
  317
+					workshop_list_self_assessments($workshop, $USER);
  318
+					}
357 319
 				// if student assessments show any to assess...
358 320
 				if ($workshop->nsassessments) { // if there are student assessments display them... 
359 321
 					workshop_list_student_submissions($workshop, $USER);
360  
-					// ..and any they have already done...
  322
+					}
  323
+				// ..and any they have already done...
  324
+				if (workshop_count_user_assessments($workshop, $USER, "student")) {
361 325
 					print_heading(get_string("yourassessments", "workshop"));
362 326
 					workshop_list_assessed_submissions($workshop, $USER);
363  
-					// ... and show peer assessments
364  
-					if (workshop_count_peer_assessments($workshop, $USER)) {
365  
-						print_heading(get_string("assessmentsby", "workshop", $course->students));
366  
-						workshop_list_peer_assessments($workshop, $USER);
367  
-						}
  327
+				}
  328
+				// ... and show peer assessments
  329
+				if (workshop_count_peer_assessments($workshop, $USER)) {
  330
+					print_heading(get_string("assessmentsby", "workshop", $course->students));
  331
+					workshop_list_peer_assessments($workshop, $USER);
368 332
 					}
369 333
 				// list previous submissions
370 334
 				print_heading(get_string("submissions", "workshop"));
@@ -376,8 +340,9 @@
376 340
 					workshop_print_upload_form($workshop);
377 341
 					echo "<HR SIZE=1 NOSHADE>";
378 342
 					}
379  
-				print_heading("<A HREF=\"submissions.php?action=listallsubmissions&id=$cm->id\">".
380  
-					get_string("listofallsubmissions", "workshop"));
  343
+				// allow user to list their submissions and assessments in a general way????
  344
+				// print_heading("<A HREF=\"submissions.php?action=listallsubmissions&id=$cm->id\">".
  345
+				// 	get_string("listofallsubmissions", "workshop"));
381 346
 				}
382 347
 			}
383 348
 		}
@@ -432,63 +397,53 @@
432 397
 			}
433 398
 
434 399
 		print_heading_with_help(get_string("managingassignment", "workshop"), "managing", "workshop");
  400
+		$tabs->names = array("1. ".get_string("phase1", "workshop"), "2. ".get_string("phase2", "workshop"), 
  401
+			"3. ".get_string("phase3", "workshop"), "4. ".get_string("phase4", "workshop"));
  402
+		$tabs->urls = array("view.php?id=$cm->id&action=setupassignment", 
  403
+			"view.php?id=$cm->id&action=openworkshop",
  404
+			"view.php?id=$cm->id&action=closeworkshop",
  405
+			"view.php?id=$cm->id&action=makefinalgradesavailable");
  406
+		$tabs->highlight = $workshop->phase - 1;
  407
+		workshop_print_tabbed_heading($tabs);
435 408
 		echo "<CENTER><P>\n";
436 409
 			switch ($workshop->phase) {
437 410
 				case 0:
438 411
 				case 1: // set up assignment
439  
-					echo "<B><U>".get_string("phase1", "workshop")."</U></B>";
440  
-					echo "<P><B><A HREF=\"assessments.php?id=$cm->id&action=editelements\">".
441  
-						  get_string("amendassessmentelements", "workshop")."</A></B></P>";
442  
-					echo "<P><B><A HREF=\"view.php?id=$cm->id&action=submitassignment\">".
443  
-						get_string("submitexampleassignment", "workshop")."</A></B>";
444  
-					echo "<P><B><A HREF=\"submissions.php?id=$cm->id&action=listforassessmentteacher\">".
  412
+					print_heading("<A HREF=\"assessments.php?id=$cm->id&action=editelements\">".
  413
+						  get_string("amendassessmentelements", "workshop")."</A>");
  414
+					print_heading("<A HREF=\"view.php?id=$cm->id&action=submitassignment\">".
  415
+						get_string("submitexampleassignment", "workshop")."</A>");
  416
+					print_heading("<A HREF=\"submissions.php?id=$cm->id&action=listforassessmentteacher\">".
445 417
 						  get_string("teachersubmissionsforassessment", "workshop", 
446 418
 							  workshop_count_teacher_submissions_for_assessment($workshop, $USER)).
447  
-						  "</A></B></P>\n";
448  
-					echo "<P><B><A HREF=\"view.php?id=$cm->id&action=openworkshop\">".
449  
-						  get_string("moveonto", "workshop")." ".get_string("phase2", "workshop", $course->student)."</A></B></P>";
  419
+						  "</A>");
450 420
 					break;
451 421
 					
452 422
 				case 2: // submissions and assessments
453  
-					echo "<B><U>".get_string("phase2", "workshop", $course->student)."</U></B>";
454  
-					echo "<P><B><A HREF=\"assessments.php?id=$cm->id&action=listungradedteachersubmissions\">".
455  
-						  get_string("ungradedassessmentsofteachersubmissions", "workshop", workshop_count_ungraded_assessments_teacher($workshop))."</A></B>\n";
456  
-					echo "<P><B><A HREF=\"assessments.php?id=$cm->id&action=listungradedstudentsubmissions\">".
457  
-						  get_string("ungradedassessmentsofstudentsubmissions", "workshop", workshop_count_ungraded_assessments_student($workshop))."</A></B>\n";
458  
-					echo "<P><B><A HREF=\"submissions.php?id=$cm->id&action=listforassessmentstudent\">".
459  
-						  get_string("studentsubmissionsforassessment", "workshop", workshop_count_student_submissions_for_assessment($workshop, $USER)).
460  
-						  "</A></B>\n";
461  
-					echo "<P><B><A HREF=\"view.php?id=$cm->id&action=closeworkshop\">".
462  
-						  get_string("moveonto", "workshop")." ".get_string("phase3", "workshop")."</A></B></P>";
463  
-					echo "<P><FONT SIZE=1>[".get_string("deadlineis", "workshop", userdate($workshop->deadline))."]</FONT></P>\n";
464  
-					echo "<P><B><A HREF=\"view.php?id=$cm->id&action=setupassignment\">(".
465  
-						get_string("returnto", "workshop")." ".get_string("phase1", "workshop").")</A></B></P>";
  423
+					print_heading("<A HREF=\"assessments.php?id=$cm->id&action=listungradedteachersubmissions\">".
  424
+						  get_string("ungradedassessmentsofteachersubmissions", "workshop", workshop_count_ungraded_assessments_teacher($workshop))."</A>");
  425
+					print_heading("<A HREF=\"assessments.php?id=$cm->id&action=listungradedstudentsubmissions\">".
  426
+						  get_string("ungradedassessmentsofstudentsubmissions", "workshop", workshop_count_ungraded_assessments_student($workshop))."</A>");
  427
+					print_heading("<A HREF=\"submissions.php?id=$cm->id&action=listforassessmentstudent\">".
  428
+						  get_string("studentsubmissionsforassessment", "workshop", workshop_count_student_submissions_for_assessment($workshop, $USER))."</A>");
466 429
 					break;
467 430
 					
468 431
 				case 3: // calculate final grades
469  
-					echo "<B><U>".get_string("phase3", "workshop")."</U></B>";
470  
-					echo "<P><B><A HREF=\"assessments.php?id=$cm->id&action=listungradedstudentsubmissions\">".
471  
-						  get_string("ungradedassessmentsofstudentsubmissions", "workshop", workshop_count_ungraded_assessments_student($workshop))."</A></B>\n";
472  
-					echo "<P><B><A HREF=\"submissions.php?id=$cm->id&action=listforassessmentstudent\">".
473  
-						  get_string("studentsubmissionsforassessment", "workshop", workshop_count_student_submissions_for_assessment($workshop, $USER)).
474  
-						  "</A></B>\n";
475  
-					echo "<P><B><A HREF=\"submissions.php?id=$cm->id&action=displayfinalweights\">".
476  
-						  get_string("calculationoffinalgrades", "workshop")."</A></B></P>";
477  
-					echo "<P><B><A HREF=\"view.php?id=$cm->id&action=makefinalgradesavailable\">".
478  
-						  get_string("moveonto", "workshop")." ".get_string("phase4", "workshop")."</A></B></P>";
479  
-					echo "<P><B><A HREF=\"view.php?id=$cm->id&action=openworkshop\">(".
480  
-						  get_string("returnto", "workshop")." ".get_string("phase2", "workshop", $course->student).")</A></B></P>";
  432
+					print_heading("<A HREF=\"assessments.php?id=$cm->id&action=listungradedstudentsubmissions\">".
  433
+						  get_string("ungradedassessmentsofstudentsubmissions", "workshop", workshop_count_ungraded_assessments_student($workshop))."</A>");
  434
+					print_heading("<A HREF=\"submissions.php?id=$cm->id&action=listforassessmentstudent\">".
  435
+						  get_string("studentsubmissionsforassessment", "workshop", workshop_count_student_submissions_for_assessment($workshop, $USER))."</A>");
  436
+					print_heading("<A HREF=\"submissions.php?id=$cm->id&action=displayfinalweights\">".
  437
+						  get_string("calculationoffinalgrades", "workshop")."</A>");
481 438
 					break;
482 439
 					
483 440
 				case 4: // show final grades
484  
-					echo "<B><U>".get_string("phase4", "workshop")."</U></B>";
485  
-					echo "<P><B><A HREF=\"submissions.php?id=$cm->id&action=displayfinalgrades\">".
486  
-						  get_string("displayoffinalgrades", "workshop")."</A></B></P>";
487  
-					echo "<P><B><A HREF=\"view.php?id=$cm->id&action=makefinalgradesunavailable\">(".
488  
-						  get_string("returnto", "workshop")." ".get_string("phase3", "workshop").")</A></B></P>";
  441
+					print_heading("<A HREF=\"submissions.php?id=$cm->id&action=displayfinalgrades\">".
  442
+						  get_string("displayoffinalgrades", "workshop")."</A>");
489 443
 			}
490  
-					echo "<P><B><A HREF=\"submissions.php?id=$cm->id&action=adminlist\">".
491  
-						get_string("listofallsubmissions", "workshop")."</A></B></P>\n";
  444
+					echo "<P><FONT SIZE=1>[".get_string("deadlineis", "workshop", userdate($workshop->deadline))."]</FONT></P>\n";
  445
+					print_heading("<A HREF=\"submissions.php?id=$cm->id&action=adminlist\">".
  446
+						get_string("administration")."</A>");
492 447
 		}
493 448
 	
494 449
 	

0 notes on commit 0e29a0b

Please sign in to comment.
Something went wrong with that request. Please try again.