From cc215bfd67e210aa959e02e802ac037dcc3fe4b9 Mon Sep 17 00:00:00 2001 From: atutor Date: Tue, 12 Mar 2013 19:40:49 +0000 Subject: [PATCH 1/4] add remedial_content to test import params --- .../tests/classes/testQuestions.class.php | 28 ++++++++++++++----- 1 file changed, 21 insertions(+), 7 deletions(-) diff --git a/mods/_standard/tests/classes/testQuestions.class.php b/mods/_standard/tests/classes/testQuestions.class.php index fa51ef801..35654ddd2 100644 --- a/mods/_standard/tests/classes/testQuestions.class.php +++ b/mods/_standard/tests/classes/testQuestions.class.php @@ -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); @@ -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); @@ -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); @@ -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); @@ -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(); @@ -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); From 8d50173e8a65ba9301a81f595c77cadaea9b07d4 Mon Sep 17 00:00:00 2001 From: atutor Date: Wed, 13 Mar 2013 15:46:57 +0000 Subject: [PATCH 2/4] tweek forum thread background colour --- themes/default/styles.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/themes/default/styles.css b/themes/default/styles.css index cc4256d74..fedf19f87 100644 --- a/themes/default/styles.css +++ b/themes/default/styles.css @@ -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;} From fcf6f3226533c32d1e4c8d45979de12ba38ed4a1 Mon Sep 17 00:00:00 2001 From: atutor Date: Thu, 14 Mar 2013 14:47:54 +0000 Subject: [PATCH 3/4] remove leftover debug() --- include/install/upgrade.inc.php | 1 - 1 file changed, 1 deletion(-) diff --git a/include/install/upgrade.inc.php b/include/install/upgrade.inc.php index 53459fbc7..080ca3ed0 100644 --- a/include/install/upgrade.inc.php +++ b/include/install/upgrade.inc.php @@ -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); } ?> From cd7312328994fa8fe2006a6263a84b7b28b893aa Mon Sep 17 00:00:00 2001 From: Dhruv Jagetiya Date: Mon, 18 Mar 2013 18:49:18 +0530 Subject: [PATCH 4/4] Fixes youtube video inserted in the [media] tags breaks if https is used. --- include/lib/output.inc.php | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/include/lib/output.inc.php b/include/lib/output.inc.php index 399b8e13e..2d906542c 100644 --- a/include/lib/output.inc.php +++ b/include/lib/output.inc.php @@ -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); } @@ -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); } @@ -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". ''; + 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[] = ''."\n". + '

'."\n". + ''."\n". + ''; } 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[] = ''; + 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[] = ''; } // .mpg