mirror of
https://github.com/moodle/moodle.git
synced 2025-05-31 21:19:49 +02:00
I knew there was something else I'd forgotten!
Added a check to all modules (well view.php anyway) to check whether a module is hidden or not. If it is, then students get a message.
This commit is contained in:
parent
610603be4d
commit
3a4c2fd089
@ -10,7 +10,7 @@
|
||||
if (! $cm = get_record("course_modules", "id", $id)) {
|
||||
error("Course Module ID was incorrect");
|
||||
}
|
||||
|
||||
|
||||
if (! $course = get_record("course", "id", $cm->course)) {
|
||||
error("Course is misconfigured");
|
||||
}
|
||||
@ -56,8 +56,11 @@
|
||||
echo "<P align=right><A HREF=\"submissions.php?id=$assignment->id\">".
|
||||
get_string("viewsubmissions", "assignment", $count)."</A></P>";
|
||||
}
|
||||
} else if (!$cm->visible) {
|
||||
notice(get_string("activityiscurrentlyhidden"));
|
||||
}
|
||||
|
||||
|
||||
$strdifference = format_time($assignment->timedue - time());
|
||||
if (($assignment->timedue - time()) < 0) {
|
||||
$strdifference = "<FONT COLOR=RED>$strdifference</FONT>";
|
||||
|
@ -71,6 +71,8 @@
|
||||
$responsecount = 0;
|
||||
}
|
||||
echo "<P align=right><A HREF=\"report.php?id=$cm->id\">".get_string("viewallresponses", "choice", $responsecount)."</A></P>";
|
||||
} else if (!$cm->visible) {
|
||||
notice(get_string("activityiscurrentlyhidden"));
|
||||
}
|
||||
|
||||
print_simple_box( text_to_html($choice->text) , "center");
|
||||
|
@ -64,6 +64,10 @@
|
||||
print_header("$course->shortname: $forum->name", "$course->fullname",
|
||||
"$navigation $forum->name", "", "", true, $buttontext, navmenu($course, $cm));
|
||||
|
||||
if (!$cm->visible and !isteacher($course->id)) {
|
||||
notice(get_string("activityiscurrentlyhidden"));
|
||||
}
|
||||
|
||||
if ($USER) {
|
||||
$SESSION->fromdiscussion = "$FULLME";
|
||||
if (forum_is_forcesubscribed($forum->id)) {
|
||||
|
@ -43,6 +43,8 @@
|
||||
$entrycount = 0;
|
||||
}
|
||||
echo "<P align=right><A HREF=\"report.php?id=$cm->id\">".get_string("viewallentries","journal", $entrycount)."</A></P>";
|
||||
} else if (!$cm->visible) {
|
||||
notice(get_string("activityiscurrentlyhidden"));
|
||||
}
|
||||
|
||||
echo "<CENTER>\n";
|
||||
|
@ -60,6 +60,8 @@
|
||||
$answercount = 0;
|
||||
}
|
||||
echo "<P align=right><A HREF=\"report.php?id=$cm->id\">".get_string("viewallanswers","quiz",$answercount)."</A></P>";
|
||||
} else if (!$cm->visible) {
|
||||
notice(get_string("activityiscurrentlyhidden"));
|
||||
}
|
||||
|
||||
$available = ($quiz->timeopen < $timenow and $timenow < $quiz->timeclose);
|
||||
|
@ -30,6 +30,11 @@
|
||||
$navigation = "<A TARGET=\"{$CFG->framename}\" HREF=\"index.php?id=$course->id\">$strresources</A> ->";
|
||||
}
|
||||
|
||||
if (!$cm->visible and !isteacher($course->id)) {
|
||||
print_header("$course->shortname: $resource->name", "$course->fullname", "$navigation $resource->name",
|
||||
"", "", true, update_module_button($cm->id, $course->id, $strresource), navmenu($course, $cm));
|
||||
notice(get_string("activityiscurrentlyhidden"));
|
||||
}
|
||||
|
||||
switch ($resource->type) {
|
||||
case REFERENCE:
|
||||
|
@ -34,6 +34,8 @@
|
||||
$numusers = survey_count_responses($survey->id);
|
||||
echo "<P align=right><A HREF=\"report.php?id=$cm->id\">".
|
||||
get_string("viewsurveyresponses", "survey", $numusers)."</A></P>";
|
||||
} else if (!$cm->visible) {
|
||||
notice(get_string("activityiscurrentlyhidden"));
|
||||
}
|
||||
|
||||
if (isguest()) {
|
||||
@ -48,9 +50,9 @@
|
||||
print_heading(get_string("surveycompleted", "survey"));
|
||||
$numusers = survey_count_responses($survey->id);
|
||||
print_heading(get_string("peoplecompleted", "survey", $numusers));
|
||||
echo "<CENTER>";
|
||||
echo "<center>";
|
||||
survey_print_graph("id=$cm->id&sid=$USER->id&type=student.png");
|
||||
echo "</CENTER>";
|
||||
echo "</center>";
|
||||
print_footer($course);
|
||||
exit;
|
||||
}
|
||||
@ -58,8 +60,8 @@
|
||||
// Start the survey form
|
||||
add_to_log($course->id, "survey", "view form", "view.php?id=$cm->id", "$survey->id");
|
||||
|
||||
echo "<FORM NAME=form METHOD=post ACTION=save.php>";
|
||||
echo "<INPUT TYPE=hidden NAME=id VALUE=$id>";
|
||||
echo "<form name=form method=post action=save.php>";
|
||||
echo "<input type=hidden name=id value=$id>";
|
||||
|
||||
print_simple_box(text_to_html($survey->intro), "center", "80%");
|
||||
|
||||
@ -76,25 +78,25 @@
|
||||
$question = $questions["$val"];
|
||||
$question->id = $val;
|
||||
|
||||
if ($question->text) {
|
||||
$question->text = get_string($question->text, "survey");
|
||||
}
|
||||
if ($question->shorttext) {
|
||||
$question->shorttext = get_string($question->shorttext, "survey");
|
||||
}
|
||||
if ($question->type > 0) {
|
||||
if ($question->text) {
|
||||
$question->text = get_string($question->text, "survey");
|
||||
}
|
||||
if ($question->shorttext) {
|
||||
$question->shorttext = get_string($question->shorttext, "survey");
|
||||
}
|
||||
if ($question->intro) {
|
||||
$question->intro = get_string($question->intro, "survey");
|
||||
}
|
||||
if ($question->options) {
|
||||
$question->options = get_string($question->options, "survey");
|
||||
}
|
||||
}
|
||||
|
||||
if ($question->multi) {
|
||||
survey_print_multi($question);
|
||||
} else {
|
||||
survey_print_single($question);
|
||||
}
|
||||
if ($question->multi) {
|
||||
survey_print_multi($question);
|
||||
} else {
|
||||
survey_print_single($question);
|
||||
}
|
||||
}
|
||||
|
||||
@ -106,41 +108,45 @@
|
||||
|
||||
?>
|
||||
|
||||
<CENTER>
|
||||
<BR>
|
||||
<SCRIPT>
|
||||
<center>
|
||||
<br />
|
||||
<script>
|
||||
<!-- // BEGIN
|
||||
function checkform() {
|
||||
|
||||
var error=false;
|
||||
|
||||
with (document.form) {
|
||||
<? foreach ($checklist as $question => $default) {
|
||||
echo " if (".$question."[".$default."].checked) error=true;\n";
|
||||
}?>
|
||||
<?php
|
||||
if (!empty($checklist)) {
|
||||
foreach ($checklist as $question => $default) {
|
||||
echo " if (".$question."[".$default."].checked) error=true;\n";
|
||||
}
|
||||
}
|
||||
?>
|
||||
}
|
||||
|
||||
if (error) {
|
||||
alert("<?PHP print_string("questionsnotanswered", "survey") ?>");
|
||||
alert("<?php print_string("questionsnotanswered", "survey") ?>");
|
||||
} else {
|
||||
document.form.submit();
|
||||
}
|
||||
}
|
||||
|
||||
<?PHP echo "document.write('<INPUT TYPE=button VALUE=\"".get_string("clicktocontinuecheck", "survey")."\" onClick=\"checkform()\">');"; ?>
|
||||
<?php echo "document.write('<INPUT TYPE=button VALUE=\"".get_string("clicktocontinuecheck", "survey")."\" onClick=\"checkform()\">');"; ?>
|
||||
|
||||
// END -->
|
||||
</SCRIPT>
|
||||
|
||||
<NOSCRIPT>
|
||||
<noscript>
|
||||
<!-- Without Javascript, no checking is done -->
|
||||
<INPUT TYPE="submit" VALUE="<? get_string("clicktocontinue", "survey") ?>">
|
||||
</NOSCRIPT>
|
||||
<input type="submit" value="<? get_string("clicktocontinue", "survey") ?>">
|
||||
</noscript>
|
||||
|
||||
</CENTER>
|
||||
</center>
|
||||
|
||||
<?
|
||||
echo "</FORM>";
|
||||
echo "</form>";
|
||||
|
||||
print_footer($course);
|
||||
|
||||
|
@ -78,6 +78,9 @@
|
||||
}
|
||||
}
|
||||
elseif (!isguest()) { // it's a student then
|
||||
if (!$cm->visible) {
|
||||
notice(get_string("activityiscurrentlyhidden"));
|
||||
}
|
||||
switch ($workshop->phase) {
|
||||
case 0 :
|
||||
case 1 : $action = 'notavailable'; break;
|
||||
|
Loading…
x
Reference in New Issue
Block a user