Permalink
Browse files

Minor errors fixed; Student can delete submissions and assessments;

Teachers see student names; Tabbed Admin screen.
  • Loading branch information...
1 parent db7def8 commit 0e29a0b1d8568afe58c60ee8a396de3d5ed639e9 rkingdon committed Jul 28, 2003
Showing with 419 additions and 182 deletions.
  1. +52 −2 mod/workshop/assessments.php
  2. +255 −70 mod/workshop/lib.php
  3. +48 −3 mod/workshop/submissions.php
  4. +7 −5 mod/workshop/todo.txt
  5. +57 −102 mod/workshop/view.php
@@ -5,6 +5,8 @@
ACTIONS handled are:
addcomment
+ adminconfirmdelete
+ admindelete
adminlist
agreeassessment
assesssubmission
@@ -20,6 +22,8 @@
updateassessment
updatecomment
updategrading
+ userconfirmdelete
+ userdelete
viewassessment
************************************************/
@@ -121,7 +125,7 @@
error("Admin confirm delete: assessment id missing");
}
- notice_yesno(get_string("confirmdeletionofthisitem","workshop"),
+ notice_yesno(get_string("confirmdeletionofthisitem","workshop", get_string("assessment", "workshop")),
"assessments.php?action=admindelete&id=$cm->id&aid=$_GET[aid]", "submissions.php?action=adminlist&id=$cm->id");
}
@@ -147,7 +151,7 @@
}
- /*********************** admin list of asssessments (by teachers)***********************/
+ /*********************** admin list of asssessments (of a submission) (by teachers)**************/
elseif ($action == 'adminlist') {
if (!isteacher($course->id)) {
@@ -163,6 +167,22 @@
}
+ /*********************** admin list of asssessments by a student (used by teachers only )******************/
+ elseif ($action == 'adminlistbystudent') {
+
+ if (!isteacher($course->id)) {
+ error("Only teachers can look at this page");
+ }
+
+ if (empty($_GET['userid'])) {
+ error ("Workshop asssessments: adminlistbystudent called with no userid");
+ }
+ $user = get_record("user", "id", $_GET['userid']);
+ workshop_print_assessments_by_user_for_admin($workshop, $user);
+ print_continue("submissions.php?action=adminlist&a=$workshop->id");
+ }
+
+
/*************** agree (to) assessment (by student) ***************************/
elseif ($action == 'agreeassessment') {
$timenow = time();
@@ -844,6 +864,36 @@
}
+ /******************* user confirm delete ************************************/
+ elseif ($action == 'userconfirmdelete' ) {
+
+ if (empty($_GET['aid'])) {
+ error("User confirm delete: assessment id missing");
+ }
+
+ notice_yesno(get_string("confirmdeletionofthisitem","workshop", get_string("assessment", "workshop")),
+ "assessments.php?action=userdelete&id=$cm->id&aid=$_GET[aid]", "view.php?id=$cm->id");
+ }
+
+
+ /******************* user delete ************************************/
+ elseif ($action == 'userdelete' ) {
+
+ if (empty($_GET['aid'])) {
+ error("User delete: assessment id missing");
+ }
+
+ print_string("deleting", "workshop");
+ // first delete all the associated records...
+ delete_records("workshop_comments", "assessmentid", $_GET['aid']);
+ delete_records("workshop_grades", "assessmentid", $_GET['aid']);
+ // ...now delete the assessment...
+ delete_records("workshop_assessments", "id", $_GET['aid']);
+
+ print_continue("view.php?id=$cm->id");
+ }
+
+
/*********************** view all assessments ***********************/
elseif ($action == 'viewallassessments') {
Oops, something went wrong.

0 comments on commit 0e29a0b

Please sign in to comment.