".get_string("numberofpagesviewed", "lesson", $nviewed).
@@ -178,7 +178,7 @@
}
echo get_string("numberofcorrectanswers", "lesson", $ncorrect)."
\n";
$thegrade = intval(100 * $ncorrect / $nviewed);
- echo get_string("yourcurrentgradeis", "lesson",
+ echo get_string("yourcurrentgradeis", "lesson",
number_format($thegrade * $lesson->grade / 100, 1)).
" (".get_string("outof", "lesson", $lesson->grade).")
\n";
}
@@ -212,7 +212,7 @@
echo "";
// don't suffle answers (could be an option??)
@@ -298,14 +298,14 @@
if ($lesson->nextpagedefault) {
// in Flash Card mode...
// ...first get number of retakes
- $nretakes = count_records("lesson_grades", "lessonid", $lesson->id, "userid", $USER->id);
+ $nretakes = count_records("lesson_grades", "lessonid", $lesson->id, "userid", $USER->id);
// ...then get the page ids (lessonid the 5th param is needed to make get_records play)
$allpages = get_records("lesson_pages", "lessonid", $lesson->id, "id", "id,lessonid");
shuffle ($allpages);
$found = false;
if ($lesson->nextpagedefault == LESSON_UNSEENPAGE) {
foreach ($allpages as $thispage) {
- if (!count_records("lesson_attempts", "pageid", $thispage->id, "userid",
+ if (!count_records("lesson_attempts", "pageid", $thispage->id, "userid",
$USER->id, "retry", $nretakes)) {
$found = true;
break;
@@ -352,10 +352,10 @@
print_simple_box_start("center");
$ntries = count_records("lesson_grades", "lessonid", $lesson->id, "userid", $USER->id);
if (isstudent($course->id)) {
- if ($nviewed = count_records("lesson_attempts", "lessonid", $lesson->id, "userid",
+ if ($nviewed = count_records("lesson_attempts", "lessonid", $lesson->id, "userid",
$USER->id, "retry", $ntries)) {
// count the number of distinct correct pages
- if ($correctpages = get_records_select("lesson_attempts", "lessonid = $lesson->id AND
+ if ($correctpages = get_records_select("lesson_attempts", "lessonid = $lesson->id AND
userid = $USER->id AND retry = $ntries AND correct = 1")) {
foreach ($correctpages as $correctpage) {
$temp[$correctpage->pageid] = 1;
@@ -369,7 +369,7 @@
if ($lesson->minquestions) {
if ($nviewed < $lesson->minquestions) {
// print a warning and set nviewed to minquestions
- echo "".get_string("youshouldview", "lesson",
+ echo " ".get_string("youshouldview", "lesson",
$lesson->minquestions)." ".get_string("pages", "lesson")." \n";
$nviewed = $lesson->minquestions;
}
@@ -377,7 +377,7 @@
echo "".get_string("numberofcorrectanswers", "lesson", $ncorrect).
" \n";
$thegrade = intval(100 * $ncorrect / $nviewed);
- echo "".get_string("gradeis", "lesson",
+ echo " ".get_string("gradeis", "lesson",
number_format($thegrade * $lesson->grade / 100, 1)).
" (".get_string("outof", "lesson", $lesson->grade).") \n";
$grade->lessonid = $lesson->id;
@@ -390,21 +390,21 @@
} else {
print_string("noattemptrecordsfound", "lesson");
$thegrade = 0;
- }
- } else {
+ }
+ } else {
// display for teacher
echo "".get_string("displayofgrade", "lesson")." \n";
}
print_simple_box_end();
- print_continue("../../course/view.php?id=$course->id");
+ print_continue("../../course/view.php?id=$course->id");
}
-
+
}
/*******************teacher view **************************************/
elseif ($action == 'teacherview') {
- print_heading_with_help($lesson->name, "overview", "lesson");
+ print_heading_with_help($lesson->name, "overview", "lesson");
// get number of pages
if ($page = get_record_select("lesson_pages", "lessonid = $lesson->id AND prevpageid = 0")) {
$npages = 1;
@@ -437,7 +437,6 @@
echo "";
echo get_string("pagecontents", "lesson").": \n";
print_textarea($usehtmleditor, 25, 70, 630, 400, "contents");
- use_html_editor("contents");
echo " | \n";
echo "".get_string("questiontype", "lesson").": \n";
choose_from_menu($LESSON_QUESTION_TYPE, "qtype", LESSON_MULTICHOICE, "");
@@ -470,6 +469,7 @@
id&pageid=0\">".get_string("importquestions",
"lesson")."\n");
@@ -502,7 +502,7 @@
"id&action=confirmdelete&pageid=$page->id\">\n".
" \n";
}
- echo " | \n";
+ echo "\n";
echo "| \n";
print_simple_box(format_text($page->contents), "center");
echo " | \n";
@@ -532,7 +532,7 @@
case LESSON_NUMERICAL :
echo $LESSON_QUESTION_TYPE[$page->qtype];
break;
- case LESSON_BRANCHTABLE :
+ case LESSON_BRANCHTABLE :
echo get_string("branchtable", "lesson");
break;
case LESSON_ENDOFBRANCH :
@@ -560,7 +560,7 @@
echo "\n";
echo "| ".get_string("response", "lesson")." $i: \n";
echo " | \n";
- echo format_text($answer->response);
+ echo format_text($answer->response);
echo " | \n";
break;
case LESSON_BRANCHTABLE:
@@ -634,7 +634,7 @@
}
}
$prevpageid = $page->id;
- // move to next page
+ // move to next page
if ($page->nextpageid) {
if (!$page = get_record("lesson_pages", "id", $page->nextpageid)) {
error("Teacher view: Next page not found!");
@@ -652,9 +652,9 @@
/*************** no man's land **************************************/
- else {
- error("Fatal Error: Unknown Action: ".$action."\n");
- }
+ else {
+ error("Fatal Error: Unknown Action: ".$action."\n");
+ }
/// Finish the page
print_footer($course);
|