Skip to content

Commit

Permalink
Now lesson->name supports filterall
Browse files Browse the repository at this point in the history
  • Loading branch information
stronk7 committed Apr 24, 2005
1 parent 1681c80 commit 0a2c259
Show file tree
Hide file tree
Showing 7 changed files with 32 additions and 34 deletions.
2 changes: 1 addition & 1 deletion mod/lesson/import.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
$strlessons = get_string("modulenameplural", "lesson");

print_header_simple("$strimportquestions", " $strimportquestions",
"<A HREF=index.php?id=$course->id>$strlessons</A> -> <a href=\"view.php?id=$cm->id\">$lesson->name</a>-> $strimportquestions");
"<a href=index.php?id=$course->id>$strlessons</a> -> <a href=\"view.php?id=$cm->id\">".format_string($lesson->name,true)."</a>-> $strimportquestions");

if ($form = data_submitted()) { /// Filename

Expand Down
4 changes: 2 additions & 2 deletions mod/lesson/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,10 @@
foreach ($lessons as $lesson) {
if (!$lesson->visible) {
//Show dimmed if the mod is hidden
$link = "<A class=\"dimmed\" HREF=\"view.php?id=$lesson->coursemodule\">$lesson->name</A>";
$link = "<a class=\"dimmed\" href=\"view.php?id=$lesson->coursemodule\">".format_string($lesson->name,true)."</a>";
} else {
//Show normal if the mod is visible
$link = "<A HREF=\"view.php?id=$lesson->coursemodule\">$lesson->name</A>";
$link = "<a href=\"view.php?id=$lesson->coursemodule\">".format_string($lesson->name,true)."</a>";
}

if ($lesson->deadline > $timenow) {
Expand Down
4 changes: 2 additions & 2 deletions mod/lesson/lesson.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,9 @@
$strlessonname = $lesson->name;

// ... print the header and...
print_header("$course->shortname: $lesson->name", "$course->fullname",
print_header("$course->shortname: ".format_string($lesson->name), "$course->fullname",
"$navigation <a href=index.php?id=$course->id>$strlessons</a> ->
<a href=\"view.php?id=$cm->id\">$lesson->name</a>", "", "", true);
<a href=\"view.php?id=$cm->id\">".format_string($lesson->name,true)."</a>", "", "", true);

// include the appropriate action (check to make sure the file is there first)
if (file_exists($CFG->dirroot.'/mod/lesson/action/'.$action.'.php')) {
Expand Down
12 changes: 6 additions & 6 deletions mod/lesson/lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -173,24 +173,24 @@ function lesson_update_instance($lesson) {
if ($userid = get_field("user", "id", "username", $lesson->deleteattempts)) {
if (delete_records("lesson_attempts", "lessonid", $lesson->id, "userid", $userid)) {
// email good
$message .= "Successfully deleted attempts from \"$lesson->name\" lesson!<br />";
$message .= "Successfully deleted attempts from \"".format_string($lesson->name)."\" lesson!<br />";
} else {
// email couldnt delete
$message .= "Failed to delete attempts from \"$lesson->name\" lesson!<br />";
$message .= "Failed to delete attempts from \"".format_string($lesson->name)."\" lesson!<br />";
}
if (delete_records("lesson_grades", "lessonid", $lesson->id, "userid", $userid)) {
// email good
$message .= "Successfully deleted grades from \"$lesson->name\" lesson!<br />";
$message .= "Successfully deleted grades from \"".format_string($lesson->name)."\" lesson!<br />";
} else {
// email couldnt delete
$message .= "Failed to delete grades from \"$lesson->name\" lesson!<br />";
$message .= "Failed to delete grades from \"".format_string($lesson->name)."\" lesson!<br />";
}
if (delete_records("lesson_timer", "lessonid", $lesson->id, "userid", $userid)) {
// email good
$message .= "Successfully deleted time records from \"$lesson->name\" lesson!<br />";
$message .= "Successfully deleted time records from \"".format_string($lesson->name)."\" lesson!<br />";
} else {
// email couldnt delete
$message .= "Failed to delete time records from \"$lesson->name\" lesson!<br />";
$message .= "Failed to delete time records from \"".format_string($lesson->name)."\" lesson!<br />";
}

} else {
Expand Down
6 changes: 3 additions & 3 deletions mod/lesson/report.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,13 +64,13 @@
'<input type="hidden" name="return" value="true" />'.
'<input type="submit" value="'. get_string('editlessonsettings', 'lesson') .'" /></form>';

print_header($course->shortname .': '. $lesson->name, $course->fullname,
"$navigation <A HREF=index.php?id=$course->id>$strlessons</A> -> <a href=\"view.php?id=$cm->id\">$lesson->name</a>
print_header($course->shortname .': '. format_string($lesson->name), $course->fullname,
"$navigation <A HREF=index.php?id=$course->id>$strlessons</A> -> <a href=\"view.php?id=$cm->id\">".format_string($lesson->name,true)."</a>
-> <a href=\"report.php?id=$cm->id\">".get_string("report", "lesson")."</a>",
'', '', true, $button,
navmenu($course, $cm));

print_heading(get_string("lesson", "lesson", $lesson->name), "center", 5);
print_heading(get_string("lesson", "lesson", format_string($lesson->name)), "center", 5);

// navigational links
$detaillink = "<a href=\"report.php?id=$cm->id&amp;action=detail\">".get_string("detailedstats", "lesson")."</a>";
Expand Down
2 changes: 1 addition & 1 deletion mod/lesson/restorelib.php
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ function lesson_restore_mods($mod,$restore) {
$newid = insert_record("lesson", $lesson);

//Do some output
echo "<li>".get_string("modulename","lesson")." \"".$lesson->name."\"</li>";
echo "<li>".get_string("modulename","lesson")." \"".format_string(stripslashes($lesson->name),true)."\"</li>";
backup_flush(300);

if ($newid) {
Expand Down
36 changes: 17 additions & 19 deletions mod/lesson/view.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,9 @@
if (isteacher($course->id)) {
$action = 'teacherview';
} elseif (time() < $lesson->available) {
print_header($course->shortname .': '. $lesson->name, $course->fullname,
print_header($course->shortname .': '. format_string($lesson->name), $course->fullname,
$navigation .'<a href="index.php?id='. $course->id .'">'. $strlessons .'</a> -> '.
'<a href="view.php?id='. $cm->id .'">'. $lesson->name .'</a>',
'<a href="view.php?id='. $cm->id .'">'. format_string($lesson->name,true) .'</a>',
'', '', true, '', navmenu($course, $cm));
print_simple_box_start('center');
echo '<div align="center">';
Expand All @@ -51,8 +51,8 @@
print_footer($course);
exit();
} elseif (time() > $lesson->deadline) {
print_header($course->shortname .': '. $lesson->name, $course->fullname,
"$navigation <a href=\"index.php?id=$course->id\">$strlessons</a> -> <a href=\"view.php?id=$cm->id\">$lesson->name</a>", '', "", true,
print_header($course->shortname .': '. format_string($lesson->name), $course->fullname,
"$navigation <a href=\"index.php?id=$course->id\">$strlessons</a> -> <a href=\"view.php?id=$cm->id\">".format_string($lesson->name,true)."</a>", '', "", true,
'', navmenu($course, $cm));
print_simple_box_start('center');
echo '<div align="center">';
Expand Down Expand Up @@ -90,8 +90,8 @@
$button = '';
}

print_header($course->shortname .': '. $lesson->name, $course->fullname,
"$navigation <a href=\"index.php?id=$course->id\">$strlessons</a> -> <a href=\"view.php?id=$cm->id\">$lesson->name</a>", '', '', true,
print_header($course->shortname .': '. format_string($lesson->name), $course->fullname,
"$navigation <a href=\"index.php?id=$course->id\">$strlessons</a> -> <a href=\"view.php?id=$cm->id\">".format_string($lesson->name,true)."</a>", '', '', true,
$button, // took out update_module_button($cm->id, $course->id, $strlesson) and replaced it with $button
navmenu($course, $cm));

Expand Down Expand Up @@ -122,7 +122,7 @@
if (isset($_POST['userpassword'])) {
echo "<tr align=\"center\" style='color:#DF041E;'><td>".get_string('loginfail', 'lesson') .'</td></tr>';
}
echo '<tr align="center"><td>'. get_string('passwordprotectedlesson', 'lesson', $lesson->name) .'</td></tr>';
echo '<tr align="center"><td>'. get_string('passwordprotectedlesson', 'lesson', format_string($lesson->name)) .'</td></tr>';
echo '<tr align="center"><td>'. get_string('enterpassword', 'lesson').' <input type="password" name="userpassword" /></td></tr>';

echo '<tr align="center"><td>';
Expand All @@ -142,7 +142,6 @@
// display individual pages and their sets of answers
// if pageid is EOL then the end of the lesson has been reached
// for flow, changed to simple echo for flow styles, michaelp, moved lesson name and page title down
//print_heading($lesson->name);
$timedflag = false;
$attemptflag = false;
if (empty($pageid)) {
Expand Down Expand Up @@ -547,7 +546,7 @@
// now starting to print the page's contents
echo "<div align=\"center\">";
echo "<em><strong>";
echo ($lesson->name) . "</strong></em>";
echo format_string($lesson->name) . "</strong></em>";
if ($page->qtype == LESSON_BRANCHTABLE) {
echo ":<br />";
print_heading($page->title);
Expand Down Expand Up @@ -1035,7 +1034,6 @@
}
}
} else {
//print_string("noattemptrecordsfound", "lesson");
if ($lesson->timed) {
if (isset($_GET["outoftime"])) {
if ($_GET["outoftime"] == "normal") {
Expand Down Expand Up @@ -1131,7 +1129,7 @@

/*******************teacher view **************************************/
elseif ($action == 'teacherview') {
print_heading_with_help($lesson->name, "overview", "lesson");
print_heading_with_help(format_string($lesson->name,true), "overview", "lesson");
// get number of pages
if ($page = get_record_select("lesson_pages", "lessonid = $lesson->id AND prevpageid = 0")) {
$npages = 1;
Expand Down Expand Up @@ -1531,7 +1529,7 @@

/*******************essay view **************************************/ // 6/29/04
elseif ($action == 'essayview') {
print_heading_with_help($lesson->name, "overview", "lesson");
print_heading_with_help(format_string($lesson->name,true), "overview", "lesson");

// get lesson pages that are essay
if (!$pages = get_records_select("lesson_pages", "lessonid = $lesson->id AND qtype = ".LESSON_ESSAY)) {
Expand Down Expand Up @@ -1614,7 +1612,7 @@

/*******************grade essays **************************************/ // 6/29/04
elseif ($action == 'essaygrade') {
print_heading_with_help($lesson->name, "overview", "lesson");
print_heading_with_help(format_string($lesson->name,true), "overview", "lesson");

$attemptid = required_param('attemptid', PARAM_INT);

Expand Down Expand Up @@ -1692,7 +1690,7 @@

/*******************update grade**************************************/ // 6/29/04
elseif ($action == 'updategrade') {
print_heading_with_help($lesson->name, "overview", "lesson");
print_heading_with_help(format_string($lesson->name,true), "overview", "lesson");

confirm_sesskey();

Expand Down Expand Up @@ -1742,7 +1740,7 @@

/*******************email essay **************************************/ // 6/29/04
elseif ($action == 'emailessay') {
print_heading_with_help($lesson->name, "overview", "lesson");
print_heading_with_help(format_string($lesson->name,true), "overview", "lesson");

confirm_sesskey();

Expand Down Expand Up @@ -1821,15 +1819,15 @@

/*******************high scores **************************************/
elseif ($action == 'highscores') {
print_heading_with_help($lesson->name, "overview", "lesson");
print_heading_with_help(format_string($lesson->name,true), "overview", "lesson");

if (!$grades = get_records_select("lesson_grades", "lessonid = $lesson->id", "completed")) {
$grades = array();
}

echo "<div align=\"center\">";
$titleinfo->maxhighscores = $lesson->maxhighscores;
$titleinfo->name = $lesson->name;
$titleinfo->name = format_string($lesson->name);
echo get_string("topscorestitle", "lesson", $titleinfo)."<br><br>";

if (!$highscores = get_records_select("lesson_high_scores", "lessonid = $lesson->id")) {
Expand Down Expand Up @@ -1870,7 +1868,7 @@
}
/*******************update high scores **************************************/
elseif ($action == 'updatehighscores') {
print_heading_with_help($lesson->name, "overview", "lesson");
print_heading_with_help(format_string($lesson->name,true), "overview", "lesson");

confirm_sesskey();

Expand Down Expand Up @@ -1949,7 +1947,7 @@
}
/*******************name for highscores **************************************/
elseif ($action == 'nameforhighscores') {
print_heading_with_help($lesson->name, "overview", "lesson");
print_heading_with_help(format_string($lesson->name,true), "overview", "lesson");
echo "<div align=\"center\">";
if (isset($_POST['name'])) {
$name = trim(clean_param($_POST['name'], PARAM_CLEAN));
Expand Down

0 comments on commit 0a2c259

Please sign in to comment.