mirror of
https://github.com/moodle/moodle.git
synced 2025-08-04 00:16:46 +02:00
MDL-9447 - Default grade field is redundant in embeded answer (Cloze) question
This commit is contained in:
parent
cb7c915b10
commit
7211a3733a
3 changed files with 7 additions and 4 deletions
|
@ -89,15 +89,15 @@
|
|||
error("Could not find question type: '$qtype'");
|
||||
}
|
||||
|
||||
if ($QTYPES[$question->qtype]->create_editing_form('question2.php', $question, $category->course) !== null) {
|
||||
require_login($course->id, false);
|
||||
|
||||
if ($QTYPES[$question->qtype]->create_editing_form('question2.php', $question) !== null) {
|
||||
redirect(str_ireplace('question.php', 'question2.php', me()));
|
||||
}
|
||||
|
||||
require_login($course->id, false);
|
||||
$coursecontext = get_context_instance(CONTEXT_COURSE, $course->id);
|
||||
require_capability('moodle/question:manage', $coursecontext);
|
||||
|
||||
|
||||
if ($form = data_submitted() and confirm_sesskey()) {
|
||||
|
||||
if (isset($form->versioning) && isset($question->id) and false) { // disable versioning until it is fixed.
|
||||
|
|
|
@ -68,7 +68,7 @@ if ($wizardnow!==''){
|
|||
$mform = $QTYPES[$question->qtype]->next_wizard_form('question2.php', $question, $wizardnow);
|
||||
}
|
||||
} else {
|
||||
$mform = $QTYPES[$question->qtype]->create_editing_form('question2.php', $question, $category->course);
|
||||
$mform = $QTYPES[$question->qtype]->create_editing_form('question2.php', $question);
|
||||
}
|
||||
|
||||
if ($mform === null) {
|
||||
|
|
|
@ -18,6 +18,9 @@ class question_edit_multianswer_form extends question_edit_form {
|
|||
parent::definition();
|
||||
$mform =& $this->_form;
|
||||
$mform->addRule('questiontext', null, 'required', null, 'client');
|
||||
|
||||
// Remove meaningless defaultgrade field.
|
||||
$mform->removeElement('defaultgrade');
|
||||
}
|
||||
function set_data($question) {
|
||||
if (isset($question->id) and $question->id and $question->qtype and $question->questiontext) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue