Parent Directory
|
Revision Log
Adding more files for wwassignment
1 <!-- This page defines the form to create or edit an instance of this module --> 2 <!-- It is used from /course/mod.php. The whole instance is available as $form. --> 3 4 <?php 5 6 // $Id$ 7 /// First we check that form variables have been initialised 8 if (!isset($form->name)) { 9 $form->name = ''; 10 } 11 if( !isset($form->intro) ) { 12 $form->intro = 'Introduction?? where is this used? defined in mod.html'; 13 } 14 if( !isset($form->set_id) ) { 15 $form->set_id = -1; 16 } 17 if( ! isset($form->gradingmethod) ) { 18 $form->gradingmethod = 0; 19 } 20 //if( ! isset($form->course) ) { 21 // $form->course = $course->id; 22 //} 23 // this is really hacky, but I need the contents of the lib.php for wwassignment: 24 require_once("../mod/wwassignment/lib.php"); 25 //require_once ("$CFG->dirroot/mod/wwassignmentlib.php"); 26 define('WWMOODLE_SET_WEBWORK_URL', $CFG->wwassignment_webwork_url); 27 28 require_login($course->id); 29 30 add_to_log($course->id, "wwassignment", "view all", "index.php?id=$course->id", ""); 31 $wwCourseName = wwmoodle_courseIdToShortName($course->id); 32 33 34 /// Get all required strings 35 36 $strwwassignments = get_string("modulenameplural", "wwassignment"); 37 $strwwassignment = get_string("modulename", "wwassignment"); 38 39 ?> 40 <?php 41 // ensure that there is a bridge for this course: 42 error_log("form "); 43 error_log(print_r($form,true)); 44 $oCourse = get_record("course", "id", $form->course); 45 error_log(print_r($oCourse, true)); 46 $aMods = get_all_instances_in_course("wwmoodle", $oCourse); 47 error_log("aMods"); 48 error_log(count($aMods)); 49 error_log(print_r($aMods, true)); 50 ?> 51 52 53 <form name="form" method="post" action="mod.php"> 54 <center> 55 <table cellpadding="5"> 56 <tr><td> 57 <?php 58 if (count($aMods) == 0) { 59 60 print "This course will be connected to $wwCourseName"; 61 if (isadmin()) { 62 print("<p style='font-size: smaller; color: #aaa; text-align: center;'> 63 <a style='color: black;text-decoration:underline' href='".WWMOODLE_WEBWORK_URL."/admin'>"."Link to create WeBWorK course"."</a></p>"); 64 65 } 66 67 } else { 68 print "This course is already prepared to connect to the webwork course $wwCourseName. "; 69 if (isadmin()) { 70 print("<p style='font-size: smaller; color: #aaa; text-align: center;'> 71 <a style='color: black;text-decoration:underline' href='".WWMOODLE_WEBWORK_URL."/admin'>"."Link to create WeBWorK course"."</a></p>"); 72 73 } 74 75 76 77 } 78 ?> 79 </td></tr> 80 <tr valign="top"> 81 <td align="right"><label for='name'><b><?php print_string("name") ?>:</b></label></td> 82 <td> 83 <input type="text" id='name' name="name" size="30" value="<?php p($form->name) ?>"> 84 </td> 85 </tr> 86 <!-- More rows go in here... --> 87 88 <tr valign='top'> 89 <td align='right'><label for='set_id'><b><?php print_string("set_id", "wwassignment"); ?>:</b></label><br /> 90 <?php helpbutton("set_id", get_string("helpSet_id", "wwassignment"), "wwassignment", true, true); ?> 91 </td> 92 <td align='left'><?php wwassignment_printSetSelect($form->course, $form->set_id); ?></td> 93 </tr> 94 <tr valign="top"> 95 <td align="right"><b><?php print_string("description", "assignment") ?>:</b> 96 <br /><br /> 97 <?php 98 helpbutton("writing", get_string("helpwriting"), "moodle", true, true); 99 echo "<br />"; 100 helpbutton("questions", get_string("helpquestions"), "moodle", true, true); 101 echo "<br />"; 102 if ($usehtmleditor) { 103 helpbutton("richtext", get_string("helprichtext"), "moodle", true, true); 104 } else { 105 emoticonhelpbutton("form", "description"); 106 } 107 ?> 108 </td> 109 <td> 110 <?php 111 print_textarea($usehtmleditor, 20, 60, 680, 400, "description", $form->description); 112 113 if ($usehtmleditor) { 114 echo '<input type="hidden" name="format" value="'.FORMAT_HTML.'" />'; 115 } else { 116 echo '<div align="right">'; 117 helpbutton("textformat", get_string("formattexttype")); 118 print_string("formattexttype"); 119 echo ': '; 120 if (!$form->format) { 121 $form->format = $defaultformat; 122 } 123 choose_from_menu(format_text_menu(), "format", $form->format, ""); 124 echo '</div>'; 125 } 126 ?> 127 </td> 128 </tr> 129 <tr valign='top'> 130 <td align='right'><label for='gradeMethod'><b><?php print_string("gradeMethod", "wwassignment"); ?>:</b></label><br /> 131 <?php helpbutton("gradeMethod", get_string("helpGradeMethod", "wwassignment"), "wwassignment", true, true); ?> 132 </td> 133 <td align='left'><?php wwassignment_printGradeMethodSelect($form->gradingmethod); ?></td> 134 </tr> 135 <!-- The following line for Moodle 1.5 prints the visibility setting form element --> 136 <?php print_visible_setting($form,$oCourse); // the version without $oCourse doesn't work, error in course/lib.php perhaps MEG?> 137 138 </table> 139 <!-- These hidden variables are always the same --> 140 <input type="hidden" name='formaction' value="create_assignment" /> 141 <input type="hidden" name='course' value="<?php p($form->course) ?>" /> 142 <input type="hidden" name="sesskey" value="<?php p($form->sesskey) ?>" /> 143 <input type="hidden" name='coursemodule' value="<?php p($form->coursemodule) ?>" /> 144 <input type="hidden" name='section' value="<?php p($form->section) ?>" /> 145 <input type="hidden" name='module' value="<?php p($form->module) ?>" /> 146 <input type="hidden" name='modulename' value="<?php p($form->modulename) ?>" /> 147 <input type="hidden" name='instance' value="<?php p($form->instance) ?>" /> 148 <input type="hidden" name='mode' value="<?php p($form->mode) ?>" /> 149 <input type="submit" value="<?php print_string("savechanges") ?>" /> 150 </center> 151 152 </form> 153 <?php 154 if( isteacher($course->id) ) { 155 print("<p style='font-size: smaller; color: #aaa; text-align: center;'> 156 <a style='color: #666;text-decoration:underline' href='".WWMOODLE_SET_WEBWORK_URL."/$course->shortname/instructor' target='_webwork_edit'>" 157 .get_string("goToWeBWorK", "wwmoodle")."</a></p>"); 158 } 159 ?>
| aubreyja at gmail dot com | ViewVC Help |
| Powered by ViewVC 1.0.9 |