Skip to content

Commit 2a3645f

Browse files
committed
Add explicit warning about manual grades questions.
1 parent 79e603f commit 2a3645f

3 files changed

Lines changed: 14 additions & 2 deletions

File tree

lang/en/qtype_stack.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -420,6 +420,7 @@
420420
$string['moodleerrors'] = 'You have errors related to Moodle\'s basic question setup.';
421421
$string['stackerrors'] = 'You have errors in your question.';
422422
$string['markedasbroken'] = 'The question has been marked as broken and will not be accessible to students.';
423+
$string['alwaysmanuallygrade'] = 'This question is always manually graded.';
423424

424425
// Strings used by input elements.
425426
$string['studentinputtoolong'] = 'Your input is longer than permitted by STACK.';

question.php

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1950,7 +1950,18 @@ public function validate_warnings($errors = false) {
19501950
$warnings[] = stack_string_error('questionbroken');
19511951
}
19521952

1953-
// 4. Language warning checks.
1953+
// 4. Warn if always maually graded.
1954+
$manualgraded = false;
1955+
if (!empty($this->inputs)) {
1956+
foreach ($this->inputs as $input) {
1957+
$manualgraded = $manualgraded || $input->get_extra_option('manualgraded');
1958+
}
1959+
}
1960+
if ($manualgraded) {
1961+
$warnings[] = stack_string_error('alwaysmanuallygrade');
1962+
}
1963+
1964+
// 5. Language warning checks.
19541965
// Put language warning checks last (see guard clause below).
19551966
// Check multi-language versions all have the same languages.
19561967
$ml = new stack_multilang();

stack/input/freetext/freetext.class.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ class stack_freetext_input extends stack_string_input {
3333
'hideanswer' => false,
3434
'allowempty' => false,
3535
'validator' => false,
36-
'manualgraded' => false,
36+
'manualgraded' => true,
3737
];
3838

3939
/**

0 commit comments

Comments
 (0)