$inputname = $nameprefix;
- echo "<p>$stranswer: ".
+ echo "<p>$stranswer: </p>".
'<div style="padding-left: 30px;">';
if (empty($options->readonly)) {
// the student needs to type in their answer so print out a text editor
} else {
// it is read only, so just format the students answer and output it
echo format_text($value);
- echo '<input type="hidden" name="'.$inputname.'" value="'.htmlSpecialChars($value).'">'; // need hidden one for grading
+ echo '<input type="hidden" name="'.$inputname.'" value="'.htmlSpecialChars($value).'" />'; // need hidden one for grading
}
- echo '</div></p>';
+ echo '</div>';
if (isset($state->responses['response'])) {
$value = $state->responses['response'];
choose_from_menu($gradeoptions, $nameprefix."fraction", $state->responses['fraction'],"");
} else if (!empty($options->readonly)) {
//read only so format the comment and print it out
- echo "<p>$strcomment: ".
+ echo "<p>$strcomment: </p>".
'<div style="padding-left: 30px;">';
if (empty($value)) { // no comment yet
echo format_text(get_string('nocommentsyet', 'quiz'));
} else {
echo format_text($value, '', $formatoptions, $cmoptions->course);
}
- echo '</div></p>';
+ echo '</div>';
}
// feedback
$image = get_question_image($question, $cmoptions->course);
///// Print the input controls //////
- echo '<table border="0" cellpadding="10" align="right">';
foreach ($subquestions as $key => $subquestion) {
/// Subquestion text:
function print_question_formulation_and_controls(&$question, &$state, $cmoptions, $options) {
global $QTYPES;
$readonly = empty($options->readonly) ? '' : 'readonly="readonly"';
+ $disabled = empty($options->readonly) ? '' : 'disabled="disabled"';
$formatoptions->noclean = true;
$formatoptions->para = false;
$nameprefix = $question->name_prefix;
? ' selected="selected" ' : '';
$outputoptions .= "<option value=\"$mcanswer->id\" $selected>$mcanswer->answer</option>";
}
- echo "<select $popup $readonly $style name=\"$inputname\">";
+ echo "<select $popup $disabled $style name=\"$inputname\">";
echo $outputoptions;
echo '</select>';
break;
<td class="c0 control">
<?php echo $answer->control; ?>
</td>
- <td class="c1 text <?php echo $answer->class ?>"><label for="<?php echo $answer->id ?>">
- <?php echo $answer->text; ?>
+ <td class="c1 text <?php echo $answer->class ?>">
+ <label for="<?php echo $answer->id ?>">
+ <?php echo $answer->text; ?>
+ </label>
</td>
<td class="c0 feedback">
<?php echo $answer->feedback; ?>
<table id="q<?php echo $question->id; ?>" class="que <?php echo $question->qtype; ?>"><tr><td>
<div class="info">
<span class="no"><?php echo $number; ?></span>
- <span class="edit"><?php echo $editlink; ?></span>
+ <?php if ($editlink) { ?>
+ <span class="edit"><?php echo $editlink; ?></span>
+ <?php } ?>
<?php if ($grade) { ?>
<div class="grade">
<?php echo get_string('marks', 'quiz').': '.$grade; ?>
</div>
<?php } ?>
<?php $this->print_question_submit_buttons($question, $state, $cmoptions, $options); ?>
-</div>
-
-</div>
+</div>
\ No newline at end of file