Merge branch 'MDL-32087' of git://github.com/timhunt/moodle
This commit is contained in:
@@ -269,6 +269,7 @@ $string['questiontype'] = 'Question type';
|
||||
$string['questionuse'] = 'Use question in this activity';
|
||||
$string['questionvariant'] = 'Question variant';
|
||||
$string['reviewresponse'] = 'Review response';
|
||||
$string['save'] = 'Save';
|
||||
$string['saveflags'] = 'Save the state of the flags';
|
||||
$string['selectacategory'] = 'Select a category:';
|
||||
$string['selectaqtypefordescription'] = 'Select a question type to see its description.';
|
||||
@@ -298,7 +299,7 @@ $string['answer'] = 'Answer';
|
||||
$string['answersaved'] = 'Answer saved';
|
||||
$string['attemptfinished'] = 'Attempt finished';
|
||||
$string['attemptfinishedsubmitting'] = 'Attempt finished submitting: ';
|
||||
$string['behaviourbeingused'] = 'behaviour being used: {$a}';
|
||||
$string['behaviourbeingused'] = 'Behaviour being used: {$a}';
|
||||
$string['cannotloadquestion'] = 'Could not load question';
|
||||
$string['cannotpreview'] = 'You can\'t preview these questions!';
|
||||
$string['category'] = 'Category';
|
||||
@@ -403,6 +404,12 @@ $string['submissionoutofsequencefriendlymessage'] = "You have entered data outsi
|
||||
$string['submit'] = 'Submit';
|
||||
$string['submitandfinish'] = 'Submit and finish';
|
||||
$string['submitted'] = 'Submit: {$a}';
|
||||
$string['technicalinfo'] = 'Technical information';
|
||||
$string['technicalinfo_help'] = 'This technical information is probably only useful for developers working on new question types. It may also be helpful when trying to diagnose problems with questions.';
|
||||
$string['technicalinfominfraction'] = 'Minimum fraction: {$a}';
|
||||
$string['technicalinfoquestionsummary'] = 'Question summary: {$a}';
|
||||
$string['technicalinforightsummary'] = 'Right answer summary: {$a}';
|
||||
$string['technicalinfostate'] = 'Question state: {$a}';
|
||||
$string['unknownbehaviour'] = 'Unknown behaviour: {$a}.';
|
||||
$string['unknownquestion'] = 'Unknown question: {$a}.';
|
||||
$string['unknownquestioncatregory'] = 'Unknown question category: {$a}.';
|
||||
|
||||
+46
-28
@@ -132,7 +132,7 @@ $optionsform->set_data($options);
|
||||
|
||||
// Process change of settings, if that was requested.
|
||||
if ($newoptions = $optionsform->get_submitted_data()) {
|
||||
// Set user preferences
|
||||
// Set user preferences.
|
||||
$options->save_user_preview_options($newoptions);
|
||||
if (!isset($newoptions->variant)) {
|
||||
$newoptions->variant = $options->variant;
|
||||
@@ -205,22 +205,32 @@ if ($question->length) {
|
||||
} else {
|
||||
$displaynumber = 'i';
|
||||
}
|
||||
$restartdisabled = '';
|
||||
$finishdisabled = '';
|
||||
$filldisabled = '';
|
||||
$restartdisabled = array();
|
||||
$finishdisabled = array();
|
||||
$filldisabled = array();
|
||||
if ($quba->get_question_state($slot)->is_finished()) {
|
||||
$finishdisabled = ' disabled="disabled"';
|
||||
$filldisabled = ' disabled="disabled"';
|
||||
$finishdisabled = array('disabled' => 'disabled');
|
||||
$filldisabled = array('disabled' => 'disabled');
|
||||
}
|
||||
// If question type cannot give us a correct response, disable this button.
|
||||
if (is_null($quba->get_correct_response($slot))) {
|
||||
$filldisabled = ' disabled="disabled"';
|
||||
$filldisabled = array('disabled' => 'disabled');
|
||||
}
|
||||
if (!$previewid) {
|
||||
$restartdisabled = ' disabled="disabled"';
|
||||
$restartdisabled = array('disabled' => 'disabled');
|
||||
}
|
||||
|
||||
// Output
|
||||
// Prepare technical info to be output.
|
||||
$qa = $quba->get_question_attempt($slot);
|
||||
$technical = array();
|
||||
$technical[] = get_string('behaviourbeingused', 'question',
|
||||
question_engine::get_behaviour_name($qa->get_behaviour_name()));
|
||||
$technical[] = get_string('technicalinfominfraction', 'question', $qa->get_min_fraction());
|
||||
$technical[] = get_string('technicalinfoquestionsummary', 'question', s($qa->get_question_summary()));
|
||||
$technical[] = get_string('technicalinforightsummary', 'question', s($qa->get_right_answer_summary()));
|
||||
$technical[] = get_string('technicalinfostate', 'question', '' . $qa->get_state());
|
||||
|
||||
// Start output.
|
||||
$title = get_string('previewquestion', 'question', format_string($question->name));
|
||||
$headtags = question_engine::initialise_js() . $quba->render_question_head_html($slot);
|
||||
$PAGE->set_title($title);
|
||||
@@ -228,30 +238,38 @@ $PAGE->set_heading($title);
|
||||
echo $OUTPUT->header();
|
||||
|
||||
// Start the question form.
|
||||
echo '<form method="post" action="' . $actionurl .
|
||||
'" enctype="multipart/form-data" id="responseform">', "\n";
|
||||
echo '<div>';
|
||||
echo '<input type="hidden" name="sesskey" value="' . sesskey() . '" />', "\n";
|
||||
echo '<input type="hidden" name="slots" value="' . $slot . '" />', "\n";
|
||||
echo '</div>';
|
||||
echo html_writer::start_tag('form', array('method' => 'post', 'action' => $actionurl,
|
||||
'enctype' => 'multipart/form-data', 'id' => 'responseform'));
|
||||
echo html_writer::start_tag('div');
|
||||
echo html_writer::empty_tag('input', array('type' => 'hidden', 'name' => 'sesskey', 'value' => sesskey()));
|
||||
echo html_writer::empty_tag('input', array('type' => 'hidden', 'name' => 'slots', 'value' => $slot));
|
||||
echo html_writer::empty_tag('input', array('type' => 'hidden', 'name' => 'scrollpos', 'value' => '', 'id' => 'scrollpos'));
|
||||
echo html_writer::end_tag('div');
|
||||
|
||||
// Output the question.
|
||||
echo $quba->render_question($slot, $options, $displaynumber);
|
||||
|
||||
echo '<p class="notifytiny">' . get_string('behaviourbeingused', 'question',
|
||||
question_engine::get_behaviour_name(
|
||||
$quba->get_question_attempt($slot)->get_behaviour_name())) . '</p>';
|
||||
// Finish the question form.
|
||||
echo '<div id="previewcontrols" class="controls">';
|
||||
echo '<input type="submit" name="restart"' . $restartdisabled .
|
||||
' value="' . get_string('restart', 'question') . '" />', "\n";
|
||||
echo '<input type="submit" name="fill"' . $filldisabled .
|
||||
' value="' . get_string('fillincorrect', 'question') . '" />', "\n";
|
||||
echo '<input type="submit" name="finish"' . $finishdisabled .
|
||||
' value="' . get_string('submitandfinish', 'question') . '" />', "\n";
|
||||
echo '<input type="hidden" name="scrollpos" id="scrollpos" value="" />';
|
||||
echo '</div>';
|
||||
echo '</form>';
|
||||
echo html_writer::start_tag('div', array('id' => 'previewcontrols', 'class' => 'controls'));
|
||||
echo html_writer::empty_tag('input', $restartdisabled + array('type' => 'submit',
|
||||
'name' => 'restart', 'value' => get_string('restart', 'question')));
|
||||
echo html_writer::empty_tag('input', $finishdisabled + array('type' => 'submit',
|
||||
'name' => 'save', 'value' => get_string('save', 'question')));
|
||||
echo html_writer::empty_tag('input', $filldisabled + array('type' => 'submit',
|
||||
'name' => 'fill', 'value' => get_string('fillincorrect', 'question')));
|
||||
echo html_writer::empty_tag('input', $finishdisabled + array('type' => 'submit',
|
||||
'name' => 'finish', 'value' => get_string('submitandfinish', 'question')));
|
||||
echo html_writer::end_tag('div');
|
||||
echo html_writer::end_tag('form');
|
||||
|
||||
// Output the technical info.
|
||||
print_collapsible_region_start('', 'techinfo', get_string('technicalinfo', 'question') .
|
||||
$OUTPUT->help_icon('technicalinfo', 'question'),
|
||||
'core_question_preview_techinfo_collapsed', true);
|
||||
foreach ($technical as $info) {
|
||||
echo html_writer::tag('p', $info, array('class' => 'notifytiny'));
|
||||
}
|
||||
print_collapsible_region_end();
|
||||
|
||||
// Display the settings form.
|
||||
$optionsform->display();
|
||||
|
||||
@@ -87,6 +87,10 @@ body.jsenabled #qtypechoicecontainer {display: block;}
|
||||
.importerror {margin-top: 10px;border-bottom: 1px solid #555;}
|
||||
.mform .que.comment .fitemtitle {width: 20%;}
|
||||
|
||||
#page-question-preview #techinfo {
|
||||
margin: 1em 0;
|
||||
}
|
||||
|
||||
/** Overide for RTL layout **/
|
||||
.dir-rtl #qtypechoicecontainer #chooseqtype .instruction,
|
||||
.dir-rtl #qtypechoicecontainer #chooseqtype .qtypesummary {right: 60%;left: 0%; border-left:0;border-right: 1px solid grey;}
|
||||
|
||||
Reference in New Issue
Block a user