Skip to content

Commit

Permalink
MDL-47494 ddmarker: OU-2488 Improved English in coordinate validation…
Browse files Browse the repository at this point in the history
… error messages.
  • Loading branch information
jamiepratt committed Dec 2, 2011
1 parent f76c454 commit 6daf12f
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 6 deletions.
9 changes: 6 additions & 3 deletions question/type/ddmarker/lang/en/qtype_ddmarker.php
Expand Up @@ -65,11 +65,14 @@
$string['clearwrongparts'] = 'Move incorrectly placed markers back to default start position below image';
$string['shape'] = 'Shape';
$string['shape_circle'] = 'Circle';
$string['shape_circle_coords'] = 'centerx, centery; radius';
$string['shape_circle_lowercase'] = 'circle';
$string['shape_circle_coords'] = 'x,y;r (where x,y are the xy coordinates of the center of the circle and r is the radius)';
$string['shape_rectangle'] = 'Rectangle';
$string['shape_rectangle_coords'] = 'leftx, topy; width, height';
$string['shape_rectangle_lowercase'] = 'rectangle';
$string['shape_rectangle_coords'] = 'x,y;w,h (where x,y are the xy coordinates of the top left corner of the rectangle and w and h are the width and height of the rectangle)';
$string['shape_polygon'] = 'Polygon';
$string['shape_polygon_coords'] = 'x1,y1;x2,y2;x3,y3;x4,y4....';
$string['shape_polygon_lowercase'] = 'polygon';
$string['shape_polygon_coords'] = 'x1,y1;x2,y2;x3,y3;x4,y4....(where x1, y1 are the x,y coordinates of the first vertex, x2, y2 are the x,y coordinates of the second, etc. You do not need to repeat the coordinates for the first vertex to close the polygon)';
$string['showmisplaced'] = 'Highlight drop zones which have not had the correct marker dropped on them';
$string['shuffleimages'] = 'Shuffle drag items each time question is attempted';
$string['stateincorrectlyplaced'] = 'State which markers are incorrectly placed';
Expand Down
10 changes: 7 additions & 3 deletions question/type/ddmarker/shapes.php
Expand Up @@ -67,7 +67,7 @@ protected function is_point_in_bounding_box($pointxy, $xleftytop, $xrightybottom
public function get_coords_interpreter_error() {
if ($this->error) {
$a = new stdClass();
$a->shape = self::human_readable_name();
$a->shape = self::human_readable_name(true);
$a->coordsstring = self::human_readable_coords_format();
return get_string('formerror_'.$this->error, 'qtype_ddmarker', $a);
} else {
Expand All @@ -87,8 +87,12 @@ public static function name() {

protected static $classnameprefix = 'qtype_ddmarker_shape_';

public static function human_readable_name() {
return get_string('shape_'.self::name(), 'qtype_ddmarker');
public static function human_readable_name($lowercase = false) {
$stringid = 'shape_'.self::name();
if ($lowercase) {
$stringid .= '_lowercase';
}
return get_string($stringid, 'qtype_ddmarker');
}

public static function human_readable_coords_format() {
Expand Down

0 comments on commit 6daf12f

Please sign in to comment.