Skip to content

Commit

Permalink
fix option's description, change variable to moodlecase
Browse files Browse the repository at this point in the history
  • Loading branch information
odziminski committed Feb 23, 2024
1 parent 5650c80 commit d15ff63
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions Moosh/Command/Moodle41/Question/QuestionDelete.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@ public function __construct()
{
parent::__construct('delete', 'question');
$this->addArgument('questionid');
$this->addOption('check-only', null, 'Only check if the question is in use, do not delete');
$this->addOption('check-only', 'Only check if the question is in use, do not delete');
}

public function execute()
{
global $DB, $CFG;
$questionid = $this->arguments[0];
$checkOnly = $this->expandedOptions['check-only'];
$checkonly = $this->expandedOptions['check-only'];

require_once($CFG->dirroot . '/question/engine/lib.php');
require_once($CFG->dirroot . '/question/type/questiontypebase.php');
Expand All @@ -42,11 +42,11 @@ public function execute()
}
if (questions_in_use($questionsToCheck)) {
mtrace("[ID:$questionid] Question in use in activities - can not delete");
if ($checkOnly) {
if ($checkonly) {
return;
}
}
if (!$checkOnly) {
if (!$checkonly) {
question_delete_question($question->id);
}
}
Expand Down

0 comments on commit d15ff63

Please sign in to comment.