You are here

function is_multimedia_by_extension in Quiz 6.5

Same name and namespace in other branches
  1. 6.6 includes/moodle/question/format/qti2/qt_common.php \is_multimedia_by_extension()

determines whether or not a file is a multimedia file, based on the file extension

Parameters

string $file the filename:

Return value

boolean

1 call to is_multimedia_by_extension()
get_media_tag in includes/moodle/question/format/qti2/qt_common.php
creates a media tag to use for choice media

File

includes/moodle/question/format/qti2/qt_common.php, line 69

Code

function is_multimedia_by_extension($file) {
  $extensionsregex = '/\\.(swf|mov|mpg|mpeg|wmf|avi|mpe|flv)$/';
  if (preg_match($extensionsregex, $file)) {
    return true;
  }
  return false;
}