Skip to content

Commit

Permalink
MDL-20585 Adding new lang strings
Browse files Browse the repository at this point in the history
  • Loading branch information
ppichet committed May 25, 2010
1 parent 03dd2f5 commit c4979f0
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 16 deletions.
23 changes: 14 additions & 9 deletions question/type/multianswer/edit_multianswer_form.php
Original file line number Diff line number Diff line change
Expand Up @@ -177,27 +177,30 @@ function definition_inner(&$mform) {
echo '</div>';
$this->negative_diff =$countsavedsubquestions - $countsubquestions ;
if ( ($this->negative_diff > 0 ) ||$this->qtype_change || ($this->used_in_quiz && $this->negative_diff != 0)){
$mform->addElement('header', 'additemhdr', "WARNING");
$mform->addElement('header', 'additemhdr', get_string('warningquestionmodified','qtype_multianswer'));
}
if($this->negative_diff > 0) {
//$this->used_in_quiz

$mform->addElement('static', 'alert1', "<strong>"."Question deleted"."</strong>","<strong>".$this->negative_diff.get_string('questionsless','qtype_multianswer')."</strong>");//$countsubquestions."-".$countsavedsubquestions
$mform->addElement('static', 'alert1', "<strong>".get_string('questiondeleted','qtype_multianswer')."</strong>",get_string('questionsless','qtype_multianswer',$this->negative_diff));
}
if($this->qtype_change )
{
$mform->addElement('static', 'alert1', "<strong>"."Question type change "."</strong>","<strong>".get_string('questiontypechanged','qtype_multianswer')."</strong>");//$countsubquestions."-".$countsavedsubquestions
$mform->addElement('static', 'alert1', "<strong>".get_string('questiontypechanged','qtype_multianswer')."</strong>",get_string('questiontypechangedcomment','qtype_multianswer'));
}
echo '</div>';
}
if( $this->used_in_quiz){
if($this->negative_diff < 0) {
$diff = $countsubquestions - $countsavedsubquestions;
$mform->addElement('static', 'alert1', "<strong>"."Question added "."</strong>","<strong>".$diff.get_string(' questions more than in the multtianswer question stored in the database','qtype_multianswer')."</strong>");//$countsubquestions."-".$countsavedsubquestions
if($this->negative_diff < 0) {
$diff = $countsubquestions - $countsavedsubquestions;
$mform->addElement('static', 'alert1', "<strong>".get_string('questionsadded','qtype_multianswer')."</strong>","<strong>".get_string('questionsmore','qtype_multianswer',$diff)."</strong>");
}
$a = new stdClass ;
$a->nb_of_quiz = $this->nb_of_quiz;
$a->nb_of_attempts = $this->nb_of_attempts;
$mform->addElement('header', 'additemhdr2', get_string('questionusedinquiz','qtype_multianswer',$a));
$mform->addElement('static', 'alertas', get_string('youshouldnot','qtype_multianswer'));
}
$mform->addElement('header', 'additemhdr2', "This question is used in $this->nb_of_quiz quiz(s), total attempt(s) : $this->nb_of_attempts ");
$mform->addElement('static', 'alertas', "<strong>"."YOU SHOULD NOT "."</strong>");//$countsubquestions."-".$countsavedsubquestions
}
if ( ($this->negative_diff > 0 || $this->used_in_quiz && ($this->negative_diff > 0 ||$this->negative_diff < 0 || $this->qtype_change ) ) && $this->reload ){
$mform->addElement('header', 'additemhdr', get_string('questionsaveasedited', 'qtype_multianswer'));
$mform->addElement('checkbox', 'confirm','' ,get_string('confirmquestionsaveasedited', 'qtype_multianswer'));
Expand Down Expand Up @@ -262,6 +265,7 @@ function set_data($question) {
}

// set default to $questiondisplay questions elements
if ( $this->reload ){
if (isset($this->questiondisplay->options->questions)) {
$subquestions = fullclone($this->questiondisplay->options->questions) ;
if (count($subquestions)) {
Expand Down Expand Up @@ -343,6 +347,7 @@ function set_data($question) {
}
}
}
}
$default_values['alertas']= "<strong>".get_string('questioninquiz','qtype_multianswer')."</strong>";

if( $default_values != "") {
Expand Down
21 changes: 14 additions & 7 deletions question/type/multianswer/lang/en/qtype_multianswer.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@
*/

$string['addingmultianswer'] = 'Adding an Embedded answers (Cloze) question';
$string['confirmsave']='Confirm then save {$a}' ;
$string['confirmquestionsaveasedited'] = ' I confirm that I want the question to be saved as edited';
$string['confirmsave'] = 'Confirm then save {$a}';
$string['correctanswer'] = 'Correct Answer';
$string['correctanswerandfeedback'] = 'Correct Answer and Feedback';
$string['decodeverifyquestiontext'] = 'Decode and Verify the Question Text';
Expand Down Expand Up @@ -55,18 +56,24 @@
$string['nooptionsforsubquestion'] = 'Unable to get options for question part # {$a->sub} (question->id={$a->id})';
$string['noquestions'] = 'The Cloze(multianswer) question "<strong>{$a}</strong>" does not contain any question';
$string['qtypenotrecognized'] = 'questiontype {$a} not recognized';
$string['questionnadded'] = '"Question added "';
$string['questiondefinition'] = 'Question definition';
$string['questionnotfound'] = 'Unable to find question of question part #{$a}';
$string['questionsmissing'] = 'No valid questions, create at least one question';
$string['unknownquestiontypeofsubquestion'] = 'Unknown question type: {$a->type} of question part # {$a->sub}';
$string['questionsless'] = 'questions less than in the multtianswer question stored in the database';
$string['questiontypechanged'] = ' at least one question type has been changed. Did you add,delete or move a question ? Look ahead ';
$string['questiondeleted'] = 'Question deleted' ;
$string['questioninquiz'] = '
<ul>
<li>add or delete questions, </li>
<li>change the questions order in the text,</li>
<li>change their question type (numerical, shortanswer, multiple choice). </li></ul>
';
$string['questionsless'] = '{$a} question(s) less than in the multianswer question stored in the database';
$string['questionsmissing'] = 'No valid questions, create at least one question';
$string['questionsmore'] = '{$a} question(s) more than in the multianswer question stored in the database';
$string['questionnotfound'] = 'Unable to find question of question part #{$a}';
$string['questionsaveasedited'] = 'The question will be saved as edited';
$string['confirmquestionsaveasedited'] = 'I confirm that I want the question be saved as edited';
$string['questiontypechanged'] = 'Question type changed';
$string['questiontypechangedcomment'] = ' At least one question type has been changed.<br \> Did you add, delete or move a question? <br \>Look ahead. ';
$string['questionusedinquiz'] = 'This question is used in {$a->nb_of_quiz} quiz(s), total attempt(s) : {$a->nb_of_attempts} ';
$string['unknownquestiontypeofsubquestion'] = 'Unknown question type: {$a->type} of question part # {$a->sub}';
$string['warningquestionmodified'] = '<b>WARNING</b>' ;
$string['youshouldnot'] = '<b>YOU SHOULD NOT</b>';

0 comments on commit c4979f0

Please sign in to comment.