Permalink
Browse files

Split lib.php into locallib.php and lib.php;

Fixed bug # 1435;
Possibly fixed bug #1489
  • Loading branch information...
1 parent c2df1c2 commit dbda4a92ad53c6efdd09a417674eb0e5848a4b58 rkingdon committed Jun 18, 2004
Showing with 2,797 additions and 2,771 deletions.
  1. +11 −7 mod/workshop/assessments.php
  2. +2 −1 mod/workshop/index.php
  3. +51 −2,749 mod/workshop/lib.php
  4. +2,714 −0 mod/workshop/locallib.php
  5. +1 −0 mod/workshop/submissions.php
  6. +12 −11 mod/workshop/upload.php
  7. +6 −3 mod/workshop/view.php
@@ -28,7 +28,8 @@
************************************************/
require("../../config.php");
- require("lib.php");
+ require("lib.php");
+ require("locallib.php");
optional_variable($id); // Course Module ID
optional_variable($a); // workshop ID
@@ -235,7 +236,7 @@
// show assessment and allow changes
workshop_print_assessment($workshop, $assessment, true, $allowcomments, $_SERVER["HTTP_REFERER"]);
- }
+ }
/*************** display grading form (viewed by student) *********************************/
@@ -293,8 +294,8 @@
if (!isteacher($course->id)) {
error("Only teachers can look at this page");
}
-
- $count = count_records("workshop_grades", "workshop", $workshop->id);
+
+ $count = count_records("workshop_grades", "workshopid", $workshop->id);
if ($workshop->phase > 1 and $count) {
notify(get_string("warningonamendingelements", "workshop"));
}
@@ -712,14 +713,17 @@
}
// first get the assignment elements for maxscores and weights...
- if (!$elementsraw = get_records("workshop_elements", "workshopid", $workshop->id, "elementno ASC")) {
+ $elementsraw = get_records("workshop_elements", "workshopid", $workshop->id, "elementno ASC");
+ if (count($elementsraw) < $workshop->nelements) {
print_string("noteonassignmentelements", "workshop");
}
- else {
+ if ($elementsraw) {
foreach ($elementsraw as $element) {
$elements[] = $element; // to renumber index 0,1,2...
}
- }
+ } else {
+ $elements = null;
+ }
$timenow = time();
// don't fiddle about, delete all the old and add the new!
View
@@ -1,7 +1,8 @@
<?PHP // $Id$
require("../../config.php");
- require("lib.php");
+ require("lib.php");
+ require("locallib.php");
require_variable($id); // course
Oops, something went wrong.

0 comments on commit dbda4a9

Please sign in to comment.