[system] / trunk / wwmoodle / wwassignment4 / moodle / mod / wwassignment / locallib.php Repository:
ViewVC logotype

Diff of /trunk/wwmoodle/wwassignment4/moodle/mod/wwassignment/locallib.php

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 5882 Revision 5883
183* @param integer $courseid Moodle Course ID. 183* @param integer $courseid Moodle Course ID.
184* @param integer $silent whether to trigger an error message. 184* @param integer $silent whether to trigger an error message.
185* @return string the name of the webwork course on success and -1 on failure. 185* @return string the name of the webwork course on success and -1 on failure.
186*/ 186*/
187function _wwassignment_mapped_course($courseid,$silent = true) { 187function _wwassignment_mapped_course($courseid,$silent = true) {
188 $wwlink = get_record('block','name','wwlink');
189 //error_log("wwlink".print_r($wwlink,true));
190 $blockinstance = get_record('block_instance','blockid', $wwlink->id,'pageid',$courseid,'pagetype','course-view');
191 //error_log("block instance".print_r($blockinstance,true));
192 $block_config = unserialize(base64_decode($blockinstance->configdata));
193 //error_log("config_data ".print_r($block_config,true));
194 if ( isset($block_config) && isset($block_config->webwork_link_id) ) {
195 return $block_config->webwork_link_id;
196 }
188 $wwassignmentbridge = get_record('wwassignment_bridge','course', $courseid); 197// $wwassignmentbridge = get_record('wwassignment_bridge','course', $courseid);
189 if((isset($wwassignmentbridge)) && (isset($wwassignmentbridge->webwork_course))) { 198// if((isset($wwassignmentbridge)) && (isset($wwassignmentbridge->webwork_course))) {
190 return $wwassignmentbridge->webwork_course; 199// return $wwassignmentbridge->webwork_course;
191 } 200// }
192 if(!$silent) { 201// if(!$silent) {
193 print_error('webwork_course_map_failure','wwassignment'); 202// print_error('webwork_course_map_failure','wwassignment');
194 } 203// }
195 return -1; 204 return -1;
196} 205}
197 206
198/** 207/**
199* @desc Finds the webwork set name from a wwassignment id. 208* @desc Finds the webwork set name from a wwassignment id.

Legend:
Removed from v.5882  
changed lines
  Added in v.5883

aubreyja at gmail dot com
ViewVC Help
Powered by ViewVC 1.0.9