removing redundant files after migration to formslib and some further bug fixing in question type forms.

This commit is contained in:
jamiesensei 2007-01-07 16:36:38 +00:00
parent cfcfddbcbf
commit 04786f082d
7 changed files with 2 additions and 127 deletions

View File

@ -1,8 +0,0 @@
<?php
$QTYPES[$question->qtype]->print_question_form_start($question, array(), $course, $usehtmleditor,
array('defaultgrade', 'penalty'));
?>
<input type="hidden" name="defaultgrade" value="0" />
<?php
$QTYPES[$question->qtype]->print_question_form_end($question);
?>

View File

@ -1,6 +0,0 @@
<?php // $Id$
print_heading_with_help(get_string("editingdescription", "quiz"), "description", "quiz");
require("$CFG->dirroot/question/type/description/editquestion.html");
?>

View File

@ -1,17 +0,0 @@
<?php
$QTYPES[$question->qtype]->print_question_form_start($question, array(), $course, $usehtmleditor);
?>
<tr valign="top">
<td align="right">
<b><?php print_string("feedback", "quiz") ?>:</b>
</td>
<td>
<?php print_textarea(false, 10, 60, 630, 200, "feedback", $options->answer->feedback); ?>
</td>
</tr>
<?php
$QTYPES[$question->qtype]->print_replacement_options($question, $course, $contextquiz);
$QTYPES[$question->qtype]->print_question_form_end($question, '',
'<input type="hidden" name="fraction" value="0" />'); // dont think there would ever be a different value other than 1...
?>

View File

@ -1,12 +0,0 @@
<?php // $Id$
if (!empty($question->id)) {
$options->answer = get_record("question_answers", "question", $question->id);
} else {
$options->answer->feedback = '';
}
print_heading_with_help(get_string("editingessay", "quiz"), "essay", "quiz");
require("$CFG->dirroot/question/type/essay/editquestion.html");
?>

View File

@ -18,8 +18,9 @@ class question_edit_match_form extends question_edit_form {
* @param object $mform the form being built.
*/
function definition_inner(&$mform) {
$mform->addElement('selectyesno', 'shuffleanswers', get_string('shuffle', 'quiz'));
$mform->addElement('advcheckbox', 'shuffleanswers', get_string('shuffle', 'quiz'), null, array(0,1));
$mform->setHelpButton('shuffleanswers', array('matchshuffle', get_string('shuffle','quiz'), 'quiz'));
$mform->setDefault('shuffleanswers', 1);
$mform->addElement('static', 'answersinstruct', get_string('choices', 'quiz'), get_string('filloutthreequestions', 'quiz'));
$mform->closeHeaderBefore('answersinstruct');

View File

@ -1,46 +0,0 @@
<?php
$QTYPES[$question->qtype]->print_question_form_start($question, array(), $course, $usehtmleditor);
?>
<tr valign="top">
<td align="right"><b><?php print_string("choices", "quiz") ?></b>:</td>
<td align="left">
<div style="width: 30em">
<?php print_string("filloutthreequestions", "quiz") ?>
</div>
</td>
</tr>
<tr valign="top">
<td align="right"><b><?php print_string("shuffle", "quiz") ?>:</b></td>
<td align="left">
<?php
choose_from_menu($yesnooptions, "shuffleanswers", "$options->shuffleanswers", "");
helpbutton("matchshuffle", get_string("shuffle","quiz"), "quiz");
?>
</td>
</tr>
<?php
for ($i=1; $i <= count($subquestions); $i++) {
?>
<tr valign="top">
<td colspan="2">&nbsp;</td>
</tr>
<tr valign="top">
<td align="right"><b><?php print_string("questionno", "quiz", $i) ?>:</b></td>
<td align="left">
<textarea name="subquestions[]" rows="3" cols="50"><?php p($subquestions[$i-1]) ?></textarea>
</td>
</tr>
<tr valign="top">
<td align="right"><b><?php print_string("matchanswerno", "quiz", $i) ?>:</b></td>
<td align="left">
<input type="text" name="subanswers[]" size="50" value="<?php p($subanswers[$i-1]) ?>" alt="<?php print_string("matchanswerno", "quiz", $i) ?>" />
</td>
</tr>
<?php
}
$QTYPES[$question->qtype]->print_replacement_options($question, $course, $contextquiz);
$QTYPES[$question->qtype]->print_question_form_end($question);
?>

View File

@ -1,37 +0,0 @@
<?php // $Id$
if (!empty($question->id)) {
$options = get_record("question_match", "question", $question->id);
if (!empty($options->subquestions)) {
$oldsubquestions = get_records_list("question_match_sub", "id", $options->subquestions);
}
} else {
$options->shuffleanswers = 1;
}
$subquestions = array();
$subanswers = array();
if (!empty($oldsubquestions)) {
foreach ($oldsubquestions as $oldsubquestion) {
$subquestions[] = $oldsubquestion->questiontext; // insert questions into slots
$subanswers[] = $oldsubquestion->answertext; // insert answers into slots
}
}
$i = count($subquestions);
$limit = QUESTION_NUMANS;
$limit = $limit <= $i ? $i+1 : $limit;
for (; $i < $limit; $i++) {
$subquestions[] = ""; // Make question slots, default as blank
$subanswers[] = ""; // Make answer slots, default as blank
}
$yesnooptions = array();
$yesnooptions[0] = get_string("no");
$yesnooptions[1] = get_string("yes");
print_heading_with_help(get_string("editingmatch", "quiz"), "match", "quiz");
require("$CFG->dirroot/question/type/match/editquestion.html");
?>