Skip to content

Commit

Permalink
Merge branch 'master' of github.com:atutor/ATutor
Browse files Browse the repository at this point in the history
  • Loading branch information
atutorlangs committed Mar 21, 2013
2 parents 8e69804 + e5683f3 commit ea7fbd4
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 11 deletions.
1 change: 0 additions & 1 deletion include/install/upgrade.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,5 @@ function run_upgrade_sql($upgrade_sql_dir, $current_version, $tb_prefix=TABLE_PR
$sqlUtility->queryFromFile($upgrade_sql_dir . $update_file.'sql', $tb_prefix, $in_plain_msg);
}
}
debug($progress);
}
?>
13 changes: 11 additions & 2 deletions include/lib/output.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -654,7 +654,7 @@ function fix_quotes($text){
* Otherwise, return the original send-in parameter.
*/
function convert_youtube_playURL_to_watchURL($youtube_playURL) {
return preg_replace("/(http:\/\/[a-z0-9\.]*)?youtube.com\/v\/(.*)/",
return preg_replace("/(https?:\/\/[a-z0-9\.]*)?youtube.com\/v\/(.*)/",
"\\1youtube.com/watch?v=\\2", $youtube_playURL);
}

Expand All @@ -668,7 +668,7 @@ function convert_youtube_playURL_to_watchURL($youtube_playURL) {
* Otherwise, return the original send-in parameter.
*/
function convert_youtube_watchURL_to_playURL($youtube_watchURL) {
return preg_replace("/(http:\/\/[a-z0-9\.]*)?youtube.com\/watch\?v=(.*)/",
return preg_replace("/(https?:\/\/[a-z0-9\.]*)?youtube.com\/watch\?v=(.*)/",
"\\1youtube.com/v/\\2", $youtube_watchURL);
}

Expand Down Expand Up @@ -699,9 +699,18 @@ function embed_media($text) {
' src="http://gdata.youtube.com/feeds/mobile/videos/##MEDIA2##?alt=json-in-script&callback=ATutor.course.showYouTubeOnBlackberry&format=6" [^]'."\n".
' type="text/javascript">'."\n".
'</script>';
preg_match_all("#\[media[0-9a-z\|]*\]https://([a-z0-9\.]*)?youtube.com/watch\?v=(.*)\[/media\]#iU",$text,$media_matches[],PREG_SET_ORDER);
$media_replace[] = '<script type="text/javascript" src="'.$_base_path.'jscripts/ATutorYouTubeOnBlackberry.js"></script>'."\n".
'<p id="blackberry_##MEDIA2##">'."\n".
'<script'."\n".
' src="https://gdata.youtube.com/feeds/mobile/videos/##MEDIA2##?alt=json-in-script&amp;callback=ATutor.course.showYouTubeOnBlackberry&amp;format=6" [^]'."\n".
' type="text/javascript">'."\n".
'</script>';
} else {
preg_match_all("#\[media[0-9a-z\|]*\]http://([a-z0-9\.]*)?youtube.com/watch\?v=(.*)\[/media\]#iU",$text,$media_matches[],PREG_SET_ORDER);
$media_replace[] = '<object width="##WIDTH##" height="##HEIGHT##"><param name="movie" value="http://##MEDIA1##youtube.com/v/##MEDIA2##"></param><embed src="http://##MEDIA1##youtube.com/v/##MEDIA2##" type="application/x-shockwave-flash" width="##WIDTH##" height="##HEIGHT##"></embed></object>';
preg_match_all("#\[media[0-9a-z\|]*\]https://([a-z0-9\.]*)?youtube.com/watch\?v=(.*)\[/media\]#iU",$text,$media_matches[],PREG_SET_ORDER);
$media_replace[] = '<object width="##WIDTH##" height="##HEIGHT##"><param name="movie" value="https://##MEDIA1##youtube.com/v/##MEDIA2##"></param><embed src="https://##MEDIA1##youtube.com/v/##MEDIA2##" type="application/x-shockwave-flash" width="##WIDTH##" height="##HEIGHT##"></embed></object>';
}

// .mpg
Expand Down
28 changes: 21 additions & 7 deletions mods/_standard/tests/classes/testQuestions.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -806,7 +806,8 @@ function importQTI($question){
$answer_new[6],
$answer_new[7],
$answer_new[8],
$answer_new[9]);
$answer_new[9],
'DEFAULT');

$sql = vsprintf(AT_SQL_QUESTION_ORDERING, $sql_params);

Expand Down Expand Up @@ -888,7 +889,8 @@ function importQTI($question){
$_SESSION['course_id'],
$question['feedback'],
$question['question'],
$question['answer']);
$question['answer'],
'DEFAULT');

$sql = vsprintf(AT_SQL_QUESTION_TRUEFALSE, $sql_params);
$result = mysql_query($sql, $db);
Expand Down Expand Up @@ -1089,7 +1091,8 @@ function importQTI($question){
$_SESSION['course_id'],
$question['feedback'],
$question['question'],
$question['property']);
$question['property'],
'DEFAULT');

$sql = vsprintf(AT_SQL_QUESTION_LONG, $sql_params);

Expand Down Expand Up @@ -1287,7 +1290,8 @@ function importQTI($question){
$question['choice'][6],
$question['choice'][7],
$question['choice'][8],
$question['choice'][9]);
$question['choice'][9],
'DEFAULT');

$sql = vsprintf(AT_SQL_QUESTION_MATCHINGDD, $sql_params);

Expand Down Expand Up @@ -1438,9 +1442,18 @@ function importQTI($question){
$answers[6],
$answers[7],
$answers[8],
$answers[9]);

$answers[9],
'DEFAULT');
//
// debug($sql_params);
// debug(AT_SQL_QUESTION_MULTI);
// debug($question);
// debug(vsprintf(AT_SQL_QUESTION_MULTI, $sql_params));
// exit;
//
$sql = vsprintf(AT_SQL_QUESTION_MULTI, $sql_params);
//debug($sql);
//exit;
$result = mysql_query($sql, $db);
if ($result==true){
return mysql_insert_id();
Expand Down Expand Up @@ -1572,7 +1585,8 @@ function importQTI($question){
$question['answer'][6],
$question['answer'][7],
$question['answer'][8],
$question['answer'][9]);
$question['answer'][9],
'DEFAULT');

$sql = vsprintf(AT_SQL_QUESTION_MULTIANSWER, $sql_params);

Expand Down
2 changes: 1 addition & 1 deletion themes/default/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -1563,7 +1563,7 @@ div.forum-post-ctrl a { text-decoration: none; }
div.forum-post-ctrl span { color: black; background-color: #fefdc2; padding: 3px; }
div.forum-post-content p.date { color: #a1a1a1; border-bottom: 1px solid #F7F3ED;font-size:small;}
div.forum-post-content div.body p { margin-bottom:1em; }
div.forum-paginator{border:1px #DED29E solid; padding:.3em; width:95%;margin:auto;background-color:#F7F3ED;}
div.forum-paginator{border:1px #DED29E solid; padding:.3em; width:95%;margin:auto;background-color:#F4F0CB;}
span.forum-paginator-active{font-weight:700;text-decoration:underline; height:2em;}


Expand Down

0 comments on commit ea7fbd4

Please sign in to comment.