Permalink
Browse files

Version 2004111000 of workshop.

  • Loading branch information...
1 parent 647da47 commit 9a21768212b2d806ec2e8464febf2eef0a30969a rkingdon committed Nov 12, 2004

Large diffs are not rendered by default.

Oops, something went wrong.
View
@@ -66,6 +66,7 @@ function workshop_backup_mods($bf,$preferences) {
fwrite ($bf,full_tag("INCLUDESELF",4,false,$workshop->includeself));
fwrite ($bf,full_tag("MAXBYTES",4,false,$workshop->maxbytes));
fwrite ($bf,full_tag("DEADLINE",4,false,$workshop->deadline));
+ fwrite ($bf,full_tag("RELEASEGRADES",4,false,$workshop->releasegrades));
fwrite ($bf,full_tag("GRADE",4,false,$workshop->grade));
fwrite ($bf,full_tag("GRADINGGRADE",4,false,$workshop->gradinggrade));
fwrite ($bf,full_tag("NTASSESSMENTS",4,false,$workshop->ntassessments));
@@ -118,8 +119,12 @@ function backup_workshop_elements ($bf,$preferences,$workshop) {
fwrite ($bf,full_tag("SCALE",6,false,$wor_ele->scale));
fwrite ($bf,full_tag("MAXSCORE",6,false,$wor_ele->maxscore));
fwrite ($bf,full_tag("WEIGHT",6,false,$wor_ele->weight));
+ fwrite ($bf,full_tag("STDDEV",6,false,$wor_ele->stddev));
+ fwrite ($bf,full_tag("TOTALASSESSMENTS",6,false,$wor_ele->totalassessments));
//Now we backup workshop rubrics
$status = backup_workshop_rubrics($bf,$preferences,$workshop,$wor_ele->elementno);
+ //Now we backup element's stock comments
+ $status = backup_workshop_stockcomments($bf,$preferences,$workshop,$wor_ele->elementno);
//End element
$status =fwrite ($bf,end_tag("ELEMENT",5,true));
}
@@ -160,6 +165,36 @@ function backup_workshop_rubrics ($bf,$preferences,$workshop,$elementno) {
return $status;
}
+ //Backup workshop_stockcomments contents (executed from backup_workshop_elements)
+ function backup_workshop_stockcomments ($bf,$preferences,$workshop,$elementid) {
+
+ global $CFG;
+
+ $status = true;
+
+ $workshop_stockcomments = get_records_sql("SELECT * from {$CFG->prefix}workshop_stockcomments c
+ WHERE c.workshopid = '$workshop' and c.elementno = '$elementno'
+ ORDER BY c.id");
+
+ //If there is workshop_stockcomments
+ if ($workshop_stockcomments) {
+ //Write start tag
+ $status =fwrite ($bf,start_tag("STOCKCOMMENTS",8,true));
+ //Iterate over each comment
+ foreach ($workshop_stockcomments as $wor_com) {
+ //Start comment
+ $status =fwrite ($bf,start_tag("STOCKCOMMENT",9,true));
+ //Print comment contents
+ fwrite ($bf,full_tag("COMMENT_TEXT",10,false,$wor_com->comments));
+ //End comment
+ $status =fwrite ($bf,end_tag("STOCKCOMMENT",9,true));
+ }
+ //Write end tag
+ $status =fwrite ($bf,end_tag("STOCKCOMMENTS",8,true));
+ }
+ return $status;
+ }
+
//Backup workshop_submissions contents (executed from workshop_backup_mods)
function backup_workshop_submissions ($bf,$preferences,$workshop) {
@@ -183,13 +218,10 @@ function backup_workshop_submissions ($bf,$preferences,$workshop) {
fwrite ($bf,full_tag("TIMECREATED",6,false,$wor_sub->timecreated));
fwrite ($bf,full_tag("MAILED",6,false,$wor_sub->mailed));
fwrite ($bf,full_tag("DESCRIPTION",6,false,$wor_sub->description));
- fwrite ($bf,full_tag("TEACHERGRADE",6,false,$wor_sub->teachergrade));
- fwrite ($bf,full_tag("PEERGRADE",6,false,$wor_sub->peergrade));
- fwrite ($bf,full_tag("BIASGRADE",6,false,$wor_sub->biasgrade));
- fwrite ($bf,full_tag("RELIABILITYGRADE",6,false,$wor_sub->reliabilitygrade));
fwrite ($bf,full_tag("GRADINGGRADE",6,false,$wor_sub->gradinggrade));
fwrite ($bf,full_tag("FINALGRADE",6,false,$wor_sub->finalgrade));
fwrite ($bf,full_tag("LATE",6,false,$wor_sub->late));
+ fwrite ($bf,full_tag("NASSESSMENTS",6,false,$wor_sub->nassessments));
//Now we backup workshop assessments
$status = backup_workshop_assessments($bf,$preferences,$workshop,$wor_sub->id);
//End submission
View
@@ -119,6 +119,29 @@ function workshop_upgrade($oldversion) {
}
}
+ if ($oldversion < 2004102800) {
+ table_column("workshop", "", "releasegrades", "INTEGER", "10", "UNSIGNED", "0", "NOT NULL", "deadline");
+ execute_sql("
+ CREATE TABLE `{$CFG->prefix}workshop_stockcomments` (
+ `id` int(10) unsigned NOT NULL auto_increment,
+ `workshopid` int(10) unsigned NOT NULL default '0',
+ `elementno` int(10) unsigned NOT NULL default '0',
+ `comments` text NOT NULL,
+ PRIMARY KEY (`id`)
+ ) COMMENT='Defines stockcomments, the teacher comment bank'
+ ");
+ }
+
+ if ($oldversion < 2004111000) {
+ table_column("workshop_elements", "", "stddev", "FLOAT", "", "", "0", "NOT NULL");
+ table_column("workshop_elements", "", "totalassessments", "INTEGER", "10", "", "0", "NOT NULL");
+ execute_sql(" ALTER TABLE `{$CFG->prefix}workshop_elements` CHANGE `weight` `weight` INT(4) UNSIGNED NOT NULL DEFAULT '11'");
+ table_column("workshop_submissions", "", "nassessments", "INTEGER", "10", "", "0", "NOT NULL");
+ execute_sql("ALTER TABLE `{$CFG->prefix}workshop_submissions` DROP COLUMN `teachergrade`");
+ execute_sql("ALTER TABLE `{$CFG->prefix}workshop_submissions` DROP COLUMN `peergrade`");
+ execute_sql("ALTER TABLE `{$CFG->prefix}workshop_submissions` DROP COLUMN `biasgrade`");
+ execute_sql("ALTER TABLE `{$CFG->prefix}workshop_submissions` DROP COLUMN `reliabilitygrade`");
+ }
return true;
}
View
@@ -20,6 +20,7 @@ CREATE TABLE `prefix_workshop` (
`includeself` tinyint(2) unsigned NOT NULL default '0',
`maxbytes` int(10) unsigned NOT NULL default '100000',
`deadline` int(10) unsigned NOT NULL default '0',
+ `releasegrades` int(10) unsigned NOT NULL default '0',
`grade` tinyint(3) NOT NULL default '0',
`gradinggrade` tinyint(3) NOT NULL default '0',
`ntassessments` tinyint(3) unsigned NOT NULL default '0',
@@ -47,13 +48,10 @@ CREATE TABLE `prefix_workshop_submissions` (
`timecreated` int(10) unsigned NOT NULL default '0',
`mailed` tinyint(2) unsigned NOT NULL default '0',
`description` text NOT NULL,
- `teachergrade` int(3) unsigned NOT NULL default '0',
- `peergrade` int(3) unsigned NOT NULL default '0',
- `biasgrade` int(3) unsigned NOT NULL default '0',
- `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',
+ `nassessments` int(10) unsigned NOT NULL default '0',
PRIMARY KEY (`id`),
INDEX `userid` (`userid`)
) COMMENT='Info about submitted work from teacher and students';
@@ -95,7 +93,9 @@ CREATE TABLE `prefix_workshop_elements` (
`description` text NOT NULL,
`scale` tinyint(3) unsigned NOT NULL default '0',
`maxscore` tinyint(3) unsigned NOT NULL default '1',
- `weight` float NOT NULL default '1.0',
+ `weight` tinyint(3) unsigned NOT NULL default '11',
+ `stddev` float NOT NULL default '0.0',
+ `totalassessments` int(10) NOT NULL default '0',
PRIMARY KEY (`id`)
) COMMENT='Info about marking scheme of assignment';
# --------------------------------------------------------
@@ -131,6 +131,20 @@ CREATE TABLE `prefix_workshop_grades` (
) COMMENT='Info about individual grades given to each element';
# --------------------------------------------------------
+
+#
+# Table structure for table `workshop_stockcomments`
+#
+
+CREATE TABLE `prefix_workshop_stockcomments` (
+ `id` int(10) unsigned NOT NULL auto_increment,
+ `workshopid` int(10) unsigned NOT NULL default '0',
+ `elementno` int(10) unsigned NOT NULL default '0',
+ `comments` text NOT NULL default '',
+ PRIMARY KEY (`id`),
+) COMMENT='Info about the teacher comment bank';
+# --------------------------------------------------------
+
#
# Table structure for table `workshop_comments`
#
View
@@ -47,19 +47,27 @@
}
foreach ($workshops as $workshop) {
- switch ($workshop->phase) {
- case 0:
- case 1: $info = get_string("phase1short", "workshop");
- break;
- case 2: $info = get_string("phase2short", "workshop");
- break;
- case 3: $info = get_string("phase3short", "workshop");
- break;
- case 4: $info = get_string("phase4short", "workshop");
- break;
- case 5: $info = get_string("phase5short", "workshop");
- break;
+ if (isteacher($course->id, $USER->id)) { // teacher see info (students see grade)
+ switch ($workshop->phase) {
+ case 0:
+ case 1: $info = get_string("phase1short", "workshop");
+ break;
+ case 2: $info = get_string("phase2short", "workshop");
+ break;
+ case 3: $info = get_string("phase3short", "workshop");
+ break;
+ case 4: $info = get_string("phase4short", "workshop");
+ break;
+ case 5: $info = get_string("phase5short", "workshop");
+ break;
+ }
+ if ($workshop->phase > 1) {
+ if ($num = workshop_count_student_submissions_for_assessment($workshop, $USER)) {
+ $info .= " [".get_string("unassessed", "workshop", $num)."]";
+ }
+ }
}
+
if ($submissions = workshop_get_user_submissions($workshop, $USER)) {
foreach ($submissions as $submission) {
if ($submission->timecreated <= $workshop->deadline) {
Oops, something went wrong.

0 comments on commit 9a21768

Please sign in to comment.