-<p align="center"><b>Question commentary</b></p>
+<p align="center"><b>Question general feedback</b></p>
-<p>Question commentary is some text that gets shown to the
+<p>Question general feedback is some text that gets shown to the
student after they have attempted the question. Unlike feedback,
which depends on the question type and what response the student gave,
-the same commentary text is shown to all students.</p>
+the same general feedback text is shown to all students.</p>
-<p>You can control when commentary is shown to students using
+<p>You can control when general feedback is shown to students using
the "Students may review:" check-boxes on the quiz editing form.</p>
-<p>You can use the commentary to give students some background
+<p>You can use the general feedback to give students some background
to what knownledge the question was testing. Or to give them a
link to more information they can use if they did not understand the
questions.</p>
\ No newline at end of file
<li><a href="help.php?module=quiz&file=calculated.html">Calculated questions</a></li>
<li><a href="help.php?module=quiz&file=categories.html">Categories</a></li>
<li><a href="help.php?module=quiz&file=categories_edit.html">Question Categories</a></li>
- <li><a href="help.php?module=quiz&file=commentary.html">Question commentary</a></li>
<li><a href="help.php?module=quiz&file=correctanswers.html">Correct answers</a></li>
<li><a href="help.php?module=quiz&file=createmultiple.html">Creating multiple quizzes</a></li>
<li><a href="help.php?module=quiz&file=decimalpoints.html">Decimal digits</a></li>
<li><a href="help.php?module=quiz&file=export.html"></a></li>
<li><a href="help.php?module=quiz&file=repeatattempts.html">Each attempt builds on the last</a></li>
<li><a href="help.php?module=quiz&file=multianswer.html">Embedded Answers (Cloze)</a></li>
+ <li><a href="help.php?module=quiz&file=generalfeedback.html">Question general feedback</a></li>
<li><a href="help.php?module=quiz&file=grademethod.html">Grading method</a></li>
<li><a href="help.php?module=quiz&file=import.html">Importing questions</a></li>
<li><a href="help.php?module=quiz&file=formataiken.html">Importing Aiken format files</a></li>
$string['closepreview'] = 'Close preview';
$string['closereview'] = 'Close review';
$string['comment'] = 'Comment';
-$string['commentary'] = 'Commentary';
$string['commentorgrade'] = 'Make comment or override grade';
$string['completedon'] = 'Completed on';
$string['confirmclose'] = 'You are about to close this attempt. Once you close the attempt you will no longer be able to change your answers.';
$string['functiontakesonearg'] = 'The function $a must have exactly one argument';
$string['functiontakesoneortwoargs'] = 'The function $a must have either one or two arguments';
$string['functiontakestwoargs'] = 'The function $a must have exactly two arguments';
+$string['generalfeedback'] = 'General feedback';
$string['generatevalue'] = 'Generate a new value between';
$string['geometric'] = 'Geometric';
$string['gift'] = 'GIFT format';
return $result;
}
-function migrate2utf8_question_commentarytext($recordid){
+function migrate2utf8_question_generalfeedback($recordid){
global $CFG, $globallang;
/// Some trivial checks
/// Convert the text
if (($fromenc != 'utf-8') && ($fromenc != 'UTF-8')) {
- $result = utfconvert($quizquestions->commentarytext, $fromenc);
+ $result = utfconvert($quizquestions->generalfeedback, $fromenc);
$newquizquestion = new object;
$newquizquestion->id = $recordid;
- $newquizquestion->commentarytext = $result;
+ $newquizquestion->generalfeedback = $result;
update_record('question',$newquizquestion);
}
/// And finally, just return the converted field
}
if ($oldversion < 2006081000) {
- // Add a column to the the question table to store the question commentary.
+ // Add a column to the the question table to store the question general feedback.
$success = $success && table_column('question', '', 'commentarytext', 'text', '', '', '', 'not null', 'image');
- // Adjust the quiz review options so that commentary is displayed whenever feedback is.
+ // Adjust the quiz review options so that general feedback is displayed whenever feedback is.
$success = $success && execute_sql('UPDATE ' . $CFG->prefix . 'quiz SET review = ' .
- '(review & ~' . QUIZ_REVIEW_COMMENTARY . ') | ' . // Clear any existing junk from the commenary bits.
- '((review & ' . QUIZ_REVIEW_FEEDBACK . ') * 8)'); // Set the commentary bits to be the same as the feedback ones.
+ '(review & ~' . QUIZ_REVIEW_GENERALFEEDBACK . ') | ' . // Clear any existing junk from the commenary bits.
+ '((review & ' . QUIZ_REVIEW_FEEDBACK . ') * 8)'); // Set the general feedback bits to be the same as the feedback ones.
// Same adjustment to the defaults for new quizzes.
- $success = $success && set_config('quiz_review', ($CFG->quiz_review & ~QUIZ_REVIEW_COMMENTARY) |
+ $success = $success && set_config('quiz_review', ($CFG->quiz_review & ~QUIZ_REVIEW_GENERALFEEDBACK) |
(($CFG->quiz_review & QUIZ_REVIEW_FEEDBACK) << 3));
}
}
if ($success && $oldversion < 2006091900) {
- $success = $success && table_column('question_dataset_items', 'number', 'itemnumber', 'text', '', '', '');
+ $success = $success && table_column('question_dataset_items', 'number', 'itemnumber', 'integer');
+ }
+
+ if ($success && $oldversion < 2006091901) {
+ $success = $success && table_column('question', 'commentarytext', 'generalfeedback', 'text', '', '', '');
}
return $success;
questiontext text NOT NULL,
questiontextformat tinyint(2) NOT NULL default '0',
image varchar(255) NOT NULL default '',
- commentarytext text NOT NULL,
+ generalfeedback text NOT NULL,
defaultgrade int(10) unsigned NOT NULL default '1',
penalty float NOT NULL default '0.1',
qtype varchar(20) NOT NULL default '',
}
if ($oldversion < 2006081000) {
- // Add a column to the the question table to store the question commentary.
+ // Add a column to the the question table to store the question general feedback.
$success = $success && table_column('question', '', 'commentarytext', 'text', '', '', '', 'not null', 'image');
- // Adjust the quiz review options so that commentary is displayed whenever feedback is.
+ // Adjust the quiz review options so that general feedback is displayed whenever feedback is.
$success = $success && execute_sql('UPDATE ' . $CFG->prefix . 'quiz SET review = ' .
- '(review & ~' . QUIZ_REVIEW_COMMENTARY . ') | ' . // Clear any existing junk from the commenary bits.
- '((review & ' . QUIZ_REVIEW_FEEDBACK . ') * 8)'); // Set the commentary bits to be the same as the feedback ones.
+ '(review & ~' . QUIZ_REVIEW_GENERALFEEDBACK . ') | ' . // Clear any existing junk from the commenary bits.
+ '((review & ' . QUIZ_REVIEW_FEEDBACK . ') * 8)'); // Set the general feedback bits to be the same as the feedback ones.
// Same adjustment to the defaults for new quizzes.
- $success = $success && set_config('quiz_review', ($CFG->quiz_review & ~QUIZ_REVIEW_COMMENTARY) |
+ $success = $success && set_config('quiz_review', ($CFG->quiz_review & ~QUIZ_REVIEW_GENERALFEEDBACK) |
(($CFG->quiz_review & QUIZ_REVIEW_FEEDBACK) << 3));
}
}
if ($success && $oldversion < 2006091900) {
- $success = $success && table_column('question_dataset_items', 'number', 'itemnumber', 'text', '', '', '');
+ $success = $success && table_column('question_dataset_items', 'number', 'itemnumber', 'integer');
+ }
+
+ if ($success && $oldversion < 2006091901) {
+ $success = $success && table_column('question', 'commentarytext', 'generalfeedback', 'text', '', '', '');
}
return $success;
questiontext text NOT NULL default '',
questiontextformat integer NOT NULL default '0',
image varchar(255) NOT NULL default '',
- commentarytext text NOT NULL default '',
+ generalfeedback text NOT NULL default '',
defaultgrade integer NOT NULL default '1',
penalty real NOT NULL default '0.1',
qtype varchar(20) NOT NULL default '0',
// Some handling of worked solutions is already in the code but not yet fully supported
// and not switched on in the user interface.
define('QUIZ_REVIEW_SOLUTIONS', 16*0x1041); // Show solutions
-define('QUIZ_REVIEW_COMMENTARY', 32*0x1041); // Show commentary
+define('QUIZ_REVIEW_GENERALFEEDBACK', 32*0x1041); // Show general feedback
/**#@-*/
/**
unset($quiz->solutionsclosed);
}
- if (isset($quiz->commentaryimmediately)) {
- $review += (QUIZ_REVIEW_COMMENTARY & QUIZ_REVIEW_IMMEDIATELY);
+ if (isset($quiz->generalfeedbackimmediately)) {
+ $review += (QUIZ_REVIEW_GENERALFEEDBACK & QUIZ_REVIEW_IMMEDIATELY);
unset($quiz->solutionsimmediately);
}
- if (isset($quiz->commentaryopen)) {
- $review += (QUIZ_REVIEW_COMMENTARY & QUIZ_REVIEW_OPEN);
+ if (isset($quiz->generalfeedbackopen)) {
+ $review += (QUIZ_REVIEW_GENERALFEEDBACK & QUIZ_REVIEW_OPEN);
unset($quiz->solutionsopen);
}
- if (isset($quiz->commentaryclosed)) {
- $review += (QUIZ_REVIEW_COMMENTARY & QUIZ_REVIEW_CLOSED);
+ if (isset($quiz->generalfeedbackclosed)) {
+ $review += (QUIZ_REVIEW_GENERALFEEDBACK & QUIZ_REVIEW_CLOSED);
unset($quiz->solutionsclosed);
}
// Show correct responses in readonly mode if the quiz allows it
$options->correct_responses = $options->readonly && ($reviewoptions & QUIZ_REVIEW_ANSWERS & QUIZ_REVIEW_IMMEDIATELY);
- // Show commentary if the question has been graded and the quiz allows it.
- $options->commentary = question_state_is_graded($state) && ($reviewoptions & QUIZ_REVIEW_COMMENTARY & QUIZ_REVIEW_IMMEDIATELY);
+ // Show general feedback if the question has been graded and the quiz allows it.
+ $options->generalfeedback = question_state_is_graded($state) && ($reviewoptions & QUIZ_REVIEW_GENERALFEEDBACK & QUIZ_REVIEW_IMMEDIATELY);
// Always show responses and scores
$options->responses = true;
* normally the context for the quiz module instance.
*
* @return object an object with boolean fields responses, scores, feedback,
- * correct_responses, solutions and commentary
+ * correct_responses, solutions and general feedback
*/
function quiz_get_reviewoptions($quiz, $attempt, $context=null) {
$options->feedback = true;
$options->correct_responses = true;
$options->solutions = false;
- $options->commentary = true;
+ $options->generalfeedback = true;
// Show a link to the comment box only for closed attempts
if ($attempt->timefinish) {
$options->feedback = ($quiz->review & $quiz_state_mask & QUIZ_REVIEW_FEEDBACK) ? 1 : 0;
$options->correct_responses = ($quiz->review & $quiz_state_mask & QUIZ_REVIEW_ANSWERS) ? 1 : 0;
$options->solutions = ($quiz->review & $quiz_state_mask & QUIZ_REVIEW_SOLUTIONS) ? 1 : 0;
- $options->commentary = ($quiz->review & $quiz_state_mask & QUIZ_REVIEW_COMMENTARY) ? 1 : 0;
+ $options->generalfeedback = ($quiz->review & $quiz_state_mask & QUIZ_REVIEW_GENERALFEEDBACK) ? 1 : 0;
}
return $options;
<td align="center"><?php print_string('feedback', 'quiz') ?></td>
<td align="center"><?php print_string('answers', 'quiz') ?></td>
<!-- <td align="center"><?php print_string('solutions', 'quiz') ?></td>-->
- <td align="center"><?php print_string('commentary', 'quiz') ?></td>
+ <td align="center"><?php print_string('generalfeedback', 'quiz') ?></td>
<td>
<?php helpbutton("review2", get_string("allowreview","quiz"), "quiz"); ?>
</td>
</td>
-->
<td align="center">
- <input type="checkbox" name="commentaryimmediately" value="Yes" <?php echo ($form->review & QUIZ_REVIEW_COMMENTARY & QUIZ_REVIEW_IMMEDIATELY) ? 'checked="checked"' : '' ?> />
+ <input type="checkbox" name="generalfeedbackimmediately" value="Yes" <?php echo ($form->review & QUIZ_REVIEW_GENERALFEEDBACK & QUIZ_REVIEW_IMMEDIATELY) ? 'checked="checked"' : '' ?> />
</td>
</tr>
<tr>
</td>
-->
<td align="center">
- <input type="checkbox" name="commentaryopen" value="Yes" <?php echo ($form->review & QUIZ_REVIEW_COMMENTARY & QUIZ_REVIEW_OPEN) ? 'checked="checked"' : '' ?> />
+ <input type="checkbox" name="generalfeedbackopen" value="Yes" <?php echo ($form->review & QUIZ_REVIEW_GENERALFEEDBACK & QUIZ_REVIEW_OPEN) ? 'checked="checked"' : '' ?> />
</td>
</tr>
<tr>
</td>
-->
<td align="center">
- <input type="checkbox" name="commentaryclosed" value="Yes" <?php echo ($form->review & QUIZ_REVIEW_COMMENTARY & QUIZ_REVIEW_CLOSED) ? 'checked="checked"' : '' ?> />
+ <input type="checkbox" name="generalfeedbackclosed" value="Yes" <?php echo ($form->review & QUIZ_REVIEW_GENERALFEEDBACK & QUIZ_REVIEW_CLOSED) ? 'checked="checked"' : '' ?> />
</td>
</tr>
</table>
// This fragment is called by moodle_needs_upgrading() and /admin/index.php
////////////////////////////////////////////////////////////////////////////////
-$module->version = 2006091900; // The (date) version of this module
+$module->version = 2006091901; // The (date) version of this module
$module->requires = 2006080900; // Requires this Moodle version
$module->cron = 0; // How often should cron check this module (seconds)?
fwrite ($bf,full_tag("QUESTIONTEXT",6,false,$question->questiontext));
fwrite ($bf,full_tag("QUESTIONTEXTFORMAT",6,false,$question->questiontextformat));
fwrite ($bf,full_tag("IMAGE",6,false,$question->image));
- fwrite ($bf,full_tag("COMMENTARYTEXT",6,false,$question->commentarytext));
+ fwrite ($bf,full_tag("GENERALFEEDBACK",6,false,$question->generalfeedback));
fwrite ($bf,full_tag("DEFAULTGRADE",6,false,$question->defaultgrade));
fwrite ($bf,full_tag("PENALTY",6,false,$question->penalty));
fwrite ($bf,full_tag("QTYPE",6,false,$question->qtype));
$image_base64 = stripslashes( trim( $question['#']['image_base64'][0]['#'] ) );
$image = $this->importimagefile( $image, $image_base64 );
}
- if (array_key_exists('commentarytext', $question['#'])) {
- $commentarytext = $this->import_text( $question['#']['commentarytext'][0]['#']['text'] );
+ if (array_key_exists('generalfeedback', $question['#'])) {
+ $generalfeedback = $this->import_text( $question['#']['generalfeedback'][0]['#']['text'] );
} else {
- $commentarytext = '';
+ $generalfeedback = '';
}
if (!empty($question['#']['defaultgrade'][0]['#'])) {
$qo->defaultgrade = $question['#']['defaultgrade'][0]['#'];
$qo->questiontext = $qtext;
$qo->questiontextformat = $this->trans_format( $qformat );
$qo->image = ((!empty($image)) ? $image : '');
- $qo->commentarytext = $commentarytext;
+ $qo->generalfeedback = $generalfeedback;
$qo->penalty = $penalty;
return $qo;
$name_text = $this->writetext( $question->name );
$qtformat = $this->get_format($question->questiontextformat);
$question_text = $this->writetext( $question->questiontext );
- $commentary_text = $this->writetext( $question->commentarytext );
+ $generalfeedback = $this->writetext( $question->generalfeedback );
$expout .= " <question type=\"$question_type\">\n";
$expout .= " <name>$name_text</name>\n";
$expout .= " <questiontext format=\"$qtformat\">\n";
$expout .= " </questiontext>\n";
$expout .= " <image>{$question->image}</image>\n";
$expout .= $this->writeimage($question->image);
- $expout .= " <commentarytext>\n";
- $expout .= $commentary_text;
- $expout .= " </commentarytext>\n";
+ $expout .= " <generalfeedback>\n";
+ $expout .= $generalfeedback;
+ $expout .= " </generalfeedback>\n";
$expout .= " <defaultgrade>{$question->defaultgrade}</defaultgrade>\n";
$expout .= " <penalty>{$question->penalty}</penalty>\n";
$expout .= " <hidden>{$question->hidden}</hidden>\n";
if (!isset($question->defaultgrade)) {
$question->defaultgrade = 1;
}
- if (empty($question->commentarytext)) {
- $question->commentarytext = "";
+ if (empty($question->generalfeedback)) {
+ $question->generalfeedback = "";
}
// Set up some Richtext editing if necessary
$question->questiontext = backup_todb($que_info['#']['QUESTIONTEXT']['0']['#']);
$question->questiontextformat = backup_todb($que_info['#']['QUESTIONTEXTFORMAT']['0']['#']);
$question->image = backup_todb($que_info['#']['IMAGE']['0']['#']);
- if (array_key_exists('COMMENTARYTEXT', $que_info['#'])) {
- $question->commentarytext = backup_todb($que_info['#']['COMMENTARYTEXT']['0']['#']);
+ if (array_key_exists('GENERALFEEDBACK', $que_info['#'])) {
+ $question->generalfeedback = backup_todb($que_info['#']['GENERALFEEDBACK']['0']['#']);
} else {
- $question->commentarytext = '';
+ $question->generalfeedback = '';
}
$question->defaultgrade = backup_todb($que_info['#']['DEFAULTGRADE']['0']['#']);
$question->penalty = backup_todb($que_info['#']['PENALTY']['0']['#']);
?>
<tr valign="top">
- <td align="right"><b><?php print_string("commentary", "quiz") ?>:</b>
+ <td align="right"><b><?php print_string("generalfeedback", "quiz") ?>:</b>
<br /><br /><br />
<?php
- helpbutton("commentary", get_string("commentary", "quiz"), "quiz", true, true);
+ helpbutton("generalfeedback", get_string("generalfeedback", "quiz"), "quiz", true, true);
?>
</td>
<td align="left">
<?php
- if (isset($err["commentarytext"])) {
- formerr($err["commentarytext"]);
+ if (isset($err["generalfeedback"])) {
+ formerr($err["generalfeedback"]);
echo "<br />";
}
- print_textarea(false, 10, 60, 630, 200, "commentarytext", $question->commentarytext);
+ print_textarea(false, 10, 60, 630, 200, "generalfeedback", $question->generalfeedback);
?>
</td>
</tr>
</div>
<?php }
echo $commentlink;
- if ($commentary) { ?>
- <div class="commentary">
- <?php echo $commentary ?>
+ if ($generalfeedback) { ?>
+ <div class="generalfeedback">
+ <?php echo $generalfeedback ?>
</div>
<?php }
if ($history) { ?>
$question->image = $form->image;
}
- if (empty($form->commentarytext)) {
- $question->commentarytext = '';
+ if (empty($form->generalfeedback)) {
+ $question->generalfeedback = '';
} else {
- $question->commentarytext = trim($form->commentarytext);
+ $question->generalfeedback = trim($form->generalfeedback);
}
if (empty($question->name)) {
$editlink = link_to_popup_window('/question/question.php?id='.$question->id, $stredit, $linktext, 450, 550, $stredit, '', true);
}
- $commentary = '';
- if ($isgraded && $options->commentary) {
- $commentary = $this->format_text($question->commentarytext,
+ $generalfeedback = '';
+ if ($isgraded && $options->generalfeedback) {
+ $generalfeedback = $this->format_text($question->generalfeedback,
$question->questiontextformat, $cmoptions);
}
/**
* Print the start of the question editing form, including the question category,
- * questionname, questiontext, image, defaultgrade, penalty and commentary fields.
+ * questionname, questiontext, image, defaultgrade, penalty and generalfeedback fields.
*
* Three of the fields, image, defaultgrade, penalty, are optional, and
* can be removed from the from using the $hidefields argument.
.que .grading,
.que .comment,
.que .commentlink,
-.que .commentary,
+.que .generalfeedback,
.que .history {
float: right;
margin: 5px;