Skip to content

Commit

Permalink
Add more checkboxes
Browse files Browse the repository at this point in the history
  • Loading branch information
AnupamaSarjoshi committed Aug 18, 2023
1 parent 4461272 commit aaab2ea
Showing 1 changed file with 8 additions and 10 deletions.
18 changes: 8 additions & 10 deletions edit_oumatrix_form.php
Original file line number Diff line number Diff line change
Expand Up @@ -84,16 +84,9 @@ class qtype_oumatrix_edit_form extends question_edit_form {
*/
protected function definition_inner($mform) {

// Sett the number of columns and rows.
$this->numcolumns = self::COL_NUM_START;
$this->numrows = self::ROW_NUM_START;
//if ($this->question->options->columns) {
// $this->numcolumns = count($this->question->options->columns);
//}
//if ($this->question->options->rows) {
// $this->numrows = count($this->question->options->rows);
//}

// Sett the number of columns and rows.self::COL_NUM_START;
$this->numcolumns = $this->numcolumns ?? self::COL_NUM_START;
$this->numrows = $this->numrows ??self::ROW_NUM_START;

$qtype = 'qtype_oumatrix';
$answermodemenu = [
Expand Down Expand Up @@ -153,6 +146,9 @@ protected function set_current_settings(): void {

$this->inputtype = $inputtype;
$this->grademethod = $grademethod;

$columns = optional_param_array('columnname', '', PARAM_TEXT);
$this->numcolumns = $columns ? count($columns) : self::COL_NUM_START;
}

/**
Expand Down Expand Up @@ -204,6 +200,7 @@ protected function data_preprocessing_columns($question) {
foreach ($question->options->columns as $column) {
$question->columnname[] = $column->name;
}
//$this->numcolumns = count($question->options->columns);
return $question;
}

Expand Down Expand Up @@ -247,6 +244,7 @@ protected function data_preprocessing_rows($question) {
$key++;
}
$question->feedback = $feedback;
//$this->numrows = count($question->options->rows);
return $question;
}

Expand Down

0 comments on commit aaab2ea

Please sign in to comment.