enabled penalties for all question types

This commit is contained in:
gustav_delius
2005-05-07 14:29:42 +00:00
parent f370553ef3
commit a5c53187cc
10 changed files with 49 additions and 21 deletions
+1 -1
View File
@@ -18,7 +18,7 @@
'quiz_subnet' => '',
'quiz_timelimit' => 0,
'quiz_optionflags' => 1,
'quiz_penaltyscheme' => 0,
'quiz_penaltyscheme' => 1,
'quiz_adaptive' => 1,
'quiz_fix_review' => 0,
+2 -2
View File
@@ -940,9 +940,9 @@ class quiz_default_questiontype {
if (empty($state->raw_grade)) {
$state->raw_grade = 0.0;
}
$state->penalty = $question->penalty * $question->maxgrade;
// Only allow one attempt at the question
$state->event = QUIZ_EVENTCLOSE;
$state->penalty = 1;
return true;
}
+11 -3
View File
@@ -31,11 +31,11 @@
</td>
<td>
<?php if (isset($err["questiontext"])) {
formerr($err["questiontext"]);
formerr($err["questiontext"]);
echo "<br />";
}
print_textarea($usehtmleditor, 15, 60, 630, 300, "questiontext", $question->questiontext);
if ($usehtmleditor) {
if ($usehtmleditor) {
echo '<input type="hidden" name="questiontextformat" value="'.FORMAT_HTML.'" />';
} else {
echo "<div align=\"right\">";
@@ -62,12 +62,20 @@
?>
</td>
</tr>
<tr valign="top">
<td align="right"><b><?php print_string("penalty", "quiz") ?>:</b></td>
<td>
<input type="text" name="penalty" size="3" value="<?php p($question->penalty) ?>" alt="<?php print_string("penalty", "quiz") ?>" />
<?php helpbutton('penalty', get_string('penalty', 'quiz'), 'quiz'); ?>
<?php if (isset($err["penalty"])) formerr($err["penalty"]); ?>
</td>
</tr>
<tr valign="top">
<td align="right"><b><?php print_string("choices", "quiz") ?></b>:</td>
<td><?php print_string("filloutthreequestions", "quiz") ?>
</td>
</tr>
<?php
<?php
for ($i=1; $i<=QUIZ_MAX_NUMBER_ANSWERS; $i++) {
?>
<tr valign="top">
@@ -285,9 +285,8 @@ class quiz_match_qtype extends quiz_default_questiontype {
// Make sure we don't assign negative or too high marks
$state->raw_grade = min(max((float) $state->raw_grade,
0.0), 1.0) * $question->maxgrade;
$state->penalty = 0;
// Only allow one attempt at the question
$state->event = QUIZ_EVENTCLOSE;
$state->penalty = $question->penalty * $question->maxgrade;
return true;
}
}
@@ -18,7 +18,7 @@
<td align="right"><b><?php print_string("question", "quiz") ?>:</b></td>
<td>
<?php if (isset($err["questiontext"])) {
formerr($err["questiontext"]);
formerr($err["questiontext"]);
echo "<br />";
}
print_textarea($usehtmleditor, 15, 60, 630, 300, "questiontext", $question->questiontext);
@@ -41,7 +41,15 @@
?>
</td>
</tr>
<?php
<tr valign="top">
<td align="right"><b><?php print_string("penalty", "quiz") ?>:</b></td>
<td>
<input type="text" name="penalty" size="3" value="<?php p($question->penalty) ?>" alt="<?php print_string("penalty", "quiz") ?>" />
<?php helpbutton('penalty', get_string('penalty', 'quiz'), 'quiz'); ?>
<?php if (isset($err["penalty"])) formerr($err["penalty"]); ?>
</td>
</tr>
<?php
$QUIZ_QTYPES[$question->qtype]->print_replacement_options($question, $course, $contextquiz);
$QUIZ_QTYPES[$question->qtype]->print_question_form_end($question);
?>
@@ -328,9 +328,8 @@ class quiz_embedded_cloze_qtype extends quiz_default_questiontype {
if (empty($state->raw_grade)) {
$state->raw_grade = 0.0;
}
$state->penalty = 0;
// Only allow one attempt at the question
$state->event = QUIZ_EVENTCLOSE;
$state->penalty = $question->penalty * $question->maxgrade;
return true;
}
}
@@ -362,8 +362,7 @@ class quiz_multichoice_qtype extends quiz_default_questiontype {
0.0), 1.0) * $question->maxgrade;
// Apply the penalty for this attempt
$state->penalty = $question->penalty * $question->maxgrade;
// Only allow one attempt at the question
// $state->event = QUIZ_EVENTCLOSE;
return true;
}
@@ -58,6 +58,14 @@
?>
</td>
</tr>
<tr valign="top">
<td align="right"><b><?php print_string("penalty", "quiz") ?>:</b></td>
<td>
<input type="text" name="penalty" size="3" value="<?php p($question->penalty) ?>" alt="<?php print_string("penalty", "quiz") ?>" />
<?php helpbutton('penalty', get_string('penalty', 'quiz'), 'quiz'); ?>
<?php if (isset($err["penalty"])) formerr($err["penalty"]); ?>
</td>
</tr>
<tr valign="top">
<td align="right"><b><?php print_string("randomsamatchnumber", "quiz") ?>:</b></td>
<td>
@@ -171,8 +171,7 @@ class quiz_shortanswer_qtype extends quiz_default_questiontype {
$state->raw_grade = min(max((float) $state->raw_grade,
0.0), 1.0) * $question->maxgrade;
$state->penalty = $question->penalty * $question->maxgrade;
// Only allow one attempt at the question
// $state->event = QUIZ_EVENTCLOSE;
return true;
}
@@ -31,11 +31,11 @@
</td>
<td>
<?php if (isset($err["questiontext"])) {
formerr($err["questiontext"]);
formerr($err["questiontext"]);
echo "<br />";
}
print_textarea($usehtmleditor, 15, 60, 630, 300, "questiontext", $question->questiontext);
if ($usehtmleditor) {
if ($usehtmleditor) {
echo '<input type="hidden" name="questiontextformat" value="'.FORMAT_HTML.'" />';
} else {
echo "<div align=\"right\">";
@@ -62,6 +62,14 @@
?>
</td>
</tr>
<tr valign="top">
<td align="right"><b><?php print_string("penalty", "quiz") ?>:</b></td>
<td>
<input type="text" name="penalty" size="3" value="<?php p($question->penalty) ?>" alt="<?php print_string("penalty", "quiz") ?>" />
<?php helpbutton('penalty', get_string('penalty', 'quiz'), 'quiz'); ?>
<?php if (isset($err["penalty"])) formerr($err["penalty"]); ?>
</td>
</tr>
<tr valign="top">
<td align="right"><b><?php print_string("correctanswer", "quiz") ?>:</b></td>
<td>
@@ -83,7 +91,7 @@
<textarea name="feedbackfalse" rows="2" cols="50"><?php p($false->feedback) ?></textarea>
</td>
</tr>
<?php
<?php
$QUIZ_QTYPES[$question->qtype]->print_replacement_options($question, $course, $contextquiz);
$QUIZ_QTYPES[$question->qtype]->print_question_form_end($question);
?>