]> git.mjollnir.org Git - moodle.git/commitdiff
Methods to get info about assessments and dimensions are part of strategy API
authorDavid Mudrak <david.mudrak@gmail.com>
Mon, 4 Jan 2010 18:16:41 +0000 (18:16 +0000)
committerDavid Mudrak <david.mudrak@gmail.com>
Mon, 4 Jan 2010 18:16:41 +0000 (18:16 +0000)
mod/workshop/eval/best/lib.php
mod/workshop/form/accumulative/lib.php
mod/workshop/form/lib.php
mod/workshop/form/rubric/lib.php

index f2777e25882d19b33d1bfeb67f4a089fbb3d580b..5e6103fe8407051fe8247aa5c50e0477647baab1 100644 (file)
@@ -67,10 +67,10 @@ class workshop_best_evaluation implements workshop_evaluation {
         }
 
         // get the information about the assessment dimensions
-        $diminfo = $grader->eval_best_dimensions_info();
+        $diminfo = $grader->get_dimensions_info();
 
         // fetch a recordset with all assessments to process
-        $rs         = $grader->eval_best_get_assessments_recordset($restrict);
+        $rs         = $grader->get_assessments_recordset($restrict);
         $batch      = array();    // will contain a set of all assessments of a single submission
         $previous   = null;       // a previous record in the recordset
         foreach ($rs as $current) {
index 1b549dae71713c58bd477d43f9c411e73a93f22f..41a44eec48a62e37cfb3b076659162b398d2b07b 100644 (file)
@@ -270,7 +270,7 @@ class workshop_accumulative_strategy implements workshop_strategy {
      * @param resource $restrict 
      * @return TODO
      */
-    public function eval_best_get_assessments_recordset($restrict) {
+    public function get_assessments_recordset($restrict) {
         global $DB;
 
         $sql = 'SELECT s.id AS submissionid,
@@ -302,7 +302,7 @@ class workshop_accumulative_strategy implements workshop_strategy {
      *
      * @return array [dimid] => stdClass (->id ->max ->min ->weight)
      */
-    public function eval_best_dimensions_info() {
+    public function get_dimensions_info() {
         global $DB;
 
         $sql = 'SELECT d.id, d.grade, d.weight, s.scale
index 97609477136ed492f94ff8da557ced8a4e3e3a7b..0f6400771d5d6b1235a30efe276822c490b9f5e3 100644 (file)
@@ -93,4 +93,23 @@ interface workshop_strategy {
      */
     public function supports_evaluation(workshop_evaluation $evaluation);
 
+    /**
+     * Returns a general information about the assessment dimensions
+     *
+     * @return array [dimid] => stdClass (->id ->max ->min ->weight)
+     */
+    public function get_dimensions_info();
+
+    /**
+     * Returns recordset with detailed information of all assessments done using this strategy
+     *
+     * The returned structure must be a recordset of objects containing at least properties:
+     * submissionid, assessmentid, assessmentweight, reviewerid, gradinggrade, dimensionid and grade.
+     * It is possible to pass user id(s) of reviewer(s). Then, the method returns just the reviewer's
+     * assessments info.
+     *
+     * @param array|int|null $restrict optional id or ids of the reviewer
+     * @return moodle_recordset
+     */
+    public function get_assessments_recordset($restrict=null);
 }
index e4c57d2b3fca09a9ea3b165f4678ef338a05aeb6..12cabcb930006da8b7b2d143203bd97fd05b60f4 100644 (file)
@@ -320,7 +320,7 @@ class workshop_rubric_strategy implements workshop_strategy {
      * @param array|int|null $restrict optional id or ids of the reviewer
      * @return moodle_recordset
      */
-    public function eval_best_get_assessments_recordset($restrict=null) {
+    public function get_assessments_recordset($restrict=null) {
         global $DB;
 
         $sql = 'SELECT s.id AS submissionid,
@@ -354,7 +354,7 @@ class workshop_rubric_strategy implements workshop_strategy {
      *
      * @return array [dimid] => stdClass (->id ->max ->min ->weight)
      */
-    public function eval_best_dimensions_info() {
+    public function get_dimensions_info() {
         global $DB;
 
         $sql = 'SELECT d.id AS id, MIN(l.grade) AS min, MAX(l.grade) AS max, 1 AS weight