00001 <?php
00002
00011 class TKSnapInteractivateInstructorPreview extends TKSnapPreview {
00019 protected function getTranslators() {
00020 global $prm;
00021 $prm->includeCSS('libs/InteractivateSnap.lib.css', 'DefaultSkin');
00022 return array(
00023 'Interactivate Instructor' => 'STransInteractivateInstructor',
00024 'Standard XML 3' => 'STransStdXML3'
00025 );
00026 }
00027
00035 protected function getFormattedSource() {
00036 return SXMLHelper::formatXMLSource($this->version->getContentModule()->getXML());
00037 }
00038
00046 protected function getParameters() {
00047 if(!SAutoLoad::isModuleUsed('tsd'))
00048 return array();
00049
00050 $cm = $this->version->getContentModule();
00051
00052 $url = 'http://www.shodor.org/interactivate/activities/' . $this->version->getResource()->getCanonicalParent()->getCanonicalShortName() . '/';
00053 SErrorManager::redirectPush('error', 'devnull');
00054 $id = SDR::getResourceIdForURL($url);
00055 SErrorManager::redirectPop('error');
00056 $params = array();
00057 if($id) {
00058 $standards = TSDStandard::getResourceAlignments($id);
00059 $resultStd = array();
00060 foreach($standards as $std) {
00061 $resultStd[$std->organization_name][$std->grade_name][$std->category_name][$std->objective_description][]
00062 = $std->objective_description;
00063 }
00064 $textbooks = TSDText::getResourceAlignments($id);
00065 $resultTxt = array();
00066 foreach($textbooks as $txt) {
00067 $resultTxt[$txt->book_title]['bookID'][] = $txt->book_id;
00068 $resultTxt[$txt->book_title]['chapter'][] = $txt->chapter_name;
00069 $resultTxt[$txt->book_title]['chapterID'][] = $txt->chapter_id;
00070 $resultTxt[$txt->book_title]['section'][] = $txt->section_name;
00071 $resultTxt[$txt->book_title]['sectionID'][] = $txt->section_id;
00072 $resultTxt[$txt->book_title]['grade'][] = $txt->book_gradeOrCourse;
00073 $resultTxt[$txt->book_title]['textReason'][] = $txt->reason;
00074 }
00075 $params['standards'] = $resultStd;
00076 $params['textbooks'] = $resultTxt;
00077 }
00078
00079 return $params;
00080 }
00081 }
00082
00083 ?>