public function resolve_dependencies()
 {
     parent::resolve_dependencies();
     if (!$this->usercanseegrades) {
         $this->slotmarks = false;
     }
     // We only want to show the checkbox to delete attempts
     // if the user has permissions and if the report mode is showing attempts.
     $this->checkboxcolumn = has_any_capability(array('mod/quiz:regrade', 'mod/quiz:deleteattempts'), context_module::instance($this->cm->id)) && $this->attempts != quiz_attempts_report::ENROLLED_WITHOUT;
 }
Ejemplo n.º 2
0
 public function resolve_dependencies()
 {
     parent::resolve_dependencies();
     if (!$this->showqtext && !$this->showresponses && !$this->showright) {
         // We have to show at least something.
         $this->showresponses = true;
     }
     // We only want to show the checkbox to delete attempts
     // if the user has permissions and if the report mode is showing attempts.
     $this->checkboxcolumn = has_capability('mod/quiz:deleteattempts', context_module::instance($this->cm->id)) && $this->attempts != quiz_attempts_report::ENROLLED_WITHOUT;
 }
Ejemplo n.º 3
0
 /**
  * Set up the table.
  * @param table_sql $table the table being constructed.
  * @param array $columns the list of columns.
  * @param array $headers the columns headings.
  * @param moodle_url $reporturl the URL of this report.
  * @param mod_quiz_attempts_report_options $options the display options.
  * @param bool $collapsible whether to allow columns in the report to be collapsed.
  */
 protected function set_up_table_columns($table, $columns, $headers, $reporturl, mod_quiz_attempts_report_options $options, $collapsible)
 {
     $table->define_columns($columns);
     $table->define_headers($headers);
     $table->sortable(true, 'uniqueid');
     $table->define_baseurl($options->get_url());
     $this->configure_user_columns($table);
     $table->no_sorting('feedbacktext');
     $table->column_class('sumgrades', 'bold');
     $table->set_attribute('id', 'attempts');
     $table->collapsible($collapsible);
 }