original_string: public function clear_grading_grades($restrict=null) {
          global $DB;
  
          $sql = "workshopid = :workshopid";
          $params = array('workshopid' => $this->id);
  
          if (is_null($restrict)) {
              // update all users - no more conditions
          } elseif (!empty($restrict)) {
              list($usql, $uparams) = $DB->get_in_or_equal($restrict, SQL_PARAMS_NAMED);
              $sql .= " AND userid $usql";
              $params = array_merge($params, $uparams);
          } else {
              throw new coding_exception('Empty value is not a valid parameter here');
          }
  
          $DB->set_field_select('workshop_aggregations', 'gradinggrade', null, $sql, $params);
      }
code: public function clear_grading_grades($restrict=null) {
          global $DB;
  
          $sql = "workshopid = :workshopid";
          $params = array('workshopid' => $this->id);
  
          if (is_null($restrict)) {
              // update all users - no more conditions
          } elseif (!empty($restrict)) {
              list($usql, $uparams) = $DB->get_in_or_equal($restrict, SQL_PARAMS_NAMED);
              $sql .= " AND userid $usql";
              $params = array_merge($params, $uparams);
          } else {
              throw new coding_exception('Empty value is not a valid parameter here');
          }
  
          $DB->set_field_select('workshop_aggregations', 'gradinggrade', null, $sql, $params);
      }
code_tokens: public function clear_grading_grades ( $ restrict = null ) { global $ DB ; $ sql = "workshopid = :workshopid" ; $ params = array ( 'workshopid' => $ this -> id ) ; if ( is_null ( $ restrict ) ) { // update all users - no more conditions } elseif ( ! empty ( $ restrict ) ) { list ( $ usql , $ uparams ) = $ DB -> get_in_or_equal ( $ restrict , SQL_PARAMS_NAMED ) ; $ sql .= " AND userid $usql" ; $ params = array_merge ( $ params , $ uparams ) ; } else { throw new coding_exception ( 'Empty value is not a valid parameter here' ) ; } $ DB -> set_field_select ( 'workshop_aggregations' , 'gradinggrade' , null , $ sql , $ params ) ; }
docstring: Sets the aggregated grades for assessment to null
  
  @param null|int|array $restrict If null, update all reviewers, otherwise update just grades for the given reviewer(s)
  @return void
docstring_tokens: Sets the aggregated grades for assessment to null