]> git.mjollnir.org Git - moodle.git/commitdiff
Language fixes
authormartin <martin>
Mon, 12 Aug 2002 17:54:13 +0000 (17:54 +0000)
committermartin <martin>
Mon, 12 Aug 2002 17:54:13 +0000 (17:54 +0000)
mod/survey/details.php
mod/survey/index.php
mod/survey/lib.php
mod/survey/mod.html
mod/survey/save.php
mod/survey/view.php

index 11c0a3c7dd87bbc4181504670a1e53161a41fd3a..5f5dfb2d2faa0027e50d64cf2249bf13349fbf53 100644 (file)
             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"><? 
         <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!");
      }
 
 ?>
index 95d3323ef6e66f662c40da03b24083b7007abd47..9aca87a110c6e24931a0f80d6100581893547a34 100644 (file)
     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>");
         }
     }
 
index f8e2faf36521ba5cf8853fc201b63fed0b5b995f..0593e7d6c6d2928da22f4f9929d426231856ebee 100644 (file)
@@ -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++;
index 87a8ccdf12334bf09f67083d15458bd06946dcec..78dd2856d27f6d990748729d3937f1de5c4cfd2d 100644 (file)
@@ -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>
index ab59327a01c594c0c7106fbbbbfe1e1b9e4d505d..5af81ef9c1c7fed1de97d21ccc7818b1c47697cf 100644 (file)
@@ -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;
     }
 
 
 // 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;
     
index dd8903fafe1746bade8659fb21d26f47264ba8e4..6e2f79e78063dba2fc83cbc0a4608ffd8e74afba 100644 (file)
     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>";
     }
 
 
@@ -35,9 +40,9 @@
 
     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>";