|
";
echo get_string("pagecontents", "lesson").": \n";
print_textarea($usehtmleditor, 25, 70, 630, 400, "contents", $page->contents);
if ($usehtmleditor) {
use_html_editor("contents");
}
echo " | \n";
$n = 0;
switch ($page->qtype) {
case LESSON_BRANCHTABLE :
echo "qtype\" />\n";
echo "\n";
echo "";
if ($page->layout) {
echo "";
} else {
echo "";
}
echo get_string("arrangebuttonshorizontally", "lesson")."\n";
echo " ";
if ($page->display) {
echo "";
} else {
echo "";
}
echo get_string("displayinleftmenu", "lesson")."\n";
echo " |
\n";
echo "".get_string("branchtable", "lesson")." \n";
break;
case LESSON_CLUSTER :
echo "qtype\" />\n";
echo " |
".get_string("clustertitle", "lesson")." \n";
break;
case LESSON_ENDOFCLUSTER :
echo "qtype\" />\n";
echo " |
".get_string("endofclustertitle", "lesson")." \n";
break;
case LESSON_ENDOFBRANCH :
echo "qtype\" />\n";
echo " |
".get_string("endofbranch", "lesson")." \n";
break;
default :
echo " |
";
break;
}
echo " |
\n";
// get the answers in a set order, the id order
if ($answers = get_records("lesson_answers", "pageid", $page->id, "id")) {
foreach ($answers as $answer) {
$flags = intval($answer->flags); // force into an integer
$nplus1 = $n + 1;
echo "id\" />\n";
switch ($page->qtype) {
case LESSON_MATCHING:
if ($n == 0) {
echo "\n";
if ($flags & LESSON_ANSWER_EDITOR) {
echo " [: ".
"";
helpbutton("useeditor", get_string("useeditor", "lesson"), "lesson");
echo "] \n";
print_textarea($usehtmleditor, 20, 70, 630, 300, "answer[$n]", $answer->answer);
use_html_editor("answer[$n]"); // switch on the editor
} else {
echo " [: ".
"";
helpbutton("useeditor", get_string("useeditor", "lesson"), "lesson");
echo "] \n";
print_textarea(false, 6, 70, 630, 300, "answer[$n]", $answer->answer);
}
} elseif ($n == 1) {
echo " |
\n";
if ($flags & LESSON_ANSWER_EDITOR) {
echo " [: ".
"";
helpbutton("useeditor", get_string("useeditor", "lesson"), "lesson");
echo "] \n";
print_textarea($usehtmleditor, 20, 70, 630, 300, "answer[$n]", $answer->answer);
use_html_editor("answer[$n]"); // switch on the editor
} else {
echo " [: ".
"";
helpbutton("useeditor", get_string("useeditor", "lesson"), "lesson");
echo "] \n";
print_textarea(false, 6, 70, 630, 300, "answer[$n]", $answer->answer);
}
} else {
$ncorrected = $n - 1;
echo " |
\n";
if ($flags & LESSON_ANSWER_EDITOR) {
echo " [: ".
"";
helpbutton("useeditor", get_string("useeditor", "lesson"), "lesson");
echo "] \n";
print_textarea($usehtmleditor, 20, 70, 630, 300, "answer[$n]", $answer->answer);
use_html_editor("answer[$n]"); // switch on the editor
} else {
echo " [: ".
"";
helpbutton("useeditor", get_string("useeditor", "lesson"), "lesson");
echo "] \n";
print_textarea(false, 6, 70, 630, 300, "answer[$n]", $answer->answer);
}
echo " |
\n";
echo "\n";
if ($flags & LESSON_RESPONSE_EDITOR) {
echo " [: ".
"";
helpbutton("useeditor", get_string("useeditor", "lesson"), "lesson");
echo "] \n";
print_textarea($usehtmleditor, 20, 70, 630, 300, "response[$n]", $answer->response);
use_html_editor("response[$n]"); // switch on the editor
} else {
echo " [: ".
"";
helpbutton("useeditor", get_string("useeditor", "lesson"), "lesson");
echo "] \n";
print_textarea(false, 6, 70, 630, 300, "response[$n]", $answer->response);
}
}
echo " |
\n";
break;
case LESSON_TRUEFALSE:
case LESSON_MULTICHOICE:
case LESSON_SHORTANSWER:
case LESSON_NUMERICAL:
echo "\n";
if ($flags & LESSON_ANSWER_EDITOR and $page->qtype != LESSON_SHORTANSWER and $page->qtype != LESSON_NUMERICAL) {
echo " [: ".
"";
helpbutton("useeditor", get_string("useeditor", "lesson"), "lesson");
echo "] \n";
print_textarea($usehtmleditor, 20, 70, 630, 300, "answer[$n]", $answer->answer);
use_html_editor("answer[$n]"); // switch on the editor
} else {
if ($page->qtype != LESSON_SHORTANSWER and $page->qtype != LESSON_NUMERICAL) {
echo " [: ".
"";
helpbutton("useeditor", get_string("useeditor", "lesson"), "lesson");
echo "] \n";
print_textarea(false, 6, 70, 630, 300, "answer[$n]", $answer->answer);
} else {
echo " \n";
print_textarea(false, 1, 70, 630, 300, "answer[$n]", $answer->answer);
}
}
echo " |
\n";
echo "\n";
if ($flags & LESSON_RESPONSE_EDITOR) {
echo " [: ".
"";
helpbutton("useeditor", get_string("useeditor", "lesson"), "lesson");
echo "] \n";
print_textarea($usehtmleditor, 20, 70, 630, 300, "response[$n]", $answer->response);
use_html_editor("response[$n]"); // switch on the editor
} else {
echo " [: ".
"";
helpbutton("useeditor", get_string("useeditor", "lesson"), "lesson");
echo "] \n";
print_textarea(false, 6, 70, 630, 300, "response[$n]", $answer->response);
}
echo " |
\n";
break;
case LESSON_BRANCHTABLE:
echo "\n";
if ($flags & LESSON_ANSWER_EDITOR) {
echo " [: ".
"";
helpbutton("useeditor", get_string("useeditor", "lesson"), "lesson");
echo "] \n";
print_textarea($usehtmleditor, 20, 70, 630, 300, "answer[$n]", $answer->answer);
use_html_editor("answer[$n]"); // switch on the editor
} else {
echo " [: ".
"";
helpbutton("useeditor", get_string("useeditor", "lesson"), "lesson");
echo "] \n";
print_textarea(false, 10, 70, 630, 300, "answer[$n]", $answer->answer);
}
echo " |
\n";
break;
}
switch ($page->qtype) {
case LESSON_MATCHING :
if ($n == 2) {
echo "".get_string("correctanswerjump", "lesson").": \n";
choose_from_menu($jump, "jumpto[$n]", $answer->jumpto, "");
helpbutton("jumpto", get_string("jump", "lesson"), "lesson");
if($lesson->custom)
echo get_string("correctanswerscore", "lesson").": score\" size=\"5\" />";
echo " |
\n";
}
if ($n == 3) {
echo "".get_string("wronganswerjump", "lesson").": \n";
choose_from_menu($jump, "jumpto[$n]", $answer->jumpto, "");
helpbutton("jumpto", get_string("jump", "lesson"), "lesson");
if($lesson->custom)
echo get_string("wronganswerscore", "lesson").": score\" size=\"5\" />";
echo " |
\n";
}
//echo "\n";
break;
case LESSON_ESSAY :
echo "".get_string("jump", "lesson").": \n";
choose_from_menu($jump, "jumpto[$n]", $answer->jumpto, "");
helpbutton("jumpto", get_string("jump", "lesson"), "lesson");
if($lesson->custom) {
echo get_string("score", "lesson").": score\" size=\"5\" />";
}
echo " |
\n";
break;
case LESSON_TRUEFALSE:
case LESSON_MULTICHOICE:
case LESSON_SHORTANSWER:
case LESSON_NUMERICAL:
echo "".get_string("jump", "lesson")." $nplus1: \n";
choose_from_menu($jump, "jumpto[$n]", $answer->jumpto, "");
helpbutton("jumpto", get_string("jump", "lesson"), "lesson");
if($lesson->custom) {
echo get_string("score", "lesson")." $nplus1: score\" size=\"5\" />";
}
echo " |
\n";
break;
case LESSON_BRANCHTABLE:
case LESSON_CLUSTER:
case LESSON_ENDOFCLUSTER:
case LESSON_ENDOFBRANCH:
echo "".get_string("jump", "lesson")." $nplus1: \n";
choose_from_menu($jump, "jumpto[$n]", $answer->jumpto, "");
helpbutton("jumpto", get_string("jump", "lesson"), "lesson");
echo " |
\n";
break;
}
$n++;
if ($page->qtype == LESSON_ESSAY) {
break; // only one answer for essays
}
}
}
if ($page->qtype != LESSON_ENDOFBRANCH && $page->qtype != LESSON_CLUSTER && $page->qtype != LESSON_ENDOFCLUSTER) {
if ($page->qtype == LESSON_MATCHING) {
$maxanswers = $lesson->maxanswers + 2;
} else {
$maxanswers = $lesson->maxanswers;
}
for ($i = $n; $i < $maxanswers; $i++) {
if ($page->qtype == LESSON_TRUEFALSE && $i > 1) {
break; // stop printing answers... only need two for true/false
}
$iplus1 = $i + 1;
echo "\n";
switch ($page->qtype) {
case LESSON_MATCHING:
$icorrected = $i - 1;
echo "".get_string("answer", "lesson")." $icorrected:\n";
echo " [".get_string("useeditor", "lesson").": ".
"";
helpbutton("useeditor", get_string("useeditor", "lesson"), "lesson");
echo "] \n";
print_textarea(false, 10, 70, 630, 300, "answer[$i]");
echo " |
\n";
echo "".get_string("matchesanswer", "lesson")." $icorrected:\n";
echo " [".get_string("useeditor", "lesson").": ".
"";
helpbutton("useeditor", get_string("useeditor", "lesson"), "lesson");
echo "] \n";
print_textarea(false, 10, 70, 630, 300, "response[$i]");
echo " |
\n";
break;
case LESSON_TRUEFALSE:
case LESSON_MULTICHOICE:
case LESSON_SHORTANSWER:
case LESSON_NUMERICAL:
echo "".get_string("answer", "lesson")." $iplus1:\n";
if ($page->qtype != LESSON_SHORTANSWER and $page->qtype != LESSON_NUMERICAL) {
echo " [".get_string("useeditor", "lesson").": ".
"";
helpbutton("useeditor", get_string("useeditor", "lesson"), "lesson");
echo "] \n";
print_textarea(false, 10, 70, 630, 300, "answer[$i]");
} else {
echo " \n";
print_textarea(false, 1, 70, 630, 300, "answer[$i]");
}
echo " |
\n";
echo "".get_string("response", "lesson")." $iplus1:\n";
echo " [".get_string("useeditor", "lesson").": ".
"";
helpbutton("useeditor", get_string("useeditor", "lesson"), "lesson");
echo "] \n";
print_textarea(false, 10, 70, 630, 300, "response[$i]");
echo " |
\n";
break;
case LESSON_BRANCHTABLE:
echo "".get_string("description", "lesson")." $iplus1:\n";
echo " [".get_string("useeditor", "lesson").": ".
"";
helpbutton("useeditor", get_string("useeditor", "lesson"), "lesson");
echo "] \n";
print_textarea(false, 10, 70, 630, 300, "answer[$i]");
echo " |
\n";
break;
}
switch ($page->qtype) {
case LESSON_ESSAY :
if ($i < 1) {
echo "".get_string("jump", "lesson").": \n";
choose_from_menu($jump, "jumpto[$i]", 0, "");
helpbutton("jumpto", get_string("jump", "lesson"), "lesson");
if($lesson->custom) {
echo get_string("score", "lesson").": ";
}
echo " |
\n";
}
break;
case LESSON_MATCHING :
if ($i == 2) {
echo "".get_string("correctanswerjump", "lesson").": \n";
choose_from_menu($jump, "jumpto[$i]", $answer->jumpto, "");
helpbutton("jumpto", get_string("jump", "lesson"), "lesson");
if ($lesson->custom) {
echo get_string("correctanswerscore", "lesson").": score\" size=\"5\" />";
}
echo " |
\n";
}
if ($i == 3) {
echo "".get_string("wronganswerjump", "lesson").": \n";
choose_from_menu($jump, "jumpto[$i]", $answer->jumpto, "");
helpbutton("jumpto", get_string("jump", "lesson"), "lesson");
if ($lesson->custom) {
echo get_string("wronganswerscore", "lesson").": score\" size=\"5\" />";
}
echo " |
\n";
}
break;
case LESSON_TRUEFALSE:
case LESSON_MULTICHOICE:
case LESSON_SHORTANSWER:
case LESSON_NUMERICAL:
echo "".get_string("jump", "lesson")." $iplus1: \n";
choose_from_menu($jump, "jumpto[$i]", 0, "");
helpbutton("jumpto", get_string("jump", "lesson"), "lesson");
if($lesson->custom) {
echo get_string("score", "lesson")." $iplus1: ";
}
echo " |
\n";
break;
case LESSON_BRANCHTABLE :
echo "".get_string("jump", "lesson")." $iplus1: \n";
choose_from_menu($jump, "jumpto[$i]", 0, "");
helpbutton("jumpto", get_string("jump", "lesson"), "lesson");
echo " |
\n";
break;
}
}
}
// close table and form
?>