Permalink
Browse files

Language fixes

  • Loading branch information...
1 parent e137027 commit 98899fc040bf673fdedfe6f0e6505674aef44a39 martin committed Aug 12, 2002
Showing with 59 additions and 46 deletions.
  1. +15 −6 mod/survey/details.php
  2. +16 −8 mod/survey/index.php
  3. +8 −21 mod/survey/lib.php
  4. +4 −3 mod/survey/mod.html
  5. +7 −4 mod/survey/save.php
  6. +9 −4 mod/survey/view.php
View
@@ -15,20 +15,27 @@
error("You can't modify this course!");
}
- print_header("$course->shortname: Editing a survey", "$course->shortname: Editing a survey",
- "<A HREF=\"$CFG->wwwroot/course/view.php?id=$course->id\">$course->shortname</A> ->
- Editing a survey", "");
+ $streditingasurvey = get_string("editingasurvey", "survey");
+
+ print_header("$course->shortname: $streditingasurvey", "$course->fullname",
+ "<A HREF=\"$CFG->wwwroot/course/view.php?id=$course->id\">$course->shortname</A>
+ -> $streditingasurvey");
+
+ if (!$form->name or !$form->template) {
+ error(get_string("filloutallfields"), $HTTP_REFERER);
+ }
print_simple_box_start("center", "", "$THEME->cellheading");
?>
<FORM NAME=form METHOD=post ACTION="<? p($form->destination)?>">
<TABLE CELLPADDING=5 ALIGN=CENTER>
- <TR><TD ALIGN=right NOWRAP><P><B>Name:</B></P></TD>
+ <TR><TD ALIGN=right NOWRAP><P><B><? print_string("name") ?>:</B></P></TD>
<TD><P><? p($form->name) ?></P></A></TD></TR>
<TR VALIGN=top>
<TD ALIGN=right NOWRAP>
- <P><B>Introduction Text:</B></P>
+ <P><B><? print_string("introtext", "survey") ?>:</B></P><BR>
+ <? helpbutton("text", get_string("helptext")) ?>
</TD>
<TD>
<TEXTAREA NAME="intro" ROWS=20 COLS=50 WRAP="virtual"><?
@@ -52,13 +59,15 @@
<input type="hidden" name=instance value="<? p($form->instance) ?>">
<input type="hidden" name=mode value="<? p($form->mode) ?>">
<CENTER>
- <input type="submit" value="Save these settings">
+ <input type="submit" value="<? print_string("savechanges") ?>">
</CENTER>
</FORM>
<?
print_simple_box_end();
print_footer($course);
+ } else {
+ error("You can't use this page like that!");
}
?>
View
@@ -16,37 +16,45 @@
if ($course->category) {
$navigation = "<A HREF=\"../../course/view.php?id=$course->id\">$course->shortname</A> ->";
}
- print_header("$course->shortname: Surveys", "$course->fullname", "$navigation Surveys", "");
+ $strsurveys = get_string("modulenameplural", "survey");
+ $strweek = get_string("week");
+ $strtopic = get_string("topic");
+ $strname = get_string("name");
+ $strstatus = get_string("status");
+ $strdone = get_string("done", "survey");
+ $strnotdone = get_string("notdone", "survey");
+
+ print_header("$course->shortname: $strsurveys", "$course->fullname", "$navigation $strsurveys", "");
if (! $surveys = get_all_instances_in_course("survey", $course->id, "cw.section ASC")) {
notice("There are no surveys.", "../../course/view.php?id=$course->id");
}
if ($course->format == "weeks") {
- $table->head = array ("Week", "Name", "Status");
+ $table->head = array ($strweek, $strname, $strstatus);
$table->align = array ("CENTER", "LEFT", "LEFT");
} else if ($course->format == "topics") {
- $table->head = array ("Topic", "Name", "Status");
+ $table->head = array ($strtopic, $strname, $strstatus);
$table->align = array ("CENTER", "LEFT", "LEFT");
} else {
- $table->head = array ("Name", "Status");
+ $table->head = array ($strname, $strstatus);
$table->align = array ("LEFT", "LEFT");
}
foreach ($surveys as $survey) {
if (survey_already_done($survey->id, $USER->id)) {
- $ss = "Done";
+ $ss = $strdone;
} else {
- $ss = "<A HREF=\"view.php?id=$survey->coursemodule\">Not done yet</A>";
+ $ss = $strnotdone;
}
if ($course->format == "weeks" or $course->format == "topics") {
$table->data[] = array ("$survey->section",
"<A HREF=\"view.php?id=$survey->coursemodule\">$survey->name</A>",
- "$ss");
+ "<A HREF=\"view.php?id=$survey->coursemodule\">$ss</A>");
} else {
$table->data[] = array ("<A HREF=\"view.php?id=$survey->coursemodule\">$survey->name</A>",
- "$ss");
+ "<A HREF=\"view.php?id=$survey->coursemodule\">$ss</A>");
}
}
View
@@ -82,22 +82,6 @@ function survey_already_done($survey, $user) {
return record_exists_sql("SELECT * FROM survey_answers WHERE survey='$survey' AND user='$user'");
}
-function survey_get_status($survey) {
-
- $timenow = time();
- if ($survey->locked) {
- if (($survey->timeopen <= $timenow) && ($timenow <= $survey->timeclose)) {
- return "released";
- } else if ($survey->timenow >= $survey->timeclose) {
- return "finished";
- } else {
- return "error";
- }
- } else {
- return "editing";
- }
-
-}
function survey_get_responses($survey) {
return get_records_sql("SELECT a.time as time, count(*) as numanswers, u.*
@@ -185,7 +169,7 @@ function survey_user_outline($course, $user, $mod, $survey) {
$lastanswer = array_pop($answers);
- $result->info = "Done";
+ $result->info = get_string("done", "survey");
$result->time = $lastanswer->time;
return $result;
}
@@ -199,7 +183,7 @@ function survey_user_complete($course, $user, $mod, $survey) {
if (survey_already_done($survey->id, $user->id)) {
echo "<IMG SRC=\"$CFG->wwwroot/mod/survey/graph.php?id=$mod->id&sid=$user->id&type=student.png\">";
} else {
- echo "Not done yet";
+ print_string("notdone", "survey");
}
}
@@ -208,6 +192,8 @@ function survey_print_multi($question) {
GLOBAL $db, $qnum, $checklist, $THEME;
+ $stripreferthat = get_string("ipreferthat", "survey");
+ $strifoundthat = get_string("ifoundthat", "survey");
echo "<P>&nbsp</P>\n";
echo "<P><FONT SIZE=4><B>$question->text</B></FONT></P>";
@@ -252,7 +238,7 @@ function survey_print_multi($question) {
} else {
echo "<TD WIDTH=10 VALIGN=middle rowspan=2><P><B>$qnum</B></P></TD>";
- echo "<TD WIDTH=10% NOWRAP><P><FONT SIZE=1>I prefer that&nbsp;</FONT></P></TD>";
+ echo "<TD WIDTH=10% NOWRAP><P><FONT SIZE=1>$stripreferthat&nbsp;</FONT></P></TD>";
echo "<TD WIDTH=40% VALIGN=middle rowspan=2><P>$q->text</P></TD>";
for ($i=1;$i<=$numoptions;$i++) {
echo "<TD WIDTH=10% ALIGN=CENTER><INPUT TYPE=radio NAME=qP$q->id VALUE=$i></TD>";
@@ -261,7 +247,7 @@ function survey_print_multi($question) {
echo "</TR>";
echo "<TR BGCOLOR=$bgcolor>";
- echo "<TD WIDTH=10% NOWRAP><P><FONT SIZE=1>I found that&nbsp;</P></TD>";
+ echo "<TD WIDTH=10% NOWRAP><P><FONT SIZE=1>$strifoundthat&nbsp;</P></TD>";
for ($i=1;$i<=$numoptions;$i++) {
echo "<TD WIDTH=10% ALIGN=CENTER><INPUT TYPE=radio NAME=q$q->id VALUE=$i></TD>";
}
@@ -295,8 +281,9 @@ function survey_print_single($question) {
echo "<TEXTAREA ROWS=3 COLS=30 WRAP=virtual NAME=\"$question->id\">$question->options</TEXTAREA>";
} else if ($question->type > 0) { // Choose one of a number
+ $strchoose = get_string("choose");
echo "<SELECT NAME=$question->id>";
- echo "<OPTION VALUE=0 SELECTED>Choose...</OPTION>";
+ echo "<OPTION VALUE=0 SELECTED>$strchoose...</OPTION>";
$options = explode( ",", $question->options);
foreach ($options as $key => $val) {
$key++;
View
@@ -1,17 +1,18 @@
<form name="form" method="post" action="<?=$CFG->wwwroot ?>/mod/survey/details.php">
<table cellpadding=5>
<tr valign=top>
- <td align=right><P><B>Survey Name:</B></P></TD>
+ <td align=right><P><B><? print_string("surveyname", "survey") ?>:</B></P></TD>
<td>
<input type="text" name="name" size=30 value="<? p($form->name) ?>">
</td>
</tr>
<tr>
- <td align=right><P><B>Survey Type:</B></P></TD>
+ <td align=right><P><B><? print_string("surveytype", "survey") ?>:</B></P></TD>
<td>
<?
if ($options = get_records_sql_menu("SELECT id, name FROM survey WHERE template='0'")) {
choose_from_menu($options, "template", $form->template);
+ helpbutton("surveys", get_string("helpsurveys", "survey"));
} else {
echo "No surveys to choose from!";
}
@@ -30,6 +31,6 @@
<input type="hidden" name=modulename value="<? p($form->modulename) ?>">
<input type="hidden" name=instance value="<? p($form->instance) ?>">
<input type="hidden" name=mode value="<? p($form->mode) ?>">
-<input type="submit" value="Save these settings">
+<input type="submit" value="<? print_string("savechanges") ?>">
</CENTER>
</FORM>
View
@@ -33,7 +33,7 @@
add_to_log($course->id, "survey", "submit", "view.php?id=$cm->id", "$survey->id");
if (survey_already_done($survey->id, $USER->id)) {
- notice("You've already submitted this survey!", $HTTP_REFERER);
+ notice(get_string("alreadysubmitted", "survey"), $HTTP_REFERER);
exit;
}
@@ -73,12 +73,15 @@
// Print the page and finish up.
- print_header("$course->shortname: Survey sent", "$course->fullname",
+ $strsurveys = get_string("modulenameplural", "survey");
+ $strsurveysaved = get_string("surveysaved", "survey");
+
+ print_header("$course->shortname: $strsurveysaved", "$course->fullname",
"<A HREF=/course/view.php?id=$course->id>$course->shortname</A> ->
- <A HREF=index.php?id=$course->id>Surveys</A> -> $survey->name -> Survey sent", "");
+ <A HREF=index.php?id=$course->id>$strsurveys</A> -> $survey->name -> $strsurveysaved", "");
- notice("Thanks for your answers, $USER->firstname.", "$CFG->wwwroot/course/view.php?id=$course->id");
+ notice(get_string("thanksforanswers","survey", $USER->firstname), "$CFG->wwwroot/course/view.php?id=$course->id");
exit;
View
@@ -22,22 +22,27 @@
if ($course->category) {
$navigation = "<A HREF=\"../../course/view.php?id=$course->id\">$course->shortname</A> ->";
}
+
+ $strsurveys = get_string("modulenameplural", "survey");
+
print_header("$course->shortname: $survey->name", "$course->fullname",
- "$navigation <A HREF=index.php?id=$course->id>Surveys</A> -> $survey->name", "", "", true,
+ "$navigation <A HREF=index.php?id=$course->id>$strsurveys</A> -> $survey->name", "", "", true,
update_module_icon($cm->id, $course->id));
if (isteacher($course->id)) {
- echo "<P align=right><A HREF=\"report.php?id=$cm->id\">View all responses</A></P>";
+ $numusers = survey_count_responses($survey->id);
+ echo "<P align=right><A HREF=\"report.php?id=$cm->id\">".
+ get_string("viewsurveyresponses", "survey", $numusers)."</A></P>";
}
// Check the survey hasn't already been filled out.
if (survey_already_done($survey->id, $USER->id)) {
add_to_log($course->id, "survey", "view graph", "view.php?id=$cm->id", "$survey->id");
- print_heading("You've completed this survey. The graph below shows a summary of your results compared to the class averages.");
+ print_heading(get_string("surveycompleted", "survey"));
$numusers = survey_count_responses($survey->id);
- print_heading("$numusers people have completed the survey so far");
+ print_heading(get_string("peoplecompleted", "survey", $numusers));
echo "<CENTER>";
echo "<IMG SRC=\"$CFG->wwwroot/mod/survey/graph.php?id=$cm->id&sid=$USER->id&type=student.png\">";
echo "</CENTER>";

0 comments on commit 98899fc

Please sign in to comment.