private function DragDropQuestion::imageStyle in Quiz Drag Drop 7
Helper function to generate question images.
Parameters
array $variables: Holds image related settings.
Return value
HTML HTML of image.
1 call to DragDropQuestion::imageStyle()
- DragDropQuestion::getSubquestions in ./
quiz_drag_drop.classes.inc - Helper function to fetch subquestions.
File
- ./
quiz_drag_drop.classes.inc, line 169 - Question type, enabling the creation of drag drop type of questions.
Class
- DragDropQuestion
- Extension of QuizQuestion.
Code
private function imageStyle($variables) {
// Determine the dimensions of the styled image.
$dimensions = array(
'width' => '',
'height' => 70,
);
image_style_transform_dimensions($variables['style_name'], $dimensions);
$variables['width'] = $dimensions['width'];
$variables['height'] = $dimensions['height'];
$variables['attributes'] = array(
'class' => 'draggable',
'id' => 'image_' . $variables['fid'],
);
// Determine the url for the styled image.
$variables['path'] = image_style_url($variables['style_name'], $variables['path']);
return theme('image', $variables);
}