From: moodler Date: Thu, 1 May 2003 13:16:58 +0000 (+0000) Subject: Workshop module from Ray Kingdon X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=d22d31c659ec2749872816bddc89d7f6481d4a61;p=moodle.git Workshop module from Ray Kingdon This version is still beta! --- diff --git a/lang/en/help/workshop/anonymous.html b/lang/en/help/workshop/anonymous.html new file mode 100644 index 0000000000..ea9028c821 --- /dev/null +++ b/lang/en/help/workshop/anonymous.html @@ -0,0 +1,14 @@ +

Anonymous Grading

+ +

A peer graded assignment can be graded anonymously. In this + case the names (and any photos) of the students doing the grading + are not shown. Only the (file) names of the submissions are used to identify + the peices of work being graded. + +

When the peer graded assignment is not graded anonymously, the + pieces of work are shown with the names (and any photos) of the + students who submitted the work. This may lead to bias in the gradings. + +

Note that if the teacher's grades are shown to the students these are + never shown anonymously. +

diff --git a/lang/en/help/workshop/assignmenttype.html b/lang/en/help/workshop/assignmenttype.html new file mode 100644 index 0000000000..92a4341793 --- /dev/null +++ b/lang/en/help/workshop/assignmenttype.html @@ -0,0 +1,21 @@ +

Peer Graded Assignment Type

+ +

A peer graded assignment can have one of two types: + +

    +
  1. Only feedback on the assessment elements and the general comment + is entered. The grading of assessment elements is not seen in the + grading pages. Assignments themselves are not given an overall grade. + However, the grading performance of the students is measured and + this, and only this measure contributes towards the final grades given + to the students. + +
  2. Here the teacher and peers are asked to provide both feedback and + grades. The assignments are given an overall quantative grade as well + as the qualative data. The final grade for a student will be calculated + from the (weighted) contributions of the teacher's grade, the mean + peers' grade and the student's grading performance. + +
+ +

diff --git a/lang/en/help/workshop/breakdownoffinalgrade.html b/lang/en/help/workshop/breakdownoffinalgrade.html new file mode 100644 index 0000000000..4c54fe8c6c --- /dev/null +++ b/lang/en/help/workshop/breakdownoffinalgrade.html @@ -0,0 +1,23 @@ +

The Breakdown of the Final Grade

+ +

The table on this screen shows your final grade and how it was calculated. + The final grade is made up from three possible components. + +

    +
  1. The teacher's grade for your submitted work. +
  2. The average of the peer grades for your submitted work. +
  3. A grade for your performance in the peer grading phase. This + performance was based by (a) whether your grades were too high or too low + when compared with the average grade of the other students (this is called bias), + (b) whether your grades follow, again on average, the grades given by + the other students (this is called reliability) + and (c) on the quality of your comments on the other pieces of work you graded. + This was graded by the teacher. These three performance grades were weighted + by the factors 1:2:3 respectively to give an overall "grading" + grade. In other words the teacher's grading of the comments is given the + same weight as the Bias and Reliability factors combined. +
+ +

These three components can be weighted as deemed appropriate for the + assignment. These weights are shown in the smaller table. +

diff --git a/lang/en/help/workshop/calculatingfinalgrade.html b/lang/en/help/workshop/calculatingfinalgrade.html new file mode 100644 index 0000000000..77d6c0c685 --- /dev/null +++ b/lang/en/help/workshop/calculatingfinalgrade.html @@ -0,0 +1,54 @@ +

The Calculation of the Final Grade

+ +

The table on this screen shows how the the final grades for the students + are calculated. The final grades are a weighted sum of up to five components. + +

    +
  1. The teacher's grade for their submitted work. This is optional and will be + used if the teacher actually assesses the student's work. If the student submits + more than one peice of work the "best" grade is used. Here, best + means the piece of work with the highest weighted combination of teacher's + grade and peer grade... +
  2. The average of the peer grades for their submitted work. Again if the student + submits more than one peice of work the "best" grade is used. The + peer grade can optionally + include the teacher's grade. This grade would be included if the number of + peer gradings is very low or it is thought that the peer gradings are suspect + either because of bias (usually on the high side) or for not being reliable. + If included the teacher's grade is treated in the same way as a peer grade in + the calculation of the average. +
  3. The student's bias in grading peer work. This is measure of whether the + student grades work either too high or too low. It is not an absolute measure + as it is based on the difference between the student's grade and the peer + averages for each of the submissions they assessed. In general this component + should NOT be given a high weighting. +
  4. The student's reliability in grading peer work. This is a measure on how well + a students grades follow the peer average for the peices of work they + assessed. The measure discounts the student bias and averages the absolute + differences between their grades and the peer average grades. In theory if + the students gives high marks for good peices of work and low marks for poor + pieces of work their reliability will be high. If it is suspected that the students in + general are poor assessors then the teacher's grades should be included into + the ppeer averages, this should make the reliability values more meaningful. +
  5. The average grade given by the teacher for the student's assessments. + This includes both the preliminary assessments made by the student on the + example pieces of work and any grading the teacher makes on the asessments + produced during the peer assessement phase of the assignment. In general this + component is probably more important than both the Bias and Reliability + components and thus, if available, should be weighted higher. +
+ +

These five components can be weighted as deemed appropriate for the + assignment. For example the teacher's grade might be weighted strongly + if the peer grading part of the assignment is only considered a minor part + of the assignment as a whole. Alternatively, if the teacher only grades a few + of the submissions these grades can be ignored by giving them a zero weighting. + If the assignment is all about the students as judges and the providing of feedback + then first two components may be set to zero (or low) and the students' + grading abilities will determine the final grades. + +

Note that this screen is used iteratively and the final grades are not normally + made available to the students until the final phase of the assignment. Once the + the teacher is happy with the final grades and their weightings then they can + be made available to the students. +

diff --git a/lang/en/help/workshop/elements.html b/lang/en/help/workshop/elements.html new file mode 100644 index 0000000000..a595abb8ea --- /dev/null +++ b/lang/en/help/workshop/elements.html @@ -0,0 +1,56 @@ +

Assignment Elements

+ +

For ease of grading, a Workshop Assignment should have a reasonable + number of "Assessment Elements". Each element should cover + a particular aspect of the assignment. Typically an assignment will have + something between 5 to 15 elements for comments and grading, the + actual number depending on the size and complexity of the assignment. A peer + assignment with only one element is allowed and has a similar assessment + strategy to the standard Moodle Assignment. + +

The type of elements dependent of the assignment's grading strategy. + +

Not Graded. The elements are descriptions of aspects of the assignment. + The assessor is asked to comment on each of these aspects. As with all the grading + strategies, there is also an area for general comments. + + +

Accumulative Grading. The elements have the following three features: +

    +
  1. The DESCRIPTION of the assessment element. This should clearly state what + aspect of the assignment is being assessed. If the assessment is qualatative + it is helpful to give details of what is considered excellent, average + and poor. + +
  2. The SCALE of the assessment element. There are a number of prefined + scales. These range from simple Yes/No scales, through multipoint scales to + a full percentage scale. Each element has its own scale which should be choosen + to fit the number of possible variations for that element. Note that the scale + does NOT determine the element's importance when calculating the overall + grade, a two point scale has the same "influence" as a 100 point + scale if the respective elements have the same weight... + +
  3. The WEIGHT of the assessment element. By default the elements are given the same + importance when calculating the overall grade of the assignment. This can be + changed by giving the more importance elements a weight greater than one, and + the less important elements a weight below one. Changing the weights does NOT + effect the maximum grade, that value is fixed by the Maximum Grade parameter + of the peer assignment. Weights can be assigned negative values, this is an + experimental feature. +
+

Error Banded Grading. The elements will normally describe certain items + or aspects which must be present in the assignment. The assessment is made on the + present or absence of these items or aspects. The teacher must all set of grade table which + give the suggested grades when all the items are present, when one is absent, when two are + absent, etc. If certain items are more important than others then those items can be given + a weighting greater than one. Minor items can be given a weighting less than one. The + overall "error count" is a weighted sum of the missing items. The assessor + can always make a minor adjustment to these suggested grades. + +

Criteria Grading. The elements will give a set of "level" statements +which can be used to rank the assignment. The statements may be cumulative or they may +each be self contained. The assessor must decide which statement best fits each piece of +work. The teacher must also relate each criterion statement with a suggested grade. These +should normally be in order. The assessor can make a minor adjustment to these +suggested grades. +

\ No newline at end of file diff --git a/lang/en/help/workshop/finalgrades.html b/lang/en/help/workshop/finalgrades.html new file mode 100644 index 0000000000..0f51aa8fbf --- /dev/null +++ b/lang/en/help/workshop/finalgrades.html @@ -0,0 +1,21 @@ +

The Final Grades

+ +

The table on this screen lists the final grades and their breakdown as shown to + the students. If there are missing values in the table then it is possible to "go back" + and add these. In fact, there are two adjustments which can be made to the Final Grades. + +

    +
  1. If a teacher's grade needs to be added then the piece of work can be + graded by going + to the teacher's Management screen for assignment and clicking on the link "Student + Submissions for Assessment". Any otherstanding submissions can be graded. Once this has + been done then move the assignment back to Phase 3 and re-calculate the Final grades. In a + similar way any assessments which have not been graded can be graded from the Management + screen. +
  2. If it is desired to use a different weighting scheme then the assignment should be moved + back to Phase 3 and link "Calculate Final Grades" can be clicked and the new + weights entered. After the grades have been re-calcualted the assignment should be moved + to Phase 4 to make the new grades available. +
+ +

diff --git a/lang/en/help/workshop/graded.html b/lang/en/help/workshop/graded.html new file mode 100644 index 0000000000..b5233f2972 --- /dev/null +++ b/lang/en/help/workshop/graded.html @@ -0,0 +1,14 @@ +

A Graded Peer Assignment

+ +

This shows the grades and comments made on the submitted piece of + work. You can if you wish reply to this assessment and choose not to + accept it (at this stage). If that is the case, please enter your reply in the + box at the foot of the page giving the reason why you are not happy with + the assessment. Then click on the button at the foot of the page and + choose NO when asked whether you are happy with this assessment. + +

If, on the other hand. you are happy with the assessment simply + click on the button at the foot of the page and then click on YES when + asked whether you are happy with this assessment. + +

diff --git a/lang/en/help/workshop/grading.html b/lang/en/help/workshop/grading.html new file mode 100644 index 0000000000..b7da8771b7 --- /dev/null +++ b/lang/en/help/workshop/grading.html @@ -0,0 +1,32 @@ +

Grading of Peer Assignments

+ +

For ease of grading a Peer Assignment is divided into a number of + assessment "elements". Each element covers + a particular aspect of the assignment. Depending on the type of assessment, + for each element you should +

    +
  1. Enter a Grade by clicking in the appropriate button or selecting an appropriate + number from the drop down menu. + +
  2. Enter an explaination of why you gave that grade in the Feedback box. If + you feel that the reason is obvious then leave the box empty. Note, however, + that the teacher may look at your assessment and may well query a grade + if there is no explaination. +
+ +

In other type of asessments, you are asked to determine if various items + are present or absent, in others you are asked to choose which statement best + fits the peice of work. In both of these assignments you can adjust the grade + somewhat as you see fit. + +

The last box on this form allows you to make a general comment on the + work. This should justify your assessment. It should be polite and as far as + possible constructive. Your assessment will be shown to the student who + produced the piece of work. + +

You have a limited period of time, typically half an hour, in which to + change your mind and alter your grades or comments. Once that period + is over the person whose work you are assessing is notified about the assessment. + At that stage you can view your assessment but you cannot change it. + +

diff --git a/lang/en/help/workshop/gradingassessments.html b/lang/en/help/workshop/gradingassessments.html new file mode 100644 index 0000000000..2ace224d65 --- /dev/null +++ b/lang/en/help/workshop/gradingassessments.html @@ -0,0 +1,20 @@ +

Grading the Student Assessments

+ +

This screen is used to enter the teacher's grade for the assessment made + by the student during the submission and assessment phase of the assignment. A relatively + simple grading is used, the score out of 20. The treacher can decide what is + being graded and the relative scores from the instructions given to the students + before the assignment started. For example, at a higher level the students may be + required to give critical comments, at an intermediate level the students may be + required to point out strengths and weaknesses, and at a lower level the students + may be simply pointing out errors and inaccuracies. + +

If available the Teacher's own assessment is shown before that of the + student so an easy comparison can be made. The teacher's own + comments can act as a kind of benchmark. + +

The grades of assessment is + saved by clicking on the apprpriate button at the foot of the page. There is a + chance to repeat the grading within the "editing" period. Once that + time has elapsed the grade is made available to the student. +

diff --git a/lang/en/help/workshop/gradingstrategy.html b/lang/en/help/workshop/gradingstrategy.html new file mode 100644 index 0000000000..23fec36b1f --- /dev/null +++ b/lang/en/help/workshop/gradingstrategy.html @@ -0,0 +1,73 @@ +

Grading Strategy

+ +

A workshop assignment is quite flexible in the type of grading scheme used. This can be: + +

    +
  1. No grading: In this type of assignment the teacher is not + interested in quantative assessment from the students at all. The students + make comments of the pieces of works but not not grade them. The teacher, + however, can, if desired, grade the student comments. These + "grading grades" form the basis of the students' final grades. + If the teacher does not grade the student assessments then the assignment + does not have any final grades. + +
  2. Accumulative grading: This is the default type of grading. + In this type of assignment the grade of each + assessment is made up of a number of "assessment elements". + Each element should cover + a particular aspect of the assignment. Typically an assignment will have + something between 5 to 15 elements for comments and grading, the + actual number depending on the size and complexity of the assignment. A peer + assignment with only one element is allowed and has a similar assessment + strategy to the standard Moodle Assignment. + +

    Elements have the following three features: +

      +
    1. The DESCRIPTION of the assessment element. This should clearly state what + aspect of the assignment is being assessed. If the assessment is qualatative + it is helpful to give details of what is considered excellent, average + and poor. + +
    2. The SCALE of the assessment element. There are a number of prefined + scales. These range from simple Yes/No scales, through multipoint scales to + a full percentage scale. Each element has its own scale which should be choosen + to fit the number of possible variations for that element. Note that the scale + does NOT determine the element's importance when calculating the overall + grade, a two point scale has the same "influence" as a 100 point + scale if the respective elements have the same weight... + +
    3. The WEIGHT of the assessment element. By default the elements are given the same + importance when calculating the overall grade of the assignment. This can be + changed by giving the more importance elements a weight greater than one, and + the less important elements a weight below one. Changing the weights does NOT + effect the maximum grade, that value is fixed by the Maximum Grade parameter + of the peer assignment. Weights can be assigned negative values, this is an + experimental feature. +
    + +
  3. Error Banded Grading: In this type of assignment the submissions are + graded on a set of Yes/No scales. The grade is determined by the "Grade + Table " which gives the relationship between the number of + "errors" and the suggested grade. For example an assignment may have six + significant items which should be present, the Grade Table will give suggested + grades if all are present, one is absent, if two are absent, etc. The individual + items can, if desired, be given weighting factors if some items are more important + than others. The number of "errors" is a weighted sum of the items not + present. By default each item is given a weight of one. The grading table is likely + to be non-linear, for example + the sugested grades may be 90%, 70%, 50%, 40%, 30%, 20%, 10%, 0%, 0%, 0% for + an assignment with 10 items.The assessor can adjust the suggested grade by up + to 20% either way to give the submission's final grade. + +
  4. Criteria Grading: This is simpliest type of assessment to grade (although + not necessarily the most straightforward to set up). The submissions are + graded against a set of criteria statments. The assessor choses which statement + best fits the piece of work. The grade is determined by a "Criteria + Table" which gives the suggested grade for each criterion. For example + an assignment may be set up with, say, five criteria statements and the assessors + must then choose one of the five statements for each of their assessments. As with + the Banded assignment the assessor can adjust the suggested grade by up to + 20% to give the final grade. +
+ +

diff --git a/lang/en/help/workshop/includeself.html b/lang/en/help/workshop/includeself.html new file mode 100644 index 0000000000..a24b8933c1 --- /dev/null +++ b/lang/en/help/workshop/includeself.html @@ -0,0 +1,13 @@ +

Including Self in the Assignment

+ +

A peer graded assignment can optionally include the student's own work + in the set of pieces each student is asked to grade. This will mean that if, say, the + number of peer assessors is 5, then each student will be asked to grade 6 + pieces of work, one of them being their own work. + +

If the number of peer assessors is set to zero and the include self option + is turned on then the assignment becomes a self-graded assignment. This + may or may not include the teacher's grading depending on whether that + option is set or not. + +

diff --git a/lang/en/help/workshop/managing.html b/lang/en/help/workshop/managing.html new file mode 100644 index 0000000000..55f383b30c --- /dev/null +++ b/lang/en/help/workshop/managing.html @@ -0,0 +1,58 @@ +

Managing a Workshop Assignment

+ +

A Workshop Assignment is more complex than an ordinary assignment. + It involves a number of steps or phases. These are +

    +
  1. The assessment of the assignment should be broken into a number + of assessment ELEMENTS. This makes the grading of an assignment less + arbitary and gives the students a framework on which to make assessments. + The teacher has the role of setting up the assessment elements thus making a + grading sheet. (See that page for more details.) + +

    With the assessment elements set up the teacher will normally submit a + small number of example pieces of work. These are practice pieces for the + students to assess before preparing their own pieces of work. However, + before the assignment is made available to students, these example + pieces should be assessed by the teacher. This provides the students + with not only examples for the assignment but also specimen assessments + on those examples. +

    The submission of example pieces of work by the teacher is optional + and for certain assignments may not be appropriate. + +

  2. The assignment is now opened to the students. If the teacher has set up + example pieces of work the students can be asked to assess a number of these. + In this case, the teacher must grade these assessments and the students must + reach a satisfactory standard before they are allowed submit their own work. + Here, a "satisfactory standard" has been set at 40%. Once a student + has "passed" the required number of assessments they are free to + submit their own work. +

    When a student submits a piece of work the teacher can, if desired assess that + work. This assessment can be incorporated into the student final grade. These + assessments, if they are required, can take place either during the submission + phase of the assignment or after the submission deadline. +

    If the assignment incorporates peer assessment, students who have submitted + work are shown other students' work to assess. When they have made an assessment + their peer can see that assessment (but the other student cannot comment on it.) + The teacher, however, can, if desired, grade the assessment and that score is taken + forward towards the student's final grade. + +

  3. After the deadline has passed, the teacher moves the assignment to the next phase + where further submissions and assessments by students are not allowed. The teacher + can, if wished, grade the peer assessments made by the students. This is not really + necessary as provided a reason number of assessments have been made on each + submission the "grading performance" of each student can be + determined from the relative scores. The teacher now calculates the final grades + of the students. These final grades are normally made up of three components, + teacher's grade of the student's work, mean peer grade of the student's work + and the student's grading performance. The last can include the mean "grading + grade" entered by the teacher against a student's comments. These three + components are given weights by the teacher before the calculation of the final + grades takes place. + +
  4. The final phase of the assignment is entered to allow the students to see their + final grades. The teacher can, be desired, backtrack the assignment to allow some + adjustment of, say, the weights used in the final grade calculation, the revised + grades can then be shown to the students. +
+ +

diff --git a/lang/en/help/workshop/nassessmentsofstudentsubmissions.html b/lang/en/help/workshop/nassessmentsofstudentsubmissions.html new file mode 100644 index 0000000000..7717701c02 --- /dev/null +++ b/lang/en/help/workshop/nassessmentsofstudentsubmissions.html @@ -0,0 +1,11 @@ +

Number of Assessments of Student submissions

+ +

This number determines whether the students are asked to peer assess + other students' work. If it is + not zero then each student is offered that number of peices + of work from other students. After assessment the originator of the work + can view the comments and grade given by their peer. The teacher can also, + if desired, grade these assessments and those grades can be used in the calculation of + the final marks. The student is show the teacher's comments and grade + for each of their assessments if available. +

diff --git a/lang/en/help/workshop/nassessmentsofteachersexamples.html b/lang/en/help/workshop/nassessmentsofteachersexamples.html new file mode 100644 index 0000000000..b0f041b1af --- /dev/null +++ b/lang/en/help/workshop/nassessmentsofteachersexamples.html @@ -0,0 +1,10 @@ +

Number of Assessments of Teacher's Examples

+ +

This number determines whether the students are asked to assess + any example peices of work before submitting their own work. If it is + not zero then each student must assess that number of example pieces + of work to a satisfactory level. This means that the teacher must grade + these assessments before the student can submit work. The student is + shown the teacher's comments and grade for each of their + assessments. +

diff --git a/lang/en/help/workshop/nelements.html b/lang/en/help/workshop/nelements.html new file mode 100644 index 0000000000..2352c05bbd --- /dev/null +++ b/lang/en/help/workshop/nelements.html @@ -0,0 +1,15 @@ +

Number of Comments, Elements, Bands or Criteria

+ +

The number entered here determines how many items will be used in + the assessments. Depending on the type of grading strategy, this number + gives the number of comments, assessments elements, bands or criteria + to be used in the assessments. Typically an assignment will have + something between 5 to 15 assessment items, the + actual number depending on the size and complexity of the assignment. + +

All assessments have a General Comments field. For a "No + Grading" assignment the value given here determines the + number of additional comment areas. It can be specified as zero and results + in the assessment having only a single General Comments area. + +

diff --git a/lang/en/help/workshop/numberofassessors.html b/lang/en/help/workshop/numberofassessors.html new file mode 100644 index 0000000000..4bbf1ac3ae --- /dev/null +++ b/lang/en/help/workshop/numberofassessors.html @@ -0,0 +1,30 @@ +

Number of Peer Assessors

+ +

A peer graded assignment will normally have around 3 to 8 peer + assessors. That is, in the peer grading phase, each student will be + asked to grade this number of pieces of work from the other students + in the class. The larger the assignment is, in terms of content, the + smaller this number should be, else the grading burden on the + students becomes onerous. However, each student should see sufficient + examples to gain an insight into what constitutes a good piece of work + and a poor piece of work. Further for the grading performance of a + student to be assessed meaningfully the greater the number of peer + gradings the better. This performance is unlikely to be valid if only three + or four gradings are done by each student. + +

Provided there is enough pieces of work submitted (actually 10 or + more), the system will allocate each student at least one "good" and + at least one "poor" piece of work. However, this can only be done if the + teacher has graded the pieces of work BEORE the allocation of (peer) grading + work is done. The teacher does NOT, however, have to grade all the + pieces of work, a sample is sufficient. Further, the teacher's gradings need + NOT be the final gradings, a preliminary grading is good enough. Note, + however, that if the option to show teacher's gradings is turned on, + these gradings will be shown to the students at the end of the submission + phase. + +

The number of peer assesors can be zero. In which case the assignment + becomes either a self-graded assignment if that option is turned on, or + a normal teacher-graded assignment. + +

diff --git a/lang/en/help/workshop/resubmit.html b/lang/en/help/workshop/resubmit.html new file mode 100644 index 0000000000..0830b5d211 --- /dev/null +++ b/lang/en/help/workshop/resubmit.html @@ -0,0 +1,19 @@ +

Resubmitting assignments

+ +

By default, students cannot resubmit assignments, they are allowed only one submission.

+ +

If you turn this option on, then students will be allowed to submit more than one piece of work + to this assignment. This may be useful if the teacher wants to encourage students to do better + work by an iterative process.

+ +

The assessment of submissions is allocated on the basis of the number of assessments a piece + of work has had. Thus new submissions from a student are likely to be candidates for peer + assessment. However, if a student resubmits a number of pieces of work in quick succession then + they are all equally likely to be assessed. The assignment does NOT give priority to the newest + submission. + +

When the student's final grade is calculated the submission with the highest grade is used. Here + highest grade means the weighted combination of the teacher's grade and the peer grade if + both are available. + +

diff --git a/lang/en/help/workshop/selfassessment.html b/lang/en/help/workshop/selfassessment.html new file mode 100644 index 0000000000..1024d737a2 --- /dev/null +++ b/lang/en/help/workshop/selfassessment.html @@ -0,0 +1,12 @@ +

Self Assessment

+ +

A workshop assignment can optionally include the student's own work + in the set of pieces each student is asked to assess. This will mean that if, say, the + number of student pieces of work each student has to assess is set at 5, then + each student will be asked to assess 6 pieces of work, one of them being their own work. + +

If the number of student pieces of work is set to zero and the self assessment option + is turned on then the assignment becomes a self-graded assignment. This + may or may not include the teacher's grading depending on the teacher's decision. + +

diff --git a/lang/en/help/workshop/showinggrades.html b/lang/en/help/workshop/showinggrades.html new file mode 100644 index 0000000000..9f94bbdd3f --- /dev/null +++ b/lang/en/help/workshop/showinggrades.html @@ -0,0 +1,22 @@ +

When to display Grades

+ +

A peer graded assignment can have either of these characteristics: + +

    +
  1. In the peer grading phase the students see the feedback on the + assessment elements, the general comment and the grades given + by the other students. The students are shown both the individual + assessment element grades and their overall grade. This may lead + into more disputes than the second type of peer graded assignment... + +
  2. In the peer grading phase the students see only the feadback on the + assessment elements and the general comment made by + the other students. The grades for the individual assessment elements are + not revealed (although they are held in the system). Further, the students + do not see their overall grades as given by their peers. Only when the + comments have been agreed are the grades (and the overall grade) + shown. This type of peer graded assignment is likely to be less + contentious than the first type. +
+ +

diff --git a/lang/en/help/workshop/specimen.html b/lang/en/help/workshop/specimen.html new file mode 100644 index 0000000000..38b3d43e25 --- /dev/null +++ b/lang/en/help/workshop/specimen.html @@ -0,0 +1,14 @@ +

Specimen Grading Form

+ +

This page shows shows the details of the actual form used to grade + your assignment. It will be used by the teacher to grade your work. Further, + in a peer graded asignment, the same form will be used by yourself and + your fellow students to grade the submitted pieces of work. + +

Please note that although you can change the grades and add text on + this form these changes are NOT saved. This is simply a specimen form, + but a very similar form will be used by the teacher and by you during this + assignment. + + +

diff --git a/lang/en/help/workshop/teachersgradings.html b/lang/en/help/workshop/teachersgradings.html new file mode 100644 index 0000000000..184f4b3ee8 --- /dev/null +++ b/lang/en/help/workshop/teachersgradings.html @@ -0,0 +1,13 @@ +

Display of Teacher's Grades

+ +

A peer graded assignment can optionally make the teacher's comments + and grades available to the student's. If desired, these are shown after the + submission deadline, or later if the grades are not available then. The teacher's + comments and grades may well help the students when making their own + (peer) assessments on other student's work. + +

Note that even when the peer grading is done anonymously, the + teacher's grades are always shown to the students with the teacher's + name and, if available, their photo. + +

diff --git a/lang/en/workshop.php b/lang/en/workshop.php new file mode 100644 index 0000000000..76157bceb3 --- /dev/null +++ b/lang/en/workshop.php @@ -0,0 +1,138 @@ + + This makes the grading easier and more consistent. As teacher you must add these
+ Elements before making the assignment available to students. This is done by
+ clicking on the assignment in the course, if no elements are present you will be asked
+ to add them. You can change the number of elements using the Edit Assignment screen,
+ the elements themselves can be amended from the "Managing Assessment" screen. "; +$string['notitlegiven'] = "No Title Given"; +$string['notgraded'] = "Not Graded"; +$string['numberofassessments'] = "Number of Assessments"; +$string['numberofassessmentelements'] = "Number of Comments, Assessment Elements, Grade Bands or Criteria Statments"; +$string['numberofassessmentsofstudentsubmissions'] = "Number of Assessments of Student Submissions"; +$string['numberofassessmentsofteachersexamples'] = "Number of Assessments of Examples from Teacher"; +$string['openassignment'] = "Open Assignment"; +$string['optionforpeergrade'] = "Option for Peer Grade"; +$string['overallgrade'] = "Overall Grade"; +$string['overallpeergrade'] = "Overall Peer Grade: \$a"; +$string['overallteachergrade'] = "Overall Teacher Grade: \$a"; +$string['ownwork'] = "Own Work"; +$string['phase'] = "Phase"; +$string['phase1'] = "Set Up Assignment"; +$string['phase2'] = "\$a Submissions and Assessments"; +$string['phase3'] = "Calculation of Final Grades"; +$string['phase4'] = "Show Final Grades"; +$string['pleaseassesstheseexamplesfromtheteacher'] = "Please assess these Examples from the \$a"; +$string['pleaseassessthesestudentsubmissions'] = "Please assess these \$a Submissions"; +$string['returntosubmissionpage'] = "Return to Submission Page"; +$string['savemyassessment'] = "Save my Assessment"; +$string['savedok'] = "Saved OK"; +$string['savemygrading'] = "Save my Grading"; +$string['scaleyes'] = "2 point Yes/No scale"; +$string['scalepresent'] = "2 point Present/Absent scale"; +$string['scalecorrect'] = "2 point Correct/Incorrect scale"; +$string['scalegood3'] = "3 point Good/Poor scale"; +$string['scaleexcellent4'] = "4 point Excellent/Very Poor scale"; +$string['scaleexcellent5'] = "5 point Excellent/Very Poor scale"; +$string['scaleexcellent7'] = "7 point Excellent/Very Poor scale"; +$string['scale10'] = "Score out of 10"; +$string['scale20'] = "Score out of 20"; +$string['scale100'] = "Score out of 100"; +$string['selfassessment'] = "Self Assessment"; +$string['showgrades'] = "Show Grades"; +$string['specimenassessmentform'] = "Specimen Assessment Form"; +$string['studentsassessment'] = "Student's Assessment"; +$string['studentgrades'] = "\$a Grades"; +$string['studentsubmissionsforassessment'] = "\$a Student Submissions for Assessment"; +$string['studentsubmissions'] = "\$a Submissions"; +$string['submitassignment'] = "Submit Assignment"; +$string['submitexampleassignment'] = "Submit Example Assignment"; +$string['submitted'] = "Submitted"; +$string['submissions'] = "Submissions"; +$string['returnto'] = "Return to"; +$string['teachersassessment'] = "Teacher's Assessment"; +$string['teacherscomment'] = "Teacher's Comment"; +$string['teachersgrade'] = "Teacher's Grade"; +$string['teachersubmissionsforassessment'] = "\$a Teacher Submissions for Assessment"; +$string['thegradeis'] = "The Grade is \$a"; +$string['theseasessmentsaregradedbytheteacher'] = "These Assessments are graded by the \$a"; +$string['timeassessed'] = "Time Assessed"; +$string['title'] = "Title"; +$string['typeofscale'] = "Type of Scale"; +$string['ungradedassessmentsofstudentsubmissions'] = "\$a Ungraded Assessments of Student Submissions"; +$string['ungradedassessmentsofteachersubmissions'] = "\$a Ungraded Assessments of Teacher Submissions"; +$string['view'] = "View"; +$string['viewassessmentofteacher'] = "View Assessment of \$a"; +$string['viewotherassessments'] = "View other Assessments"; +$string['warningonamendingelements'] = "WARNING: There are submitted assessments.
Do NOT change the number + of elements, the scale types or the element weights."; +$string['weightederrorcount'] = "Weighted Error Count: \$a"; +$string['weightforbias'] = "Weight for Bias"; +$string['weightforgradingofassessments'] = "Weight for Grading of Assessments"; +$string['weightforpeerassessments'] = "Weight for Peer Assessments"; +$string['weightforreliability'] = "Weight for Reliability"; +$string['weightforteachersassessment'] = "Weight for Teacher's Assessment"; +$string['weights'] = "Weights"; +$string['weightsusedforfinalgrade'] = "Weights used for Final Grade"; +$string['weightsusedforsubmissions'] = "Weights used for Submissions"; +$string['yourassessments'] = "Your Assessments"; + +?> diff --git a/mod/workshop/Overview.html b/mod/workshop/Overview.html new file mode 100644 index 0000000000..2835609af6 --- /dev/null +++ b/mod/workshop/Overview.html @@ -0,0 +1,173 @@ + + + + + Another Assignment Overview + + +

Another Assignment Module

+
+
"Assessment is the most powerful lever +teachers have to influence the way students respond to courses and +behave as learners"
+
+
+
from Graham +Gibbs, "Using Assessment Strategically to Change the Way Students Learn" +in "Asessment Matter in Higher Education, edited by Sally Brown and +Angela Glasner, OU Press, 1999
+
+
+

Overview

+This new module enables the teacher to set up a controlled assignment +which encourages students to become more critical of both their own work +and that of others. In its standard form, the module usually begins with +a preparatory phase where the teacher sets up the assessment criteria. +These will depend on which assessment strategy the teacher decides to +use for the assignment. There are four separate strategies:
+
    +
  1. No grading: In this type of assignment the teacher is not + interested in quantative assessment from the students at all. The +students make comments of the pieces of works but not not grade them. +The teacher, however, can, if desired, grade the student comments. +These "grading grades" form the basis of the students' final grades. + If the teacher does not grade the student assessments then the +assignment does not have any final grades.
  2. +
  3. Accumulative grading: This is the default type of grading. + In this type of assignment the grade of each assessment is made up of +a number of "assessment elements". Each element should cover a +particular aspect of the assignment. Typically an assignment will have + something between 5 to 15 elements for comments and grading, the + actual number depending on the size and complexity of the assignment. A +peer assignment with only one element is allowed and has a similar +assessment strategy to the standard Moodle Assignment.
  4. +
  5. Error Banded Grading: In this type of assignment the +submissions are graded on a set of Yes/No scales. The grade is +determined by the "Grade Table " which gives the relationship between +the number of "errors" and the suggested grade. For example an +assignment may have six significant items which should be present, the +Grade Table will give suggested grades if all are present, one is +absent, if two are absent, etc.
  6. +
  7. Criteria Grading: This is simpliest type of assessment to +grade (although not necessarily the most straightforward to set up). +The submissions are graded against a set of criterion statments. The +assessor choses which statement best fits the piece of work. The grade +is determined by a "Criteria Table" which gives the suggested grade +for each criterion.
  8. +
+Next the teacher submits a small number (probably between 5 and 10) +example pieces of work. These most likely have been gleaned from +previous cohorts and should probably include both good and poor attempts +at the assignment.
+
+Lastly the teacher assesses these examples using the "grading form" set +up for the asssignment. The teacher's assessments are there to guide the +students when they start the assignment.
+
+With these three sets of items in place, the assessment elements (and +possibly the associated grade table), the example assignments and the +specimen assessments, the assignment can be opened up to the students. +The students' first task is usually to assess a selection of the +example assignments. As these assessments are produced the teacher +reviews them and, if satisfactory, the individual students are allowed +to progress to the next stage. The teacher may ask a student to +re-assess one or more of the example assessments. This should be easy to +do as once an example assignment is assessed the student is able to view +the teacher's "specimen" assessments. This loop is basically there to +check that the weaker students are aware of the specimen assessments and +have looked at them.
+
+At the end of this initial stage the students should have a fair idea +of what the assignment is about and how it is being assessed. They are +now allowed to submit their own work. This is not a fixed milestone, +each student will reach this second stage independently. With all the +inital assessments graded the teacher can sit back and let the module +run until the deadline date.
+
+The module can be set up to allow single submission or multiple +submissions. Depending on this setting, the student' first submission is +either their first draft or their only attempt.When the students have +submitted work they are asked to assess work from the other students. +They are also shown the assessments of their own work by the other +students. However, they must do at least one assessment before they are +shown the peer assessments. When the assignment allows resubmission the +student may, in the light of the feedback, revise their work and submit +a new copy for peer assessment. The peer assessment of student +submissions continues until the deadline date is reached.
+
+The teacher now has several choices. The module allows a flexible +approach to calculating the final grade for the students. In fact, the +final grade can be a teacher-defined combination of:
+
    +
  1. The teacher's grade of the (final) submission
  2. +
  3. The average peer grade of the (final) submission
  4. +
  5. The student's grading performance
  6. +
+Obviously if (1) is to be included then the teacher has to assess the +student submissions after the deadline. There is no real need for the +students' assessments produced during the peer asessment phase to be +graded by the teacher. The module can assess the quality of these +assignments by internal comparison. This is probably just as well as the +number of assessments generated at that phase could be quite large even +for reasonably sized classes. The final phase of the module is the +release of the final grades to the students.
+
+Thus the module normally runs through four phases:
+
    +
  1. Set up
  2. +
  3. Student assessment of the example assignments, submission of work +and peer assessment
  4. +
  5. Calculation of final grades
  6. +
  7. Release of final grades
  8. +
+And there's a single deadline occurring between phases 2 and 3.
+
+

Variants

+That describes the "standard" assignment which this module supports. +The module also lends itself to a few other types of assignment. For +example, a "case study" assignment can be handled where the teacher +sets up a number of scenarios for the students to comment on. Here there +are no student submissions the teacher simply grades the students +responses to each scenario and uses those to calculate the final grades.
+
+A second example using the module in an abbrieviated way is as a simple +peer assessment assignment. Here the teacher sets up the assessment +elements but does not submit any example assignments and the students go +straight in to the peer assessment phase, possibly going where no class +has boldly gone before!
+
+For certain assignments the teacher may decide that the example +assignments would simply lead the students into doing a cut-and-paste +exercise to produce their assignments. Here the initial assessment phase +would be better performed on a set of examples from a related subject +rather than those directly pertaining to the particular assignment. In +this way the students are shown what is expected of them and how it is +being assessed but "the cat is still in the bag" so to speak. Careful +monitoring of the assignment would be necessary else many students, not +reading the instructions, would reproduce the examples rather then the +required assignment.
+
+The module can also be set up to ask the students to asssess their own +work. That is instead of peer assessment the assignment becomes one +involving self assessment. Here it is likely that the teacher would +grade the (self) assessments make in the second half of phase 2 and +include these grades in the final grades.
+
+

Conclusion

+Thus the module is quite flexible while still being relatively easy to +set up and run. The module has been keep purposely simple. For example +it does not allow the students to enter into an assessment - reply - +assessment cycle during the peer assessment phase.  If that +sophistication is required then the Peer Graded Assignment module should +be used. Other technical restrictions are that the submitted assignments +are limited to a single file, that is although multiple submissions are +allowed each submission can only be just one file. The files themselves +are limited to a prediefined size and the module does not support links +to external pieces of work.

+Ray Kingdon
+April 2003
+
+ + diff --git a/mod/workshop/assessments.php b/mod/workshop/assessments.php new file mode 100644 index 0000000000..ffe4241db1 --- /dev/null +++ b/mod/workshop/assessments.php @@ -0,0 +1,678 @@ +course)) { + error("Course is misconfigured"); + } + + if (! $workshop = get_record("workshop", "id", $cm->instance)) { + error("Course module is incorrect"); + } + + } else { + if (! $workshop = get_record("workshop", "id", $a)) { + error("Course module is incorrect"); + } + if (! $course = get_record("course", "id", $workshop->course)) { + error("Course is misconfigured"); + } + if (! $cm = get_coursemodule_from_instance("workshop", $workshop->id, $course->id)) { + error("Course Module ID was incorrect"); + } + } + + require_login($course->id); + + if ($course->category) { + $navigation = "id\">$course->shortname ->"; + } + + $strworkshops = get_string("modulenameplural", "workshop"); + $strworkshop = get_string("modulename", "workshop"); + $strassessments = get_string("assessments", "workshop"); + + // ... print the header and... + print_header("$course->shortname: $workshop->name", "$course->fullname", + "$navigation id>$strworkshops -> + id\">$workshop->name -> $strassessments", + "", "", true); + + //...get the action + require_variable($action); + + +/*************** Assess submission (by teacher or student) ***************************/ + if ($action == 'assesssubmission') { + + require_variable($sid); + + if (! $submission = get_record("workshop_submissions", "id", $sid)) { + error("assess submission is misconfigured"); + } + + $yearfromnow = time() + 365 * 86400; + // is there an assessment record, create one and set timecreated way in the future, this is reset when record is updated + if (!$assessment = workshop_get_submission_assessment($submission, $USER)) { + $assessment->workshopid = $workshop->id; + $assessment->submissionid = $submission->id; + $assessment->userid = $USER->id; + $assessment->grade = -1; // set impossible grade + $assessment->timecreated = $yearfromnow; + $assessment->timegraded = 0; + if (!$assessment->id = insert_record("workshop_assessments", $assessment)) { + error("Could not insert workshop assessment!"); + } + } + + print_heading_with_help(get_string("assessthissubmission", "workshop"), "grading", "workshop"); + + echo "
cellcontent\">"; + echo workshop_print_submission_title($workshop, $submission); + echo "

\n"; + workshop_print_assessment($workshop, $assessment, TRUE); + } + + + /*************** display elements (viewed by student) *********************************/ + elseif ($action == 'displaygradingform') { + + print_heading_with_help(get_string("specimengradingform", "workshop"), "specimen", "workshop"); + $assessment = ''; // needed? + workshop_print_assessment($workshop, $assessment); + } + + + /*********************** edit assessment elements (for teachers) ***********************/ + elseif ($action == 'editelements') { + + if (!isteacher($course->id)) { + error("Only teachers can look at this page"); + } + + $count = count_records("workshop_grades", "workshop", $workshop->id); + if ($workshop->phase > 1 and $count) { + notify(get_string("warningonamendingelements", "workshop")); + } + // set up heading, form and table + print_heading_with_help(get_string("editingassessmentelements", "workshop"), "elements", "workshop"); + ?> +
+ + +
+ id, "elementno ASC" )) { + foreach ($elementsraw as $element) { + $elements[] = $element; // to renumber index 0,1,2... + } + } + // check for missing elements (this happens either the first time round or when the number of elements is icreased) + for ($i=0; $i<$workshop->nelements; $i++) { + if (!isset($elements[$i])) { + $elements[$i]->description = ''; + $elements[$i]->scale =0; + $elements[$i]->weight = 11; + } + } + switch ($workshop->gradingstrategy) { + case 0: // no grading + for ($i=0; $i<$workshop->nelements; $i++) { + $iplus1 = $i+1; + echo "\n"; + echo " \n"; + echo "\n"; + echo "\n"; + echo " \n"; + echo "\n"; + } + break; + + case 1: // accumulative grading + // set up scales name + foreach ($WORKSHOP_SCALES as $KEY => $SCALE) { + $SCALES[] = $SCALE['name']; + } + for ($i=0; $i<$workshop->nelements; $i++) { + $iplus1 = $i+1; + echo "\n"; + echo " \n"; + echo "\n"; + echo "\n"; + echo " \n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo " \n"; + echo "\n"; + } + break; + + case 2: // error banded grading + if ($elementsraw = get_records("workshop_elements", "workshopid", $workshop->id, "elementno ASC" )) { + foreach ($elementsraw as $element) { + $elements[] = $element; // to renumber index 0,1,2... + } + } + else { // set up the elements array with default values + for ($i=0; $i<=$workshop->nelements; $i++) { + $elements[$i]->description = ''; + $elements[$i]->maxscore =0; + } + } + for ($i=0; $i<$workshop->nelements; $i++) { + $iplus1 = $i+1; + echo "\n"; + echo " \n"; + echo "\n"; + if ($elements[$i]->weight == '') { // not set + $elements[$i]->weight = 11; // unity + } + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo " \n"; + echo "\n"; + } + echo "

". get_string("element","workshop")." $iplus1:

\n"; + echo "
cellheading2\"> 

". get_string("element","workshop")." $iplus1:

\n"; + echo "

". get_string("typeofscale", "workshop"). ":

\n"; + choose_from_menu($SCALES, "scale[]", $elements[$i]->scale, ""); + if ($elements[$i]->weight == '') { // not set + $elements[$i]->weight = 11; // unity + } + echo "
".get_string("elementweight", "workshop").":\n"; + workshop_choose_from_menu($WORKSHOP_EWEIGHTS, "weight[]", $elements[$i]->weight, ""); + echo "
cellheading2\"> 

". get_string("element","workshop")." $iplus1:

\n"; + echo "
".get_string("elementweight", "workshop").":\n"; + workshop_choose_from_menu($WORKSHOP_EWEIGHTS, "weight[]", $elements[$i]->weight, ""); + echo "
cellheading2\"> 

\n"; + echo "

".get_string("gradetable","workshop")."
\n"; + echo "
\n"; + for ($j = 100; $j >= 0; $j--) { + $numbers[$j] = $j; + } + for ($i=0; $i<=$workshop->nelements; $i++) { + echo "\n"; + } + echo "
". + get_string("numberofnegativeresponses", "workshop"); + echo "". get_string("suggestedgrade", "workshop")."
$i"; + choose_from_menu($numbers, "maxscore[$i]", $elements[$i]->maxscore, ""); + echo "
\n"; + break; + + case 3: // criteria grading + if ($elementsraw = get_records("workshop_elements", "workshopid", $workshop->id, "elementno ASC" )) { + foreach ($elementsraw as $element) { + $elements[] = $element; // to renumber index 0,1,2... + } + } + else { // set up the elements array with default values + for ($i=0; $i<=$workshop->nelements; $i++) { + $elements[$i]->description = ''; + $elements[$i]->maxscore =0; + } + } + for ($j = 100; $j >= 0; $j--) { + $numbers[$j] = $j; + } + for ($i=0; $i<$workshop->nelements; $i++) { + $iplus1 = $i+1; + echo "\n"; + echo "

". get_string("criterion","workshop")." $iplus1:\n"; + echo "\n"; + echo " \n"; + echo "". get_string("suggestedgrade", "workshop").":\n"; + choose_from_menu($numbers, "maxscore[$i]", $elements[$i]->maxscore, ""); + echo "\n"; + echo "\n"; + echo " cellheading2\"> \n"; + echo "\n"; + } + break; + } + // close table and form + ?> + + "> + "> +

+
+ id)) { + error("Only teachers can look at this page"); + } + + // set up coment scale + for ($i=COMMENTSCALE; $i>=0; $i--) { + $num[$i] = $i; + } + + print_heading_with_help(get_string("gradeassessment", "workshop"), "gradingassessments", "workshop"); + // get assessment record + if (!$assessmentid = $_GET['aid']) { + error("Assessment id not given"); + } + $assessment = get_record("workshop_assessments", "id", $assessmentid); + if (!$submission = get_record("workshop_submissions", "id", $assessment->submissionid)) { + error("Submission not found"); + } + echo "

".workshop_print_submission_title($workshop, $submission)."

\n"; + // get the teacher's assessment first + if ($teachersassessment = workshop_get_submission_assessment($submission, $USER)) { + echo "

".get_string("teachersassessment", "workshop")."\n"; + workshop_print_assessment($workshop, $teachersassessment); + } + // now the student's assessment + echo "

".get_string("studentsassessment", "workshop")."\n"; + workshop_print_assessment($workshop, $assessment); + + ?> +

+ + + + +
+ + \n"; + echo " \n"; + echo " \n"; + echo "\n"; + echo "

". get_string("teacherscomment", "workshop").":

\n"; + echo " \n"; + echo "
".get_string("gradeforstudentsassessment", "workshop")."\n"; + choose_from_menu($num, "gradinggrade", $assessment->gradinggrade, ""); + echo "
\n"; + echo "\n"; + echo "
\n"; + } + + + /*********************** insert/update assignment elements (for teachers)***********************/ + elseif ($action == 'insertelements') { + + if (!isteacher($course->id)) { + error("Only teachers can look at this page"); + } + + $form = (object)$HTTP_POST_VARS; + + // let's not fool around here, dump the junk! + delete_records("workshop_elements", "workshopid", $workshop->id); + + // determine wich type of grading + switch ($workshop->gradingstrategy) { + case 0: // no grading + // Insert all the elements that contain something + foreach ($form->description as $key => $description) { + if ($description) { + unset($element); + $element->description = $description; + $element->workshopid = $workshop->id; + $element->elementno = $key; + if (!$element->id = insert_record("workshop_elements", $element)) { + error("Could not insert workshop element!"); + } + } + } + break; + + case 1: // accumulative grading + // Insert all the elements that contain something + foreach ($form->description as $key => $description) { + if ($description) { + unset($element); + $element->description = $description; + $element->workshopid = $workshop->id; + $element->elementno = $key; + if (isset($form->scale[$key])) { + $element->scale = $form->scale[$key]; + switch ($WORKSHOP_SCALES[$form->scale[$key]]['type']) { + case 'radio' : $element->maxscore = $WORKSHOP_SCALES[$form->scale[$key]]['size'] - 1; + break; + case 'selection' : $element->maxscore = $WORKSHOP_SCALES[$form->scale[$key]]['size']; + break; + } + } + if (isset($form->weight[$key])) { + $element->weight = $form->weight[$key]; + } + if (!$element->id = insert_record("workshop_elements", $element)) { + error("Could not insert workshop element!"); + } + } + } + break; + + case 2: // error banded grading... + case 3: // ...and criteria grading + // Insert all the elements that contain something, the number of descriptions is one less than the number of grades + foreach ($form->maxscore as $key => $themaxscore) { + unset($element); + $element->workshopid = $workshop->id; + $element->elementno = $key; + $element->maxscore = $themaxscore; + if (isset($form->description[$key])) { + $element->description = $form->description[$key]; + } + if (isset($form->weight[$key])) { + $element->weight = $form->weight[$key]; + } + if (!$element->id = insert_record("workshop_elements", $element)) { + error("Could not insert workshop element!"); + } + } + break; + } // end of switch + + echo "

\n"; + notice_yesno(get_string("amendassessmentelements","workshop")." ".get_string("again"), + "assessments.php?id=$cm->id&action=editelements", "view.php?id=$cm->id"); + } + + + /*********************** list assessments for grading (Student submissions)(by teachers)***********************/ + elseif ($action == 'listungradedstudentsubmissions') { + + if (!isteacher($course->id)) { + error("Only teachers can look at this page"); + } + workshop_list_ungraded_assessments($workshop, "student"); + print_continue("view.php?a=$workshop->id"); + } + + + /*********************** list assessments for grading (Teacher submissions) (by teachers)***********************/ + elseif ($action == 'listungradedteachersubmissions') { + + if (!isteacher($course->id)) { + error("Only teachers can look at this page"); + } + workshop_list_ungraded_assessments($workshop, "teacher"); + print_continue("view.php?a=$workshop->id"); + } + + + /*********************** list teacher submissions ***********************/ + elseif ($action == 'listteachersubmissions') { + + workshop_list_teacher_submissions($workshop, $USER); + print_continue("view.php?a=$workshop->id"); + } + + + /*************** update assessment (by teacher or student) ***************************/ + elseif ($action == 'updateassessment') { + + require_variable($aid); + if (! $assessment = get_record("workshop_assessments", "id", $aid)) { + error("workshop assessment is misconfigured"); + } + + // first get the assignment elements for maxscores and weights... + if (!$elementsraw = get_records("workshop_elements", "workshopid", $workshop->id, "elementno ASC")) { + print_string("noteonassignmentelements", "workshop"); + } + else { + foreach ($elementsraw as $element) { + $elements[] = $element; // to renumber index 0,1,2... + } + } + + $timenow = time(); + // don't fiddle about, delete all the old and add the new! + delete_records("workshop_grades", "assessmentid", $assessment->id); + + $form = (object)$HTTP_POST_VARS; + + //determine what kind of grading we have + switch ($workshop->gradingstrategy) { + case 0: // no grading + // Insert all the elements that contain something + foreach ($form->feedback as $key => $thefeedback) { + unset($element); + $element->workshopid = $workshop->id; + $element->assessmentid = $assessment->id; + $element->elementno = $key; + $element->feedback = $thefeedback; + if (!$element->id = insert_record("workshop_grades", $element)) { + error("Could not insert workshop element!"); + } + } + $grade = 0; // set to satisfy save to db + break; + + case 1: // accumulative grading + // Insert all the elements that contain something + foreach ($form->grade as $key => $thegrade) { + unset($element); + $element->workshopid = $workshop->id; + $element->assessmentid = $assessment->id; + $element->elementno = $key; + $element->feedback = $form->feedback[$key]; + $element->grade = $thegrade; + if (!$element->id = insert_record("workshop_grades", $element)) { + error("Could not insert workshop element!"); + } + } + // now work out the grade... + $rawgrade=0; + $totalweight=0; + foreach ($form->grade as $key => $grade) { + $maxscore = $elements[$key]->maxscore; + $weight = $WORKSHOP_EWEIGHTS[$elements[$key]->weight]; + if ($weight > 0) { + $totalweight += $weight; + } + $rawgrade += ($grade / $maxscore) * $weight; + // echo "\$key, \$maxscore, \$weight, \$totalweight, \$grade, \$rawgrade : $key, $maxscore, $weight, $totalweight, $grade, $rawgrade
"; + } + $grade = $workshop->grade * ($rawgrade / $totalweight); + break; + + case 2: // error banded graded + // Insert all the elements that contain something + $error = 0.0; + for ($i =0; $i < $workshop->nelements; $i++) { + unset($element); + $element->workshopid = $workshop->id; + $element->assessmentid = $assessment->id; + $element->elementno = $i; + $element->feedback = $form->feedback[$i]; + $element->grade = $form->grade[$i]; + if (!$element->id = insert_record("workshop_grades", $element)) { + error("Could not insert workshop element!"); + } + if (empty($form->grade[$i])){ + $error += $WORKSHOP_EWEIGHTS[$elements[$i]->weight]; + } + } + // now save the adjustment + unset($element); + $i = $workshop->nelements; + $element->workshopid = $workshop->id; + $element->assessmentid = $assessment->id; + $element->elementno = $i; + $element->grade = $form->grade[$i]; + if (!$element->id = insert_record("workshop_grades", $element)) { + error("Could not insert workshop element!"); + } + $grade = ($elements[intval($error + 0.5)]->maxscore + $form->grade[$i]) * $workshop->grade / 100; + echo "

".get_string("weightederrorcount", "workshop", intval($error + 0.5))."\n"; + break; + + case 3: // criteria grading + // save in the selected criteria value in element zero, + unset($element); + $element->workshopid = $workshop->id; + $element->assessmentid = $assessment->id; + $element->elementno = 0; + $element->grade = $form->grade[0]; + if (!$element->id = insert_record("workshop_grades", $element)) { + error("Could not insert workshop element!"); + } + // now save the adjustment in element one + unset($element); + $element->workshopid = $workshop->id; + $element->assessmentid = $assessment->id; + $element->elementno = 1; + $element->grade = $form->grade[1]; + if (!$element->id = insert_record("workshop_grades", $element)) { + error("Could not insert workshop element!"); + } + $grade = ($elements[$form->grade[0]]->maxscore + $form->grade[1]) * $workshop->grade / 100; + } // end of switch + + // update the time of the assessment record (may be re-edited)... + set_field("workshop_assessments", "timecreated", $timenow, "id", $assessment->id); + set_field("workshop_assessments", "grade", $grade, "id", $assessment->id); + // ...and clear any grading of this assessment + set_field("workshop_assessments", "timegraded", 0, "id", $assessment->id); + set_field("workshop_assessments", "gradinggrade", 0, "id", $assessment->id); + + // any comment? + if (!empty($form->generalcomment)) { + set_field("workshop_assessments", "generalcomment", $form->generalcomment, "id", $assessment->id); + } + + // show grade if grading strategy is not zero + if ($workshop->gradingstrategy) { + echo "".get_string("thegradeis", "workshop").": ".number_format($grade, 2)."% (".get_string("maximumgrade"). + " ".number_format($workshop->grade)."%)\n"; + } + + print_continue("view.php?id=$cm->id"); + + add_to_log($course->id, "workshop", "assess", "view.php?a=$workshop->id", "$workshop->id"); + } + + + /*************** update grading (by teacher) ***************************/ + elseif ($action == 'updategrading') { + $timenow = time(); + + if (!isteacher($course->id)) { + error("Only teachers can look at this page"); + } + + $form = (object)$_POST; + + if (!$assessment = get_record("workshop_assessments", "id", $_POST['aid'])) { + error("Update Grading failed"); + } + //save the comment and grade for the assessment + if (isset($form->teachercomment)) { + set_field("workshop_assessments", "teachercomment", $form->teachercomment, "id", $assessment->id); + set_field("workshop_assessments", "gradinggrade", $form->gradinggrade, "id", $assessment->id); + set_field("workshop_assessments", "timegraded", $timenow, "id", $assessment->id); + set_field("workshop_assessments", "mailed", 0, "id", $assessment->id); + echo "".get_string("savedok", "workshop")."


\n"; + + add_to_log($course->id, "workshop", "grade", "view.php?id=$cm->id", "$workshop->id"); + } + switch ($form->stype) { + case "student" : + print_continue("assessments.php?action=listungradedstudentsubmissions&id=$cm->id"); + break; + case "teacher" : + print_continue("assessments.php?action=listungradedteachersubmissions&id=$cm->id"); + break; + } + } + + + /*********************** view all assessments ***********************/ + elseif ($action == 'viewallassessments') { + + if (!$submission = get_record("workshop_submissions", "id", $_GET['sid'])) { + error("View All Assessments: submission record not found"); + } + + if ($assessments = workshop_get_assessments($submission)) { + echo "
cellcontent\">"; + echo workshop_print_submission_title($workshop, $submission); + echo "

\n"; + foreach ($assessments as $assessment) { + workshop_print_assessment($workshop, $assessment); + } + } + // only called from list all submissions + print_continue("submissions.php?action=listallsubmissions&id=$cm->id"); + } + + + /*********************** view assessment ***********************/ + elseif ($action == 'viewassessment') { + // get the assessment record + if (!$assessment = get_record("workshop_assessments", "id", $_GET['aid'])) { + error("Assessment record not found"); + } + + echo "
cellcontent\">"; + $submission = get_record("workshop_submissions", "id", $assessment->submissionid); + echo workshop_print_submission_title($workshop, $submission); + echo "

\n"; + + workshop_print_assessment($workshop, $assessment); + print_continue("view.php?a=$workshop->id"); + } + + + /*************** no man's land **************************************/ + else { + error("Fatal Error: Unknown Action: ".$action."\n"); + } + + print_footer($course); + +?> + diff --git a/mod/workshop/db/mysql.php b/mod/workshop/db/mysql.php new file mode 100644 index 0000000000..919c7d9281 --- /dev/null +++ b/mod/workshop/db/mysql.php @@ -0,0 +1,17 @@ + + diff --git a/mod/workshop/db/mysql.sql b/mod/workshop/db/mysql.sql new file mode 100644 index 0000000000..65ac98fa3b --- /dev/null +++ b/mod/workshop/db/mysql.sql @@ -0,0 +1,119 @@ +# +# Table structure for table `workshop` +# + +CREATE TABLE `prefix_workshop` ( + `id` int(10) unsigned NOT NULL auto_increment, + `course` int(10) unsigned NOT NULL default '0', + `name` varchar(255) NOT NULL default '', + `description` text NOT NULL, + `nelements` tinyint(3) unsigned NOT NULL default '10', + `phase` tinyint(2) unsigned NOT NULL default '0', + `format` tinyint(2) unsigned NOT NULL default '0', + `gradingstrategy` tinyint(2) unsigned NOT NULL default '1', + `resubmit` tinyint(2) unsigned NOT NULL default '0', + `graded` tinyint(2) unsigned NOT NULL default '1', + `showgrades` tinyint(2) unsigned NOT NULL default '0', + `anonymous` tinyint(2) unsigned NOT NULL default '0', + `includeself` tinyint(2) unsigned NOT NULL default '0', + `maxbytes` int(10) unsigned NOT NULL default '100000', + `deadline` int(10) unsigned NOT NULL default '0', + `grade` int(10) NOT NULL default '0', + `ntassessments` tinyint(3) unsigned NOT NULL default '0', + `nsassessments` tinyint(3) unsigned NOT NULL default '0', + `timemodified` int(10) unsigned NOT NULL default '0', + `mergegrades` tinyint(3) unsigned NOT NULL default '0', + `teacherweight` tinyint(3) unsigned NOT NULL default '5', + `peerweight` tinyint(3) unsigned NOT NULL default '5', + `includeteachersgrade` tinyint(3) unsigned NOT NULL default '0', + `biasweight` tinyint(3) unsigned NOT NULL default '5', + `reliabilityweight` tinyint(3) unsigned NOT NULL default '5', + `gradingweight` tinyint(3) unsigned NOT NULL default '5', + PRIMARY KEY (`id`) +) COMMENT='Defines workshop'; +# -------------------------------------------------------- + +# +# Table structure for table `workshop_submissions` +# + +CREATE TABLE `prefix_workshop_submissions` ( + `id` int(10) unsigned NOT NULL auto_increment, + `workshopid` int(10) unsigned NOT NULL default '0', + `userid` int(10) unsigned NOT NULL default '0', + `title` varchar(100) NOT NULL default '', + `timecreated` int(10) unsigned NOT NULL default '0', + `mailed` tinyint(2) unsigned NOT NULL default '0', + `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', + PRIMARY KEY (`id`), + INDEX `title` (`title`) +) COMMENT='Info about submitted work from teacher and students'; +# -------------------------------------------------------- + +# +# Table structure for table `workshop_assessments` +# + +CREATE TABLE `prefix_workshop_assessments` ( + `id` int(10) unsigned NOT NULL auto_increment, + `workshopid` int(10) unsigned NOT NULL default '0', + `submissionid` int(10) unsigned NOT NULL default '0', + `userid` int(10) unsigned NOT NULL default '0', + `timecreated` int(10) unsigned NOT NULL default '0', + `timegraded` int(10) unsigned NOT NULL default '0', + `grade` float NOT NULL default '0', + `gradinggrade` int(3) NOT NULL default '0', + `mailed` tinyint(2) unsigned NOT NULL default '0', + `generalcomment` text NOT NULL, + `teachercomment` text NOT NULL, + PRIMARY KEY (`id`) + ) COMMENT='Info about assessments by teacher and students'; +# -------------------------------------------------------- + +# +# Table structure for table `workshop_elements` +# + +CREATE TABLE `prefix_workshop_elements` ( + `id` int(10) unsigned NOT NULL auto_increment, + `workshopid` int(10) unsigned NOT NULL default '0', + `elementno` tinyint(3) unsigned NOT NULL default '0', + `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', + PRIMARY KEY (`id`) +) COMMENT='Info about marking scheme of assignment'; +# -------------------------------------------------------- + +# +# Table structure for table `workshop_grades` +# + +CREATE TABLE `prefix_workshop_grades` ( + `id` int(10) unsigned NOT NULL auto_increment, +# workshop not necessary just makes deleting instance easier + `workshopid` int(10) unsigned NOT NULL default '0', + `assessmentid` int(10) unsigned NOT NULL default '0', + `elementno` int(10) unsigned NOT NULL default '0', + `feedback` text NOT NULL default '', + `grade` tinyint(3) NOT NULL default '0', + PRIMARY KEY (`id`) +) COMMENT='Info about individual grades given to each element'; +# -------------------------------------------------------- + +INSERT INTO `prefix_log_display` VALUES ('workshop', 'assess', 'workshop', 'name'); +INSERT INTO `prefix_log_display` VALUES ('workshop', 'close', 'workshop', 'name'); +INSERT INTO `prefix_log_display` VALUES ('workshop', 'display grades', 'workshop', 'name'); +INSERT INTO `prefix_log_display` VALUES ('workshop', 'grade', 'workshop', 'name'); +INSERT INTO `prefix_log_display` VALUES ('workshop', 'hide grades', 'workshop', 'name'); +INSERT INTO `prefix_log_display` VALUES ('workshop', 'open', 'workshop', 'name'); +INSERT INTO `prefix_log_display` VALUES ('workshop', 'submit', 'workshop', 'name'); +INSERT INTO `prefix_log_display` VALUES ('workshop', 'view', 'workshop', 'name'); +INSERT INTO `prefix_log_display` VALUES ('workshop', 'update', 'workshop', 'name'); + diff --git a/mod/workshop/icon.gif b/mod/workshop/icon.gif new file mode 100644 index 0000000000..9d4baef465 Binary files /dev/null and b/mod/workshop/icon.gif differ diff --git a/mod/workshop/icon.png b/mod/workshop/icon.png new file mode 100644 index 0000000000..cbb8c2a61a Binary files /dev/null and b/mod/workshop/icon.png differ diff --git a/mod/workshop/icon2.gif b/mod/workshop/icon2.gif new file mode 100644 index 0000000000..a40a640ece Binary files /dev/null and b/mod/workshop/icon2.gif differ diff --git a/mod/workshop/icon2.png b/mod/workshop/icon2.png new file mode 100644 index 0000000000..466d4b785c Binary files /dev/null and b/mod/workshop/icon2.png differ diff --git a/mod/workshop/index.php b/mod/workshop/index.php new file mode 100644 index 0000000000..552f0f56bb --- /dev/null +++ b/mod/workshop/index.php @@ -0,0 +1,84 @@ +id); + add_to_log($course->id, "workshop", "view all", "index.php?id=$course->id", ""); + + if ($course->category) { + $navigation = "id\">$course->shortname ->"; + } + + $strworkshops = get_string("modulenameplural", "workshop"); + $strworkshop = get_string("modulename", "workshop"); + $strweek = get_string("week"); + $strtopic = get_string("topic"); + $strname = get_string("name"); + $strdeadline = get_string("deadline", "workshop"); + $strsubmitted = get_string("submitted", "assignment"); + + print_header("$course->shortname: $strworkshops", "$course->fullname", "$navigation $strworkshops", "", "", true, "", navmenu($course)); + + if (! $workshops = get_all_instances_in_course("workshop", $course->id, "cw.section ASC")) { + notice("There are no workshops", "../../course/view.php?id=$course->id"); + die; + } + + $timenow = time(); + + if ($course->format == "weeks") { + $table->head = array ($strweek, $strname, $strdeadline, $strsubmitted); + $table->align = array ("CENTER", "LEFT", "LEFT", "LEFT"); + } else if ($course->format == "topics") { + $table->head = array ($strtopic, $strname, $strdeadline, $strsubmitted); + $table->align = array ("CENTER", "LEFT", "LEFT", "LEFT"); + } else { + $table->head = array ($strname, $strdeadline, $strsubmitted); + $table->align = array ("LEFT", "LEFT", "LEFT"); + } + + foreach ($workshops as $workshop) { + if ($submissions = workshop_get_user_submissions($workshop, $USER)) { + foreach ($submissions as $submission) { + if ($submission->timecreated <= $workshop->deadline) { + $submitted = userdate($submission->timecreated); + } + else { + $submitted = "".userdate($submission->timecreated).""; + } + $due = userdate($workshop->deadline); + $link = "coursemodule\">$workshop->name
". + "($submission->title)"; + if ($course->format == "weeks" or $course->format == "topics") { + $table->data[] = array ($workshop->section, $link, $due, $submitted); + } + else { + $table->data[] = array ($link, $due, $submitted); + } + } + } + else { + $submitted = get_string("no"); + $due = userdate($workshop->deadline); + $link = "coursemodule\">$workshop->name"; + if ($course->format == "weeks" or $course->format == "topics") { + $table->data[] = array ($workshop->section, $link, $due, $submitted); + } + else { + $table->data[] = array ($link, $due, $submitted); + } + } + } + echo "
"; + + print_table($table); + + print_footer($course); +?> diff --git a/mod/workshop/lib.php b/mod/workshop/lib.php new file mode 100644 index 0000000000..8e70a8a7b7 --- /dev/null +++ b/mod/workshop/lib.php @@ -0,0 +1,2049 @@ +dirroot/files/mimetypes.php"); + +/*** Constants **********************************/ + +$WORKSHOP_TYPE = array (0 => get_string("notgraded", "workshop"), + 1 => get_string("accumulative", "workshop"), + 2 => get_string("errorbanded", "workshop"), + 3 => get_string("criteria", "workshop") ); + +$WORKSHOP_SHOWGRADES = array (0 => get_string("dontshowgrades", "workshop"), + 1 => get_string("showgrades", "workshop") ); + +$WORKSHOP_SCALES = array( + 0 => array( 'name' => get_string("scaleyes", "workshop"), 'type' => 'radio', 'size' => 2, 'start' => 'yes', 'end' => 'no'), + 1 => array( 'name' => get_string("scalepresent", "workshop"), 'type' => 'radio', 'size' => 2, 'start' => 'present', 'end' => 'absent'), + 2 => array( 'name' => get_string("scalecorrect", "workshop"), 'type' => 'radio', 'size' => 2, 'start' => 'correct', 'end' => 'incorrect'), + 3 => array( 'name' => get_string("scalegood3", "workshop"), 'type' => 'radio', 'size' => 3, 'start' => 'good', 'end' => 'poor'), + 4 => array( 'name' => get_string("scaleexcellent4", "workshop"), 'type' => 'radio', 'size' => 4, 'start' => 'excellent', 'end' => 'very poor'), + 5 => array( 'name' => get_string("scaleexcellent5", "workshop"), 'type' => 'radio', 'size' => 5, 'start' => 'excellent', 'end' => 'very poor'), + 6 => array( 'name' => get_string("scaleexcellent7", "workshop"), 'type' => 'radio', 'size' => 7, 'start' => 'excellent', 'end' => 'very poor'), + 7 => array( 'name' => get_string("scale10", "workshop"), 'type' => 'selection', 'size' => 10), + 8 => array( 'name' => get_string("scale20", "workshop"), 'type' => 'selection', 'size' => 20), + 9 => array( 'name' => get_string("scale100", "workshop"), 'type' => 'selection', 'size' => 100)); + +$WORKSHOP_EWEIGHTS = array( 0 => -4.0, 1 => -2.0, 2 => -1.5, 3 => -1.0, 4 => -0.75, 5 => -0.5, 6 => -0.25, + 7 => 0.0, 8 => 0.25, 9 => 0.5, 10 => 0.75, 11=> 1.0, 12 => 1.5, 13=> 2.0, 14 => 4.0); + +$WORKSHOP_FWEIGHTS = array( 0 => 0, 1 => 0.1, 2 => 0.25, 3 => 0.5, 4 => 0.75, 5 => 1, 6 => 1.5, + 7 => 2.0, 8 => 3.0, 9 => 5.0, 10 => 7.5, 11=> 10.0); + +define("COMMENTSCALE", 20); + +/*** Standard Moodle functions ****************** +function workshop_add_instance($workshop) +function workshop_update_instance($workshop) +function workshop_delete_instance($id) +function workshop_user_outline($course, $user, $mod, $workshop) +function workshop_user_complete($course, $user, $mod, $workshop) +function workshop_cron () +function workshop_print_recent_activity(&$logs, $isteacher=false) +function workshop_grades($workshopid) +**********************************************/ + +function workshop_add_instance($workshop) { +// Given an object containing all the necessary data, +// (defined by the form in mod.html) this function +// will create a new instance and return the id number +// of the new instance. + + $workshop->timemodified = time(); + + $workshop->deadline = make_timestamp($workshop->deadlineyear, + $workshop->deadlinemonth, $workshop->deadlineday, $workshop->deadlinehour, + $workshop->deadlineminute); + + return insert_record("workshop", $workshop); +} + + +function workshop_choose_from_menu ($options, $name, $selected="", $nothing="choose", $script="", $nothingvalue="0", $return=false) { +/// Given an array of value, creates a popup menu to be part of a form +/// $options["value"]["label"] + + if ($nothing == "choose") { + $nothing = get_string("choose")."..."; + } + + if ($script) { + $javascript = "onChange=\"$script\""; + } else { + $javascript = ""; + } + + $output = " + + +
+ + id, "elementno ASC")) { + print_string("noteonassignmentelements", "workshop"); + } + else { + foreach ($elementsraw as $element) { + $elements[] = $element; // to renumber index 0,1,2... + } + } + + // get any previous grades... + if ($gradesraw = get_records_select("workshop_grades", "assessmentid = $assessment->id", "elementno")) { + foreach ($gradesraw as $grade) { + $grades[] = $grade; // to renumber index 0,1,2... + } + } + + // determine what sort of grading + switch ($workshop->gradingstrategy) { + case 0: // no grading + // now print the form + for ($i=0; $i < count($elements); $i++) { + $iplus1 = $i+1; + echo "\n"; + echo " \n"; + echo " \n"; + echo "\n"; + echo " \n"; + echo " \n"; + echo "\n"; + echo "\n"; + echo " \n"; + echo "\n"; + } + break; + + case 1: // accumulative grading + // now print the form + for ($i=0; $i < count($elements); $i++) { + $iplus1 = $i+1; + echo "\n"; + echo " \n"; + echo " \n"; + echo "\n"; + echo " \n"; + echo " \n"; + echo "\n"; + echo "\n"; + echo " \n"; + echo " \n"; + echo "\n"; + echo "\n"; + echo " \n"; + echo "\n"; + } + break; + + case 2: // error banded grading + // now run through the elements + $negativecount = 0; + for ($i=0; $i < count($elements) - 1; $i++) { + $iplus1 = $i+1; + echo "\n"; + echo " \n"; + echo " \n"; + echo "\n"; + echo " \n"; + echo " \n"; + echo "\n"; + echo "\n"; + echo " \n"; + echo " \n"; + echo "\n"; + echo "\n"; + echo " \n"; + echo "\n"; + if (empty($grades[$i]->grade)) { + $negativecount++; + } + } + // print the number of negative elements + // echo "\n"; + // echo "\n"; + // echo " \n"; + echo "

". get_string("element","workshop")." $iplus1:

".text_to_html($elements[$i]->description); + echo "

". get_string("feedback").":

\n"; + if ($allowchanges) { + echo " \n"; + } + else { + echo text_to_html($grades[$i]->feedback); + } + echo "
cellheading2\"> 

". get_string("element","workshop")." $iplus1:

".text_to_html($elements[$i]->description); + echo "

Weight: " + .number_format($WORKSHOP_EWEIGHTS[$elements[$i]->weight],2)."\n"; + echo "

". get_string("grade"). ":

\n"; + + // get the appropriate scale + $scalenumber=$elements[$i]->scale; + $SCALE = (object)$WORKSHOP_SCALES[$scalenumber]; + switch ($SCALE->type) { + case 'radio' : + // show selections highest first + echo "
$SCALE->start   "; + for ($j = $SCALE->size - 1; $j >= 0 ; $j--) { + $checked = false; + if (isset($grades[$i]->grade)) { + if ($j == $grades[$i]->grade) { + $checked = true; + } + } + else { // there's no previous grade so check the lowest option + if ($j == 0) { + $checked = true; + } + } + if ($checked) { + echo "    \n"; + } + else { + echo "    \n"; + } + } + echo "   $SCALE->end
\n"; + break; + case 'selection' : + unset($numbers); + for ($j = $SCALE->size; $j >= 0; $j--) { + $numbers[$j] = $j; + } + if (isset($grades[$i]->grade)) { + choose_from_menu($numbers, "grade[$i]", $grades[$i]->grade, ""); + } + else { + choose_from_menu($numbers, "grade[$i]", 0, ""); + } + break; + } + + echo "

". get_string("feedback").":

\n"; + if ($allowchanges) { + echo " \n"; + } + else { + echo text_to_html($grades[$i]->feedback); + } + echo "
cellheading2\"> 

". get_string("element","workshop")." $iplus1:

".text_to_html($elements[$i]->description); + echo "

Weight: " + .number_format($WORKSHOP_EWEIGHTS[$elements[$i]->weight],2)."\n"; + echo "

". get_string("grade"). ":

\n"; + + // get the appropriate scale - yes/no scale (0) + $SCALE = (object) $WORKSHOP_SCALES[0]; + switch ($SCALE->type) { + case 'radio' : + // show selections highest first + echo "
$SCALE->start   "; + for ($j = $SCALE->size - 1; $j >= 0 ; $j--) { + $checked = false; + if (isset($grades[$i]->grade)) { + if ($j == $grades[$i]->grade) { + $checked = true; + } + } + else { // there's no previous grade so check the lowest option + if ($j == 0) { + $checked = true; + } + } + if ($checked) { + echo "    \n"; + } + else { + echo "    \n"; + } + } + echo "   $SCALE->end
\n"; + break; + case 'selection' : + unset($numbers); + for ($j = $SCALE->size; $j >= 0; $j--) { + $numbers[$j] = $j; + } + if (isset($grades[$i]->grade)) { + choose_from_menu($numbers, "grade[$i]", $grades[$i]->grade, ""); + } + else { + choose_from_menu($numbers, "grade[$i]", 0, ""); + } + break; + } + + echo "

". get_string("feedback").":

\n"; + if ($allowchanges) { + echo " \n"; + } + else { + if (isset($grades[$i]->feedback)) { + echo text_to_html($grades[$i]->feedback); + } + } + echo " 
cellheading2\"> 
".get_string("numberofnegativeitems", "workshop")."$negativecount
cellheading2\"> 
\n"; + // now print the grade table + echo "

".get_string("gradetable","workshop")."
\n"; + echo "
\n"; + for ($j = 100; $j >= 0; $j--) { + $numbers[$j] = $j; + } + for ($i=0; $i<=$workshop->nelements; $i++) { + if ($i == $negativecount) { + echo "\n"; + } + else { + echo "\n"; + } + } + echo "
". + get_string("numberofnegativeresponses", "workshop"); + echo "". get_string("suggestedgrade", "workshop")."
$i{$elements[$i]->maxscore}
$i{$elements[$i]->maxscore}
\n"; + echo "

\n"; + break; + + case 3: // criteria grading + echo "\n"; + echo " \n"; + echo " \n"; + echo " \n"; + echo " \n"; + // find which criteria has been selected (saved in the zero element), if any + if (isset($grades[0]->grade)) { + $selection = $grades[0]->grade; + } + else { + $selection = 0; + } + // now run through the elements + for ($i=0; $i < count($elements); $i++) { + $iplus1 = $i+1; + echo "\n"; + echo " \n"; + if ($selection == $i) { + echo " \n"; + } + else { + echo " \n"; + } + echo "\n"; + } + echo "
".get_string("adjustment", "workshop")."\n"; + unset($numbers); + for ($j = 20; $j >= -20; $j--) { + $numbers[$j] = $j; + } + if (isset($grades[$workshop->nelements]->grade)) { + choose_from_menu($numbers, "grade[$workshop->nelements]", $grades[$workshop->nelements]->grade, ""); + } + else { + choose_from_menu($numbers, "grade[$workshop->nelements]", 0, ""); + } + echo "
cellheading2\"> cellheading2\">". get_string("criterion","workshop")."cellheading2\">".get_string("select", "workshop")."cellheading2\">".get_string("suggestedgrade", "workshop")."
$iplus1".text_to_html($elements[$i]->description)."{$elements[$i]->maxscore}
\n"; + echo "

\n"; + } // end of outer switch + + // now get the general comment (present in all types) + echo "\n"; + echo " \n"; + echo " \n"; + echo "\n"; + echo "\n"; + echo " \n"; + echo "\n"; + + $timenow = time(); + // now show the teacher's comment if available... + if ($assessment->timegraded and (($timenow - $assessment->timegraded) > $CFG->maxeditingtime)) { + echo "\n"; + echo " \n"; + echo " \n"; + echo "\n"; + echo "\n"; + echo " \n"; + echo " \n"; + echo "\n"; + echo "\n"; + echo " \n"; + echo "\n"; + } + + // ...and close the table, show submit button if needed and close the form + echo "
".get_string("adjustment", "workshop")."\n"; + unset($numbers); + for ($j = 20; $j >= -20; $j--) { + $numbers[$j] = $j; + } + if (isset($grades[1]->grade)) { + choose_from_menu($numbers, "grade[1]", $grades[1]->grade, ""); + } + else { + choose_from_menu($numbers, "grade[1]", 0, ""); + } + echo "

". get_string("generalcomment", "workshop").":

\n"; + if ($allowchanges) { + echo " \n"; + } + else { + if (isset($assessment->generalcomment)) { + echo text_to_html($assessment->generalcomment); + } + } + echo " 
cellheading2\"> 

". get_string("teacherscomment", "workshop").":

\n"; + echo text_to_html($assessment->teachercomment); + echo " 

". get_string("teachersgrade", "workshop").":

\n"; + echo number_format($assessment->gradinggrade*100/COMMENTSCALE,0)."%"; + echo " 
cellheading2\"> 
\n"; + if ($allowchanges) { + echo "\n"; + } + echo "
"; + echo "\n"; + } + + +function workshop_print_difference($time) { + if ($time < 0) { + $timetext = get_string("late", "assignment", format_time($time)); + return " ($timetext)"; + } else { + $timetext = get_string("early", "assignment", format_time($time)); + return " ($timetext)"; + } +} + +function workshop_print_feedback($course, $submission) { + global $CFG, $THEME, $RATING; + + if (! $teacher = get_record("user", "id", $submission->teacher)) { + error("Weird workshop error"); + } + + echo "\n
"; + echo "\n"; + + echo "\n"; + echo "\n"; + echo ""; + + echo "\n
body\" WIDTH=35 VALIGN=TOP>"; + print_user_picture($teacher->id, $course->id, $teacher->picture); + echo "cellheading\">$teacher->firstname $teacher->lastname"; + echo "  ".userdate($submission->timemarked).""; + echo "
cellcontent\">"; + + echo "

"; + if ($submission->grade) { + echo get_string("grade").": $submission->grade"; + } else { + echo get_string("nograde"); + } + echo "

"; + + echo text_to_html($submission->assessorcomment); + echo "
"; + echo "
"; +} + + +function workshop_print_submission_assessments($workshop, $submission, $type) { + // Returns the teacher or peer grade and a hyperlinked list of grades for this submission + + if ($assessments = workshop_get_assessments($submission)) { + switch ($type) { + case "teacher" : + $str = "$submission->teachergrade ("; + foreach ($assessments as $assessment) { + if (isteacher($workshop->course, $assessment->userid)) { + $str .= "id&aid=$assessment->id\">"; + $str .= number_format($assessment->grade, 1)." "; + } + } + break; + case "student" : + $str = "$submission->peergrade ("; + foreach ($assessments as $assessment) { + if (isstudent($workshop->course, $assessment->userid)) { + $str .= "id&aid=$assessment->id\">"; + $str .= number_format($assessment->grade, 1)." "; + } + } + break; + } + $str .= ")"; + } + else { + $str ="0"; + } + return $str; +} + + +function workshop_print_submission_title($workshop, $submission) { +// Arguments are objects + + global $CFG; + + if (!$submission->timecreated) { // a "no submission" + return $submission->title; + } + + $filearea = workshop_file_area_name($workshop, $submission); + if ($basedir = workshop_file_area($workshop, $submission)) { + if (list($file) = get_directory_list($basedir)) { + $icon = mimeinfo("icon", $file); + if ($CFG->slasharguments) { + $ffurl = "file.php/$filearea/$file"; + } else { + $ffurl = "file.php?file=/$filearea/$file"; + } + return "wwwroot/files/pix/$icon\" HEIGHT=16 WIDTH=16 BORDER=0 ALT=\"File\">". + " wwwroot/$ffurl\">$submission->title"; + } + } +} + + +function workshop_print_user_assessments($workshop, $user) { + // Returns the number of assessments and a hyperlinked list of grading grades for the assessments made by this user + + if ($assessments = workshop_get_user_assessments($workshop, $user)) { + $n = count($assessments); + $str = "$n ("; + foreach ($assessments as $assessment) { + if ($assessment->timegraded) { + $gradingscaled = intval($assessment->gradinggrade * $workshop->grade / COMMENTSCALE); + $str .= "id&aid=$assessment->id\">"; + $str .= "$gradingscaled "; + } + else { + $str .= "id&aid=$assessment->id\">"; + $str .= "- "; + } + } + $str .= ")"; + } + else { + $str ="0"; + } + return $str; + } + + +function workshop_print_time_to_deadline($time) { + if ($time < 0) { + $timetext = get_string("afterdeadline", "workshop", format_time($time)); + return " ($timetext)"; + } else { + $timetext = get_string("beforedeadline", "workshop", format_time($time)); + return " ($timetext)"; + } +} + + +function workshop_print_upload_form($workshop) { +// Arguments are objects, needs title coming in + + echo "
"; + echo "
"; + echo " maxbytes\">"; + echo " id\">"; + echo get_string("title", "workshop")."

\n"; + echo " "; + echo " "; + echo "
"; + echo "
"; +} + +function workshop_test_user_assessments($workshop, $user) { + // see if user has passed the required number of assessments of teachers submissions + global $CFG; + + $result = TRUE; + $n = 0; + $timenow =time(); + if ($workshop->ntassessments) { // they have to pass some! + if ($submissions = workshop_get_teacher_submissions($workshop)) { + foreach ($submissions as $submission) { + if ($assessment = workshop_get_submission_assessment($submission, $user)) { + if (($assessment->gradinggrade >= COMMENTSCALE*0.4) and + (($timenow - $assessment->timegraded) > $CFG->maxeditingtime)) { + $n++; + } + } + } + } + if ($n < min($workshop->ntassessments, workshop_count_teacher_submissions($workshop))) { + $result = FALSE; + } + } + return $result; + } + +?> diff --git a/mod/workshop/mod.html b/mod/workshop/mod.html new file mode 100644 index 0000000000..cd17c94e08 --- /dev/null +++ b/mod/workshop/mod.html @@ -0,0 +1,189 @@ + + +
action=""> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

:

+ +

:

+ description); + + if ($usehtmleditor) { + helpbutton("richtext", get_string("helprichtext")); + } else { + helpbutton("text", get_string("helptext")); + } + echo "

"; + print_string("formattexttype"); + echo ": "; + if (!$form->format) { + $form->format = $defaultformat; + } + choose_from_menu(format_text_menu(), "format", $form->format, ""); + helpbutton("textformat", get_string("formattexttype")); + echo "

"; + ?> +

:

+ =0; $i--) { + $grades[$i] = $i; + } + choose_from_menu($grades, "grade", "$form->grade", ""); + ?> +

:

+ dirroot/mod/workshop/lib.php"); + if (!isset($form->gradingstrategy)) { + $form->gradingstrategy = 1; // default + } + choose_from_menu($WORKSHOP_TYPE, "gradingstrategy", $form->gradingstrategy, ""); + helpbutton("gradingstrategy", get_string("gradingstrategy", "workshop"), "workshop"); + ?> +

:

+ =0; $i--) { + $numbers[$i] = $i; + } + choose_from_menu($numbers, "nelements", "$form->nelements", ""); + helpbutton("nelements", get_string("numberofassessmentelements", "workshop"), "workshop"); + ?> +

:

+ resubmit, ""); + helpbutton("resubmit", get_string("allowresubmit", "workshop"), "workshop"); + ?> +

:

+ =0; $i--) { + $numbers[$i] = $i; + } + choose_from_menu($numbers, "ntassessments", $form->ntassessments, ""); + helpbutton("nassessmentsofteachersexamples", get_string("numberofassessmentsofteachersexamples", "workshop"), "workshop"); + ?> +

:

+ =0; $i--) { + $numbers[$i] = $i; + } + choose_from_menu($numbers, "nsassessments", $form->nsassessments, ""); + helpbutton("nassessmentsofstudentsubmissions", get_string("numberofassessmentsofstudentsubmissions", "workshop"), "workshop"); + ?> +

:

+ includeself, ""); + helpbutton("selfassessment", get_string("selfassessment", "workshop"), "workshop"); + ?> +

:

+ maxbytes == $sizebytes) { + $sizeinlist = true; + } + } + $filesize[$maxsize] = display_size($maxsize); + if (!$sizeinlist) { + $form->maxbytes = get_real_size("500K"); + } + ksort($filesize, SORT_NUMERIC); + choose_from_menu($filesize, "maxbytes", "$form->maxbytes", ""); + ?> +

:

deadline); + echo " - "; + print_time_selector("deadlinehour", "deadlineminute", $form->deadline); + formerr($err["deadline"]); + ?>
+
+
+ + + + + + + +"> +"> +

+

+ +

+
+ + + diff --git a/mod/workshop/submissions.php b/mod/workshop/submissions.php new file mode 100644 index 0000000000..8812390a78 --- /dev/null +++ b/mod/workshop/submissions.php @@ -0,0 +1,758 @@ +course)) { + error("Course is misconfigured"); + } + + if (! $workshop = get_record("workshop", "id", $cm->instance)) { + error("Course module is incorrect"); + } + + } else { + if (! $workshop = get_record("workshop", "id", $a)) { + error("Course module is incorrect"); + } + if (! $course = get_record("course", "id", $workshop->course)) { + error("Course is misconfigured"); + } + if (! $cm = get_coursemodule_from_instance("workshop", $workshop->id, $course->id)) { + error("Course Module ID was incorrect"); + } + } + + require_login($course->id); + + if ($course->category) { + $navigation = "id\">$course->shortname ->"; + } + + $strworkshops = get_string("modulenameplural", "workshop"); + $strworkshop = get_string("modulename", "workshop"); + $strsubmissions = get_string("submissions", "workshop"); + + // ... print the header and... + print_header("$course->shortname: $workshop->name", "$course->fullname", + "$navigation id>$strworkshops -> + id\">$workshop->name -> $strsubmissions", + "", "", true); + + //...get the action or set up an suitable default + optional_variable($action); + if (empty($action)) { + $action = "listallsubmissions"; + } + + + /*************** calculate final grades (by teacher) ***************************/ + if ($action == 'calculatefinalgrades') { + + $form = (object)$_POST; + + if (!isteacher($course->id)) { + error("Only teachers can look at this page"); + } + + // Get all the students in surname order + if (!$users = get_course_students($course->id, "u.firstname, u.lastname")) { + print_heading(get_string("nostudentsyet")); + print_footer($course); + exit; + } + + // set up the weights from the calculate final grades form... + if (isset($form->teacherweight)) { + $teacherweight = $form->teacherweight; + // ...and save them + set_field("workshop", "teacherweight", $teacherweight, "id", "$workshop->id"); + } + + if (isset($form->peerweight)) { + $peerweight = $form->peerweight; + // ...and save them + set_field("workshop", "peerweight", $peerweight, "id", "$workshop->id"); + } + + // get the include teachers grade flag + if (isset($form->includeteachersgrade)) { + $includeteachersgrade = $form->includeteachersgrade; + set_field("workshop", "includeteachersgrade", $includeteachersgrade, "id", "$workshop->id"); + } + + if (isset($form->biasweight)) { + $biasweight = $form->biasweight; + // ...and save them + set_field("workshop", "biasweight", $biasweight, "id", "$workshop->id"); + } + + if (isset($form->reliabilityweight)) { + $reliabilityweight = $form->reliabilityweight; + // ...and save them + set_field("workshop", "reliabilityweight", $reliabilityweight, "id", "$workshop->id"); + } + + if (isset($form->gradingweight)) { + $gradingweight = $form->gradingweight; + // ...and save them + set_field("workshop", "gradingweight", $gradingweight, "id", "$workshop->id"); + } + + // work out what to show in the final grades tables and what to include in the calculation of the final grade + // teacher grades? + if ($workshop->gradingstrategy and $teacherweight) { + $useteachersgrades = 1; + } + else { + $useteachersgrades = 0; + } + // peergrades? + if ($workshop->gradingstrategy and $workshop->nsassessments and $peerweight) { + $usepeergrades = 1; + } + else { + $usepeergrades = 0; + } + // bias grades? + if ((($workshop->ntassessments >= 3) or ($workshop->nsassessments >= 3)) and ($useteachersgrades or $usepeergrades) + and $biasweight ) { + $usebiasgrades = 1; + } + else { + $usebiasgrades = 0; + } + // reliability grades? + if ((($workshop->ntassessments >= 3) or ($workshop->nsassessments >= 3)) and ($useteachersgrades or $usepeergrades) + and $reliabilityweight ) { + $usereliabilitygrades = 1; + } + else { + $usereliabilitygrades = 0; + } + // grading grades? + if (($workshop->ntassessments or $workshop->nsassessments) and $gradingweight ) { + $usegradinggrades = 1; + } + else { + $usegradinggrades = 0; + } + + // start to calculate the grand means + $sumallteachergrades = 0.0; + $nallteachergrades = 0; + $sumallpeergrades = 0.0; + $nallpeergrades = 0; + // get the grades of each student's submission... + // the method used allowed a submission to be graded by more than one teacher + if (workshop_count_student_submissions($workshop)) { + echo "
".get_string("studentsubmissions", "workshop", $course->student); + echo "
\n"; + echo "\n"; + echo "\n"; + if ($useteachersgrades) { + echo "\n"; + echo "\n"; + } + if ($usepeergrades) { + echo "\n"; + echo "\n"; + } + if ($useteachersgrades or $usepeergrades) { + echo "\n"; + } + // display weights + echo "\n"; + echo "\n"; + if ($useteachersgrades) { + echo "\n"; + } + if ($usepeergrades) { + echo "\n"; + } + if ($useteachersgrades or $usepeergrades) { + echo "\n"; + } + echo "\n"; + // go through the submissions in "user" order, makes comparing the two tables easier + foreach ($users as $user) { + if ($submissions = workshop_get_user_submissions($workshop, $user)) { + foreach ($submissions as $submission) { + $sumteachergrades = 0.0; + $nteachergrades = 0; + $sumpeergrades = 0.0; + $npeergrades = 0; + // have a look at each assessment and add to arrays + if ($assessments = workshop_get_assessments($submission)) { + foreach ($assessments as $assessment) { + if (isteacher($workshop->course, $assessment->userid)) { + // it's a teacher's + $sumteachergrades += $assessment->grade; + $nteachergrades++; + if ($includeteachersgrade) { // add it to the student grades + $sumpeergrades += $assessment->grade; + $npeergrades++; + } + } + else { + // its' a student's + $sumpeergrades += $assessment->grade; + $npeergrades++; + } + } + } + if ($nteachergrades) { + $teachergrade = intval($sumteachergrades / $nteachergrades + 0.5); + $sumallteachergrades += $teachergrade; + $nallteachergrades++; + } + else { + $teachergrade = 0; + } + if ($npeergrades) { + $peergrade = intval($sumpeergrades / $npeergrades + 0.5); + $sumallpeergrades += $peergrade; + $nallpeergrades++; + } + else { + $peergrade = 0; + } + if ($teacherweight + $peerweight > 0) { + $grade = intval((($useteachersgrades * $teachergrade * $WORKSHOP_FWEIGHTS[$teacherweight] + + $usepeergrades * $peergrade * $WORKSHOP_FWEIGHTS[$peerweight]) / + ($useteachersgrades * $WORKSHOP_FWEIGHTS[$teacherweight] + + $usepeergrades * $WORKSHOP_FWEIGHTS[$peerweight])) + 0.5); + } + else { + $grade = 0; + } + // display the grades... + echo "\n"; + echo "\n"; + if ($useteachersgrades) { + echo "\n"; + echo "\n"; + } + if ($usepeergrades) { + echo "\n"; + echo "\n"; + } + if ($useteachersgrades or $usepeergrades) { + echo "\n"; + } + // ...and save in the database + set_field("workshop_submissions", "teachergrade", $teachergrade, "id", $submission->id); + set_field("workshop_submissions", "peergrade", $peergrade, "id", $submission->id); + } + } + } + echo "
cellheading2\">$course->studentcellheading2\">".get_string("submissions","workshop")."cellheading2\">".get_string("assessmentsby", "workshop", $course->teachers)."cellheading2\">".get_string("numberofassessments", "workshop")."cellheading2\">".get_string("assessmentsby", "workshop", $course->students)."cellheading2\">".get_string("numberofassessments", "workshop")."cellheading2\">".get_string("gradeofsubmission", "workshop")."
cellheading2\">".get_string("weights","workshop")."cellheading2\"> cellheading2\">
$WORKSHOP_FWEIGHTS[$teacherweight]
cellheading2\">
$WORKSHOP_FWEIGHTS[$peerweight]
cellheading2\"> 
$user->firstname $user->lastname".workshop_print_submission_title($workshop, $submission)."$teachergrade[$nteachergrades]$peergrade[$npeergrades]$grade
\n"; + } + // now display the overall teacher and peer means + if ($nallteachergrades) { + $grandteachergrade = $sumallteachergrades / $nallteachergrades; + } + else { + $grandteachergrade = 0; + } + if ($nallpeergrades) { + $grandpeergrade = $sumallpeergrades / $nallpeergrades; + } + else { + $grandpeergrade = 0; + } + if ($useteachersgrades) { + echo "

".get_string("overallteachergrade", "workshop", number_format($grandteachergrade, 2))." [$nallteachergrades]\n"; + } + if ($usepeergrades) { + echo "

".get_string("overallpeergrade", "workshop", number_format($grandpeergrade, 2))." [$nallpeergrades]
\n"; + } + // run thru each users and see how their assessments faired, we may junk the grading stats but what the heck! + foreach ($users as $user) { + // we need to calculate a user bias before we can calculate their reliability + $sumbias = 0.0; + // nbias is used later to show how many peer assessments the user has done + $nbias[$user->id] = 0; + if ($workshop->nsassessments) { // peer assessments? + // run thru this user's assessments on the STUDENT submissions + if ($assessments = workshop_get_student_assessments($workshop, $user)) { + foreach ($assessments as $assessment) { + $submission = get_record("workshop_submissions", "id", $assessment->submissionid); + // calculate the sum of "validity" values, the bias in a user's grading... + $sumbias += $submission->peergrade - $assessment->grade; + $nbias[$user->id]++; + } + } + } + if ($nbias[$user->id] > 1) { + // we could divide by n-1 to remove own score from calculation of mean but we don't because we re-use bias + // values in the calculation of reliability, and it's all relative anyway + $bias[$user->id] = $sumbias / $nbias[$user->id]; + } + else { + $bias[$user->id] = 0.0; + } + // now look at all the user's assessments of both the TEACHER's submissions and the STUDENT submissions + // to calculate their overall grading grade + $sumgradinggrade = 0.0; + $ngradinggrades = 0; + if ($workshop->ntassessments or $workshop->nsassessments) { // worth looking? + if ($assessments = workshop_get_user_assessments($workshop, $user)) { + foreach ($assessments as $assessment) { + if ($assessment->timegraded > 0) { + $sumgradinggrade += $assessment->gradinggrade; + $ngradinggrades++; + } + } + } + } + if ($ngradinggrades) { + $gradinggrade[$user->id] = $sumgradinggrade / $ngradinggrades; + } + else { + $gradinggrade[$user->id] = 0.0; + } + } + + // calculate the mean value of "reliability", the accuracy of a user's grading (disregarding bias) + // use a linear function rather than a squared function for reliability + // at the same time calculate a reliability of a "dumb user" whose grades everything at the grand mean value + $sumdumbreliability = 0.0; + $ndumbreliability =0; + foreach ($users as $user) { + $sumreliability = 0.0; + $nreliability = 0; + if ($workshop->nsassessments) { // worth a look? + // look only at the user's assessment of STUDENT submissions + if ($assessments = workshop_get_student_assessments($workshop, $user)) { + foreach ($assessments as $assessment) { + $submission = get_record("workshop_submissions", "id", $assessment->submissionid); + $sumreliability += abs($submission->peergrade - $assessment->grade - $bias[$user->id]); + $nreliability++; + $sumdumbreliability += abs($submission->peergrade - $grandpeergrade); + $ndumbreliability++; + } + } + } + // calculate the mean reliability values + if ($nreliability) { + $reliability[$user->id] = $sumreliability / $nreliability; + } + else { + $reliability[$user->id] = 999999; // big number + } + } + if ($ndumbreliability) { + $dumbreliability = $sumdumbreliability / $ndumbreliability; + } + else { + $dumbreliability = 999999; // big number + } + + // convert bias and reliability values into scales where 1 is prefect, 0 is no grading done... + // ...but first find the largest (absolute) value of the bias measures + if (max($bias) > abs(min($bias))) { + $maxbias = max($bias); + } + else { + $maxbias = abs(min($bias)); + } + + echo "

".get_string("studentgrades", "workshop", $course->student)."
\n"; + echo "
+ \n"; + if ($useteachersgrades) { + echo "\n"; + } + if ($usepeergrades) { + echo "\n"; + } + if ($usebiasgrades) { + echo "\n"; + } + if ($usereliabilitygrades) { + echo "\n"; + } + if ($usegradinggrades) { + echo "\n"; + } + echo "\n"; + // now display the weights + echo "\n"; + if ($useteachersgrades) { + echo "\n"; + } + if ($usepeergrades) { + echo "\n"; + } + if ($usebiasgrades) { + echo "\n"; + } + if ($usereliabilitygrades) { + echo "\n"; + } + if ($usegradinggrades) { + echo "\n"; + } + echo "\n"; + foreach ($users as $user) { + // get user's best submission + $bestgrade = -1; + $teachergrade = 0; + $peergrade = 0; + if ($submissions = workshop_get_user_submissions($workshop, $user)) { + foreach ($submissions as $submission) { + $grade = ($submission->teachergrade * $WORKSHOP_FWEIGHTS[$teacherweight] + + $submission->peergrade * $WORKSHOP_FWEIGHTS[$peerweight]) / + ($WORKSHOP_FWEIGHTS[$teacherweight] + $WORKSHOP_FWEIGHTS[$peerweight]); + if ($grade > $bestgrade) { + $bestgrade = $grade; + $teachergrade = $submission->teachergrade; + $peergrade = $submission->peergrade; + $bestsubmission = $submission; + } + } + } + else { // funny this user did not submit - create a dummy submission to hold any grades they might have + $bestsubmission->workshopid = $workshop->id; + $bestsubmission->userid = $user->id; + $bestsubmission->title = "No Submission"; + $bestsubmission->timecreated = 0; + if (!$bestsubmission->id = insert_record("workshop_submissions", $bestsubmission)) { + error("Unable to create dummy submission record"); + } + } + // biasgrade is scaled between zero and one NEED TO ADD TEST FOR NO PEER ASSESSMENTS OF SUBMITTED WORK + if ($maxbias) { + $biasgrade = max(($nbias[$user->id] / $workshop->nsassessments) - (abs($bias[$user->id]) / $maxbias), + 0.0); + } + else { + $biasgrade = 0; + } + // reliabilitygrade is scaled between zero and one + + if ($dumbreliability and $workshop->nsassessments) { + // nbias used here as it contains the number of assessments the user has done + $reliabilitygrade = max(($nbias[$user->id] / $workshop->nsassessments) - + ($reliability[$user->id] / $dumbreliability), 0.0); + } + else { + $reliabilitygrade = 0; + } + $biasscaled = intval($biasgrade * $workshop->grade + 0.5); + $reliabilityscaled = intval($reliabilitygrade * $workshop->grade + 0.5); + $gradingscaled = intval($gradinggrade[$user->id] * $workshop->grade / COMMENTSCALE + 0.5); + $finalgrade = intval((($teachergrade * $WORKSHOP_FWEIGHTS[$teacherweight] * $useteachersgrades) + + ($peergrade * $WORKSHOP_FWEIGHTS[$peerweight] * $usepeergrades) + + ($biasscaled * $WORKSHOP_FWEIGHTS[$biasweight] * $usebiasgrades) + + ($reliabilityscaled * $WORKSHOP_FWEIGHTS[$reliabilityweight] * $usereliabilitygrades) + + ($gradingscaled * $WORKSHOP_FWEIGHTS[$gradingweight] * $usegradinggrades) + 0.5) / + (($WORKSHOP_FWEIGHTS[$teacherweight] * $useteachersgrades) + + ($WORKSHOP_FWEIGHTS[$peerweight] * $usepeergrades) + + ($WORKSHOP_FWEIGHTS[$biasweight] * $usebiasgrades) + + ($WORKSHOP_FWEIGHTS[$reliabilityweight] * $usereliabilitygrades) + + ($WORKSHOP_FWEIGHTS[$gradingweight] * $usegradinggrades))); + echo ""; + if ($useteachersgrades) { + echo ""; + } + if ($usepeergrades) { + echo ""; + } + if ($usebiasgrades) { + echo ""; + } + if ($usereliabilitygrades) { + echo ""; + } + if ($usegradinggrades) { + echo ""; + } + echo "\n"; + + // save the grades + set_field("workshop_submissions", "biasgrade", $biasscaled, "id", $bestsubmission->id); + set_field("workshop_submissions", "reliabilitygrade", $reliabilityscaled, "id", $bestsubmission->id); + set_field("workshop_submissions", "gradinggrade", $gradingscaled, "id", $bestsubmission->id); + set_field("workshop_submissions", "finalgrade", $finalgrade, "id", $bestsubmission->id); + } + echo "
cellheading2\">$course->studentcellheading2\">".get_string("assessmentsby", "workshop", $course->teachers)."cellheading2\">".get_string("assessmentsby", "workshop", $course->students)."cellheading2\">".get_string("gradeforbias", "workshop")."cellheading2\">".get_string("gradeforreliability", "workshop")."cellheading2\">".get_string("gradeforassessments", "workshop")."cellheading2\">".get_string("overallgrade", "workshop")."
cellheading2\">".get_string("weights","workshop")."cellheading2\">$WORKSHOP_FWEIGHTS[$teacherweight]cellheading2\">$WORKSHOP_FWEIGHTS[$peerweight]cellheading2\">$WORKSHOP_FWEIGHTS[$biasweight]cellheading2\">$WORKSHOP_FWEIGHTS[$reliabilityweight]cellheading2\">$WORKSHOP_FWEIGHTS[$gradingweight]cellheading2\"> 
$user->firstname $user->lastname$teachergrade$peergrade$biasscaled$reliabilityscaled$gradingscaled$finalgrade

\n"; + print_string("allgradeshaveamaximumof", "workshop", $workshop->grade); + echo "

\n"; + + print_continue("view.php?a=$workshop->id"); + } + + + /*************** display final grades (by teacher) ***************************/ + elseif ($action == 'displayfinalgrades') { + // Get all the students + if (!$users = get_course_students($course->id, "u.firstname, u.lastname")) { + print_heading(get_string("nostudentsyet")); + print_footer($course); + exit; + } + + // get the final weights from the database + $teacherweight = get_field("workshop","teacherweight", "id", $workshop->id); + $peerweight = get_field("workshop","peerweight", "id", $workshop->id); + $includeteachersgrade = get_field("workshop","includeteachersgrade", "id", $workshop->id); + $biasweight = get_field("workshop","biasweight", "id", $workshop->id); + $reliabilityweight = get_field("workshop","reliabilityweight", "id", $workshop->id); + $gradingweight = get_field("workshop","gradingweight", "id", $workshop->id); + // work out what to show in the final grades tables and what to include in the calculation of the final grade + // teacher grades? + if ($workshop->gradingstrategy and $teacherweight) { + $useteachersgrades = 1; + } + else { + $useteachersgrades = 0; + } + // peergrades? + if ($workshop->gradingstrategy and $workshop->nsassessments and $peerweight) { + $usepeergrades = 1; + } + else { + $usepeergrades = 0; + } + // bias grades? + if ((($workshop->ntassessments >= 3) or ($workshop->nsassessments >= 3)) and ($useteachersgrades or $usepeergrades) + and $biasweight ) { + $usebiasgrades = 1; + } + else { + $usebiasgrades = 0; + } + // reliability grades? + if ((($workshop->ntassessments >= 3) or ($workshop->nsassessments >= 3)) and ($useteachersgrades or $usepeergrades) + and $reliabilityweight ) { + $usereliabilitygrades = 1; + } + else { + $usereliabilitygrades = 0; + } + // grading grades? + if (($workshop->ntassessments or $workshop->nsassessments) and $gradingweight ) { + $usegradinggrades = 1; + } + else { + $usegradinggrades = 0; + } + + // show the final grades as stored in the tables... + print_heading_with_help(get_string("displayoffinalgrades", "workshop"), "finalgrades", "workshop"); + echo "
+ "; + echo ""; + if ($useteachersgrades) { + echo ""; + } + if ($usepeergrades) { + echo ""; + } + echo ""; + if ($usebiasgrades) { + echo ""; + } + if ($usereliabilitygrades) { + echo ""; + } + if ($usegradinggrades) { + echo ""; + } + echo "\n"; + // now the weights + echo ""; + echo "\n"; + if ($useteachersgrades) { + echo "\n"; + } + if ($usepeergrades) { + echo "\n"; + } + echo "\n"; + if ($usebiasgrades) { + echo "\n"; + } + if ($usereliabilitygrades) { + echo "\n"; + } + if ($usegradinggrades) { + echo "\n"; + } + echo "\n"; + foreach ($users as $user) { + if ($submissions = workshop_get_user_submissions($workshop, $user)) { + foreach ($submissions as $submission) { + echo ""; + echo "\n"; + if ($useteachersgrades) { + echo ""; + } + if ($usepeergrades) { + echo ""; + } + echo ""; + if ($usebiasgrades) { + echo ""; + } + if ($usereliabilitygrades) { + echo ""; + } + if ($usegradinggrades) { + echo ""; + } + echo "\n"; + } + } + } + echo "
cellheading2\">".$course->student."cellheading2\">".get_string("submissions", "workshop")."cellheading2\">".get_string("assessmentsby", "workshop", $course->teachers)."cellheading2\">".get_string("assessmentsby", "workshop", $course->students)."cellheading2\">".get_string("assessmentsdone", "workshop")."cellheading2\">".get_string("gradeforbias", "workshop")."cellheading2\">".get_string("gradeforreliability", "workshop")."cellheading2\">".get_string("gradeforassessments", "workshop")."cellheading2\">".get_string("overallgrade", "workshop")."
cellheading2\">".get_string("weights", "workshop")."cellheading2\"> cellheading2\">$WORKSHOP_FWEIGHTS[$teacherweight]cellheading2\">$WORKSHOP_FWEIGHTS[$peerweight]cellheading2\"> cellheading2\">$WORKSHOP_FWEIGHTS[$biasweight]cellheading2\">$WORKSHOP_FWEIGHTS[$reliabilityweight]cellheading2\">$WORKSHOP_FWEIGHTS[$gradingweight]cellheading2\"> 
$user->firstname $user->lastname".workshop_print_submission_title($workshop, $submission)."".workshop_print_submission_assessments($workshop, $submission, "teacher")."".workshop_print_submission_assessments($workshop, $submission, "student")."".workshop_print_user_assessments($workshop, $user)."$submission->biasgrade$submission->reliabilitygrade$submission->gradinggrade$submission->finalgrade

\n"; + print_string("allgradeshaveamaximumof", "workshop", $workshop->grade); + print_continue("view.php?a=$workshop->id"); + } + + + /*************** display final weights (by teacher) ***************************/ + elseif ($action == 'displayfinalweights') { + + if (!isteacher($course->id)) { + error("Only teachers can look at this page"); + } + + if ($workshop->phase != 3) { // is this at the expected phase? + echo "
".get_string("assignmentnotinthecorrectphase", "workshop")."
\n"; + print_continue("view.php?a=$workshop->id"); + } + else { + + ?> +
+ + +
+ id); + $peerweight = get_field("workshop","peerweight", "id", $workshop->id); + $includeteachersgrade = get_field("workshop","includeteachersgrade", "id", $workshop->id); + $biasweight = get_field("workshop","biasweight", "id", $workshop->id); + $reliabilityweight = get_field("workshop","reliabilityweight", "id", $workshop->id); + $gradingweight = get_field("workshop","gradingweight", "id", $workshop->id); + + // now show the weights used in the final grades + print_heading_with_help(get_string("calculationoffinalgrades", "workshop"), "calculatingfinalgrade", "workshop"); + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "
cellheading2\">
". + get_string("weightsusedforfinalgrade", "workshop")."
".get_string("weightforteachersassessment", "workshop").":"; + workshop_choose_from_menu($WORKSHOP_FWEIGHTS, "teacherweight", $teacherweight, ""); + echo "
".get_string("weightforpeerassessments", "workshop").":"; + workshop_choose_from_menu($WORKSHOP_FWEIGHTS, "peerweight", $peerweight, ""); + echo "
".get_string("weightforbias", "workshop").":"; + workshop_choose_from_menu($WORKSHOP_FWEIGHTS, "biasweight", $biasweight, ""); + echo "
".get_string("weightforreliability", "workshop").":"; + workshop_choose_from_menu($WORKSHOP_FWEIGHTS, "reliabilityweight", $reliabilityweight, ""); + echo "
".get_string("weightforgradingofassessments", "workshop").":"; + workshop_choose_from_menu($WORKSHOP_FWEIGHTS, "gradingweight", $gradingweight, ""); + echo "
cellheading2\">
". + get_string("optionforpeergrade", "workshop")."
".get_string("includeteachersgrade", "workshop").":"; + $options[0] = get_string("no"); $options[1] = get_string("yes"); + choose_from_menu($options, "includeteachersgrade", $includeteachersgrade, ""); + helpbutton("includeteachersgrade", get_string("includeteachersgrade", "workshop"), "workshop"); + echo "
\n"; + echo "\n"; + echo "
"; + echo "
\n"; + } + } + + + /******************* list all submissions ************************************/ + elseif ($action == 'listallsubmissions' ) { + if (!$users = get_course_students($course->id)) { + print_heading(get_string("nostudentsyet")); + print_footer($course); + exit; + } + print_heading(get_string("listofallsubmissions", "workshop").":", "CENTER"); + workshop_list_all_submissions($workshop, $USER); + print_continue("view.php?id=$cm->id"); + + } + + + /******************* list for assessment student (submissions) ************************************/ + elseif ($action == 'listforassessmentstudent' ) { + if (!$users = get_course_students($course->id)) { + print_heading(get_string("nostudentsyet")); + print_footer($course); + exit; + } + workshop_list_unassessed_student_submissions($workshop, $USER); + print_continue("view.php?id=$cm->id"); + + } + + + /******************* list for assessment teacher (submissions) ************************************/ + elseif ($action == 'listforassessmentteacher' ) { + if (!$users = get_course_students($course->id)) { + print_heading(get_string("nostudentsyet")); + print_footer($course); + exit; + } + workshop_list_unassessed_teacher_submissions($workshop, $USER); + print_continue("view.php?id=$cm->id"); + + } + + + /*************** no man's land **************************************/ + else { + error("Fatal Error: Unknown Action: ".$action."\n"); + } + + print_footer($course); + +?> + diff --git a/mod/workshop/todo.txt b/mod/workshop/todo.txt new file mode 100644 index 0000000000..183ee749e1 --- /dev/null +++ b/mod/workshop/todo.txt @@ -0,0 +1,23 @@ +To Do +===== + +Use a better method to measure bias in peer grades, probably based on the + percentage difference rather the relative difference used at present. + +When there are many peer gradings the grade comments page needs to be + broken into manageable chunks. **DONE** + +Allow teacher to add a set of submissions (from say a previous cohort) for the + students to grade. **Probably better as a separate module** + +Add option to allow the teacher's grade and mean peer grade to be merged in + the final grades table (to avoid disputes!). + +Add alternative grading strategies: Simple Grading (= assignment style grading); + Accumulative Grading (current strategy); Criteria Grading; and Error Banding. + + +Ray Kingdon +06 Feb 2003 + + diff --git a/mod/workshop/upload.php b/mod/workshop/upload.php new file mode 100644 index 0000000000..cb9fe237b2 --- /dev/null +++ b/mod/workshop/upload.php @@ -0,0 +1,81 @@ +course)) { + error("Course is misconfigured"); + } + + require_login($course->id); + + add_to_log($course->id, "workshop", "submit", "view.php?a=$workshop->id", "$workshop->id"); + + if ($course->category) { + $navigation = "id\">$course->shortname ->"; + } + $strworkshops = get_string("modulenameplural", "workshop"); + $strworkshop = get_string("modulename", "workshop"); + $strupload = get_string("upload"); + + print_header("$course->shortname: $workshop->name : $strupload", "$course->fullname", + "$navigation id>$strworkshops -> + id\">$workshop->name -> $strupload", + "", "", true); + /**** + if ($submissions = workshop_get_submissions($workshop, $USER)) { + if ($submission->grade and !$workshop->resubmit) { + error("You've already been graded - there's no point in uploading anything"); + } + } +****/ + if (!$title = $_POST['title']) { + notify(get_string("notitlegiven", "workshop") ); + } + else { + if (is_uploaded_file($newfile['tmp_name']) and $newfile['size'] > 0) { + if ($newfile['size'] > $workshop->maxbytes) { + notify(get_string("uploadfiletoobig", "assignment", $workshop->maxbytes)); + } + else { + $newfile_name = clean_filename($newfile['name']); + if ($newfile_name) { + $newsubmission->workshopid = $workshop->id; + $newsubmission->userid = $USER->id; + $newsubmission->title = $title; + $newsubmission->timecreated = time(); + if (!$newsubmission->id = insert_record("workshop_submissions", $newsubmission)) { + error("Failure to create new submission record!"); + } + if (! $dir = workshop_file_area($workshop, $newsubmission)) { + error("Sorry, an error in the system prevents you from uploading files: contact your teacher or system administrator"); + } + if (move_uploaded_file($newfile['tmp_name'], "$dir/$newfile_name")) { + print_heading(get_string("uploadsuccess", "assignment", $newfile_name) ); + } + else { + notify(get_string("uploaderror", "assignment") ); + } + } + else { + notify(get_string("uploadbadname", "assignment") ); + } + } + } + else { + notify(get_string("uploadnofilefound", "assignment") ); + } + } + print_continue("view.php?a=$workshop->id"); + + print_footer($course); + +?> diff --git a/mod/workshop/version.php b/mod/workshop/version.php new file mode 100644 index 0000000000..17713497f1 --- /dev/null +++ b/mod/workshop/version.php @@ -0,0 +1,11 @@ +version = 2003043000; +$module->cron = 60; + +?> diff --git a/mod/workshop/view.php b/mod/workshop/view.php new file mode 100644 index 0000000000..67337b32b2 --- /dev/null +++ b/mod/workshop/view.php @@ -0,0 +1,500 @@ +course)) { + error("Course is misconfigured"); + } + + if (! $workshop = get_record("workshop", "id", $cm->instance)) { + error("Course module is incorrect"); + } + + } else { + if (! $workshop = get_record("workshop", "id", $a)) { + error("Course module is incorrect"); + } + if (! $course = get_record("course", "id", $workshop->course)) { + error("Course is misconfigured"); + } + if (! $cm = get_coursemodule_from_instance("workshop", $workshop->id, $course->id)) { + error("Course Module ID was incorrect"); + } + } + + require_login($course->id); + + // ...log activity... + add_to_log($course->id, "workshop", "view", "view.php?id=$cm->id", "$workshop->id"); + + if ($course->category) { + $navigation = "id\">$course->shortname ->"; + } + + $strworkshops = get_string("modulenameplural", "workshop"); + $strworkshop = get_string("modulename", "workshop"); + + // ...display header... + print_header("$course->shortname: $workshop->name", "$course->fullname", + "$navigation id>$strworkshops -> $workshop->name", + "", "", true, update_module_button($cm->id, $course->id, $strworkshop), navmenu($course, $cm)); + + // ...and if necessary set default action + optional_variable($action); + if (isteacher($course->id)) { + if (empty($action)) { // no action specified, either go straight to elements page else the admin page + // has the assignment any elements + if (count_records("workshop_elements", "workshopid", $workshop->id)) { + $action = "teachersview"; + } + else { + redirect("assessments.php?action=editelements&id=$cm->id"); + } + } + } + elseif (!isguest()) { // it's a student then + switch ($workshop->phase) { + case 0 : + case 1 : $action = 'notavailable'; break; + case 2 : $action = 'studentsview'; break; + case 3 : $action = 'notavailable'; break; + case 4 : $action = 'displayfinalgrade'; + } + } + else { // it's a guest, oh no! + $action = 'notavailable'; + } + + + /*********************** close workshop for student assessments and submissions (move to phase 3) (for teachers)**/ + if ($action == 'closeworkshop') { + + if (!isteacher($course->id)) { + error("Only teachers can look at this page"); + } + + // move phase along + if ($workshop->phase == 2) { // force phase to open workshop + set_field("workshop", "phase", 3, "id", "$workshop->id"); + echo "
".get_string("movedtophase", "workshop", 3)."
\n"; + add_to_log($course->id, "workshop", "close", "view.php?a=$workshop->id", "$workshop->id"); + } + + print_continue("view.php?a=$workshop->id"); + + } + + + /******************* display final grade (for students) ************************************/ + elseif ($action == 'displayfinalgrade' ) { + + // get the final weights from the database + $teacherweight = get_field("workshop","teacherweight", "id", $workshop->id); + $peerweight = get_field("workshop","peerweight", "id", $workshop->id); + $includeteachersgrade = get_field("workshop","includeteachersgrade", "id", $workshop->id); + $biasweight = get_field("workshop","biasweight", "id", $workshop->id); + $reliabilityweight = get_field("workshop","reliabilityweight", "id", $workshop->id); + $gradingweight = get_field("workshop","gradingweight", "id", $workshop->id); + // work out what to show in the final grades tables and what to include in the calculation of the final grade + // teacher grades? + if ($workshop->graded and $teacherweight) { + $useteachersgrades = 1; + } + else { + $useteachersgrades = 0; + } + // peergrades? + if ($workshop->graded and $workshop->nsassessments and $peerweight) { + $usepeergrades = 1; + } + else { + $usepeergrades = 0; + } + // bias grades? + if ((($workshop->ntassessments >= 3) or ($workshop->nsassessments >= 3)) and $biasweight ) { + $usebiasgrades = 1; + } + else { + $usebiasgrades = 0; + } + // reliability grades? + if ((($workshop->ntassessments >= 3) or ($workshop->nsassessments >= 3)) and $reliabilityweight ) { + $usereliabilitygrades = 1; + } + else { + $usereliabilitygrades = 0; + } + // grading grades? + if (($workshop->ntassessments or $workshop->nsassessments) and $gradingweight ) { + $usegradinggrades = 1; + } + else { + $usegradinggrades = 0; + } + + // show the final grades as stored in the tables... + print_heading_with_help(get_string("displayoffinalgrades", "workshop"), "finalgrades", "workshop"); + if ($submissions = workshop_get_user_submissions($workshop, $USER)) { // any submissions from user? + echo "
"; + echo ""; + if ($useteachersgrades) { + echo ""; + } + if ($usepeergrades) { + echo ""; + } + echo ""; + if ($usebiasgrades) { + echo ""; + } + if ($usereliabilitygrades) { + echo ""; + } + if ($usegradinggrades) { + echo ""; + } + echo "\n"; + // now the weights + echo ""; + if ($useteachersgrades) { + echo "\n"; + } + if ($usepeergrades) { + echo "\n"; + } + echo "\n"; + if ($usebiasgrades) { + echo "\n"; + } + if ($usereliabilitygrades) { + echo "\n"; + } + if ($usegradinggrades) { + echo "\n"; + } + echo "\n"; + foreach ($submissions as $submission) { + echo "\n"; + if ($useteachersgrades) { + echo ""; + } + if ($usepeergrades) { + echo ""; + } + echo ""; + if ($usebiasgrades) { + echo ""; + } + if ($usereliabilitygrades) { + echo ""; + } + if ($usegradinggrades) { + echo ""; + } + echo "\n"; + } + } + echo "
".get_string("submissions", "workshop")."".get_string("teachersassessment", "workshop")."".get_string("studentsassessment", "workshop")."".get_string("assessmentsdone", "workshop")."".get_string("gradeforbias", "workshop")."".get_string("gradeforreliability", "workshop")."".get_string("gradeforassessments", "workshop")."".get_string("overallgrade", "workshop")."
".get_string("weights", "workshop")."$workshop_FWEIGHTS[$teacherweight]$workshop_FWEIGHTS[$peerweight] $workshop_FWEIGHTS[$biasweight]$workshop_FWEIGHTS[$reliabilityweight]$workshop_FWEIGHTS[$gradingweight] 
".workshop_print_submission_title($workshop, $submission)."".workshop_print_submission_assessments($workshop, $submission, "teacher")."".workshop_print_submission_assessments($workshop, $submission, "student")."".workshop_print_user_assessments($workshop, $USER)."$submission->biasgrade$submission->reliabilitygrade$submission->gradinggrade$submission->finalgrade

\n"; + print_string("allgradeshaveamaximumof", "workshop", $workshop->grade); + print_continue("view.php?a=$workshop->id"); + } + + + /*********************** make final grades available (for teachers only)**************/ + elseif ($action == 'makefinalgradesavailable') { + + if (!isteacher($course->id)) { + error("Only teachers can look at this page"); + } + + if ($workshop->phase == 3) { // is this at the expected phase? + set_field("workshop", "phase", 4, "id", "$workshop->id"); + echo "
".get_string("movedtophase", "workshop", 4)."
\n"; + } + else { + echo "
".get_string("assignmentnotinthecorrectphase", "workshop")."
\n"; + } + print_continue("view.php?a=$workshop->id"); + add_to_log($course->id, "workshop", "display grades", "view.php?a=$workshop->id", "$workshop->id"); + } + + + /*********************** make final grades unavailable (for teachers only)**************/ + elseif ($action == 'makefinalgradesunavailable') { + + if (!isteacher($course->id)) { + error("Only teachers can look at this page"); + } + + if ($workshop->phase == 4) { // is this at the expected phase? + set_field("workshop", "phase", 3, "id", "$workshop->id"); + echo "
".get_string("movedtophase", "workshop", 3)."
\n"; + } + else { + echo "
".get_string("assignmentnotinthecorrectphase", "workshop")."
\n"; + } + print_continue("view.php?a=$workshop->id"); + add_to_log($course->id, "workshop", "hide grades", "view.php?a=$workshop->id", "$workshop->id"); + } + + + /*********************** assignment not available (for students)***********************/ + elseif ($action == 'notavailable') { + echo "

".get_string("notavailable", "workshop")."
\n"; + } + + + /*********************** open workshop for student assessments and submissions (move to phase 2) (for teachers)**/ + elseif ($action == 'openworkshop') { + + if (!isteacher($course->id)) { + error("Only teachers can look at this page"); + } + + // move phase along + if (!($workshop->phase == 2)) { // force phase to open workshop + set_field("workshop", "phase", 2, "id", "$workshop->id"); + echo "
".get_string("movedtophase", "workshop", 2)."
\n"; + } + + print_continue("view.php?id=$cm->id"); + + add_to_log($course->id, "workshop", "open", "view.php?a=$workshop->id", "$workshop->id"); + } + + + /*********************** set up assignemnt (move back to phase 1) (for teachers)***********************/ + elseif ($action == 'setupassignment') { + + if (!isteacher($course->id)) { + error("Only teachers can look at this page"); + } + + if ($workshop->phase == 2) { // phase must be correct + set_field("workshop", "phase", 1, "id", "$workshop->id"); + echo "
".get_string("movedtophase", "workshop", 1)."
\n"; + } + else { + echo "
".get_string("assignmentnotinthecorrectphase", "workshop")."
\n"; + } + print_continue("view.php?a=$workshop->id"); + } + + + /*********************** student's view could be in 1 of 4 stages ***********************/ + elseif ($action == 'studentsview') { + // print standard assignment heading + $strdifference = format_time($workshop->deadline - time()); + if (($workshop->deadline - time()) < 0) { + $strdifference = "$strdifference"; + } + $strduedate = userdate($workshop->deadline)." ($strdifference)"; + print_simple_box_start("CENTER"); + print_heading($workshop->name, "CENTER"); + print_simple_box_start("CENTER"); + echo "".get_string("duedate", "assignment").": $strduedate
"; + echo "".get_string("maximumgrade").": $workshop->grade
"; + echo "".get_string("detailsofassessment", "workshop").": + id&action=displayelements\">". + get_string("specimenassessmentform", "workshop")."
"; + print_simple_box_end(); + echo "
"; + echo format_text($workshop->description, $workshop->format); + print_simple_box_end(); + echo "
"; + // in Stage 1? - assess teacher's submissions to a satisfactory level + if (!workshop_test_user_assessments($workshop, $USER)) { + echo "
".get_string("pleaseassesstheseexamplesfromtheteacher", "workshop", $course->teacher)."

\n"; + workshop_list_teacher_submissions($workshop, $USER); + echo "
".get_string("theseasessmentsaregradedbytheteacher", "workshop", $course->teacher)."

\n"; + } + // in stage 2? - submit own first attempt + else { + if ($workshop->ntassessments) { // display message if student had to assess the teacher's examples + echo "

id\">". + get_string("assessmentsareok", "workshop")."
\n"; + } + if (!workshop_get_user_submissions($workshop, $USER)) { + // print upload form + print_heading(get_string("submitassignment", "assignment").":", "CENTER"); + workshop_print_upload_form($workshop); + } + // in stage 3? - grade other student's submissions, resubmit and list all submissions + else { + // list any assessments by teachers + if (workshop_count_teacher_assessments($workshop, $USER)) { + echo "

".get_string("assessmentsby", "workshop", $course->teachers)."

\n"; + workshop_list_teacher_assessments($workshop, $USER); + } + // if student assessments show any to assess... + if ($workshop->nsassessments) { // if there are student assessment display them... + workshop_list_student_submissions($workshop, $USER); + echo "

".get_string("yourassessments", "workshop")."

\n"; + workshop_list_assessed_submissions($workshop, $USER); + // ... and show peer assessments + if (workshop_count_peer_assessments($workshop, $USER)) { + echo "

".get_string("assessmentsby", "workshop", $course->students)."

\n"; + workshop_list_peer_assessments($workshop, $USER); + } + } + // list previous submissions + echo "

".get_string("submissions", "workshop")."

\n"; + workshop_list_user_submissions($workshop, $USER); + echo "
"; + if ($workshop->resubmit) { + // if resubmissions allowed print upload form + print_heading(get_string("submitassignment", "assignment").":", "CENTER"); + workshop_print_upload_form($workshop); + echo "
"; + } + echo "
id\">". + get_string("listofallsubmissions", "workshop")."
\n"; + } + } + } + + + /*********************** submission of assignment by a student/teacher ***********************/ + elseif ($action == 'submitassignment') { + $strdifference = format_time($workshop->deadline - time()); + if (($workshop->deadline - time()) < 0) { + $strdifference = "$strdifference"; + } + $strduedate = userdate($workshop->deadline)." ($strdifference)"; + + print_simple_box_start("CENTER"); + print_heading($workshop->name, "CENTER"); + print_simple_box_start("CENTER"); + echo "".get_string("duedate", "assignment").": $strduedate
"; + echo "".get_string("maximumgrade").": $workshop->grade
"; + echo "".get_string("detailsofassessment", "workshop").": + id&action=displayelements\">". + get_string("specimenassessmentform", "workshop")."
"; + print_simple_box_end(); + echo "
"; + echo format_text($workshop->description, $workshop->format); + print_simple_box_end(); + echo "
"; + + workshop_list_teacher_submissions($workshop, $USER); + echo "
"; + echo "
"; + + workshop_list_student_submissions($workshop, $USER); + echo "
"; + echo "
"; + + // list previous submissions + workshop_list_user_submissions($workshop, $USER); + + echo "
"; + + // print upload form + print_heading(get_string("submitassignment", "assignment").":", "CENTER"); + workshop_print_upload_form($workshop); + } + + + /*********************** teacher's view - display admin page (current phase options) ************/ + elseif ($action == 'teachersview') { + + if (!isteacher($course->id)) { + error("Only teachers can look at this page"); + } + + print_heading_with_help(get_string("managingassignment", "workshop"), "managing", "workshop"); + echo "

\n"; + switch ($workshop->phase) { + case 0: + case 1: // set up assignment + echo "".get_string("phase1", "workshop").""; + echo "

id&action=editelements\">". + get_string("amendassessmentelements", "workshop")."

"; + echo "

id&action=submitassignment\">". + get_string("submitexampleassignment", "workshop").""; + echo "

id&action=listforassessmentteacher\">". + get_string("teachersubmissionsforassessment", "workshop", + workshop_count_teacher_submissions_for_assessment($workshop, $USER)). + "

\n"; + echo "

id&action=openworkshop\">". + get_string("moveonto", "workshop")." ".get_string("phase2", "workshop", $course->student)."

"; + break; + + case 2: // submissions and assessments + echo "".get_string("phase2", "workshop", $course->student).""; + echo "

id&action=listungradedteachersubmissions\">". + get_string("ungradedassessmentsofteachersubmissions", "workshop", workshop_count_ungraded_assessments_teacher($workshop))."\n"; + echo "

id&action=listungradedstudentsubmissions\">". + get_string("ungradedassessmentsofstudentsubmissions", "workshop", workshop_count_ungraded_assessments_student($workshop))."\n"; + echo "

id&action=listforassessmentstudent\">". + get_string("studentsubmissionsforassessment", "workshop", workshop_count_student_submissions_for_assessment($workshop, $USER)). + "\n"; + echo "

id&action=closeworkshop\">". + get_string("moveonto", "workshop")." ".get_string("phase3", "workshop")."

"; + echo "

[".get_string("deadlineis", "workshop", userdate($workshop->deadline))."]

\n"; + echo "

id&action=setupassignment\">(". + get_string("returnto", "workshop")." ".get_string("phase1", "workshop").")

"; + break; + + case 3: // calculate final grades + echo "".get_string("phase3", "workshop").""; + echo "

id&action=listungradedstudentsubmissions\">". + get_string("ungradedassessmentsofstudentsubmissions", "workshop", workshop_count_ungraded_assessments_student($workshop))."\n"; + echo "

id&action=listforassessmentstudent\">". + get_string("studentsubmissionsforassessment", "workshop", workshop_count_student_submissions_for_assessment($workshop, $USER)). + "\n"; + echo "

id&action=displayfinalweights\">". + get_string("calculationoffinalgrades", "workshop")."

"; + echo "

id&action=makefinalgradesavailable\">". + get_string("moveonto", "workshop")." ".get_string("phase4", "workshop")."

"; + echo "

id&action=openworkshop\">(". + get_string("returnto", "workshop")." ".get_string("phase2", "workshop", $course->student).")

"; + break; + + case 4: // show final grades + echo "".get_string("phase4", "workshop").""; + echo "

id&action=displayfinalgrades\">". + get_string("displayoffinalgrades", "workshop")."

"; + echo "

id&action=makefinalgradesunavailable\">(". + get_string("returnto", "workshop")." ".get_string("phase3", "workshop").")

"; + } + echo "

id&action=listallsubmissions\">". + get_string("listofallsubmissions", "workshop")."

\n"; + } + + + /*************** no man's land **************************************/ + else { + error("Fatal Error: Unknown Action: ".$action."\n"); + } + + print_footer($course); + +?>