Example #1
0
					break;

				default :
					mapleta_ws_disconnect($connect->session, $connect);
					print_error('wrong_data_format','mapleta', $errorURL);
			}

			mapleta_ws_disconnect($connect->session, $connect);

			if($status->code == 1) {
				print_error($status->message, 'mapleta', $errorURL);
			} else {
				$db_object= new mapleta_course_map();
				$db_object->courseid= $course->id;
				$db_object->classid= $new_class[0]->id;
				$db_object->classname= mapleta_urlencode($new_class[0]->name);
				
//				var_dump($db_object);
				
				if(!mapleta_insert_record('mapleta_course_map', $db_object)) {
					print_error('error_storing_mapping','mapleta', $errorURL);
				} else {
					echo "<br/><center><strong>Course $course->fullname has been successfully mapped to Maple TA class '".$new_class[0]->name."'.</strong></center><br/>";
				}
			}
		}
	} else { // Not admin or teacher
		print_error('not_authorized_for_action', 'mapleta', $errorURL);
	}
} else
	if($action == 'delete') { // Course already mapped
Example #2
0
    print ("<td align='left' class='cell c0'><strong>Availability</strong></td><td align='center' class='cell c0'>Unlimited</td>");
    print ("</tr>");
}
if ($mapleta->starttime > 0) {
    print ("<tr>");
    print ("<td align='left' class='cell c0'><strong>Available After</strong></td><td align='center' class='cell c0'>" . date("d/m/y h:i A", $mapleta->starttime / 1000) . "</td>");
    print ("</tr>");
}
if ($mapleta->endtime > 0) {
    print ("<tr>");
    print ("<td align='left' class='cell c0'><strong>Available Before</strong></td><td align='center' class='cell c0'>" . date("d/m/y h:i A", $mapleta->endtime / 1000) . "</td>");
    print ("</tr>");
}
if ($mapleta->policy != "") {
    print ("<tr>");
    print ("<td align='left' class='cell c0'><strong>Restrictions</strong></td><td align='center' class='cell c0'><a href=\"javascript:{alert('" . "A student may only take this test if he/she:\\n\\n" . mapleta_urlencode($mapleta->policy) . "')}\">Click here to see the restrictions</a></td>");
    print ("</tr>");
}
print ("</table></div>");

print ("<div style='text-align: center'>");
print ("<table cellpadding='2' class='mapleta-config' width='100%'>");
print ("<tr>");
print ("<td colspan='2' align='center'>&nbsp;</td>");
print ("</tr>");
print ("<tr>");
print ("<td colspan='2' align='center'>$button</td>");
print ("</tr>");
print ("</table></div>");

echo $OUTPUT->footer();