[system] / branches / dg2_dev / webwork2 / lib / WeBWorK / ContentGenerator / Instructor / SetMaker2.pm Repository:
ViewVC logotype

Annotation of /branches/dg2_dev/webwork2/lib/WeBWorK/ContentGenerator/Instructor/SetMaker2.pm

Parent Directory Parent Directory | Revision Log Revision Log


Revision 7094 - (view) (download) (as text)

1 : david gage 6487 ################################################################################
2 :     # WeBWorK Online Homework Delivery System
3 : david gage 6732 # Copyright � 2000-2007 The WeBWorK Project, http://openwebwork.sf.net/
4 : david gage 6487 # $CVSHeader: webwork2/lib/WeBWorK/ContentGenerator/Instructor/SetMaker.pm,v 1.85 2008/07/01 13:18:52 glarose Exp $
5 :     #
6 :     # This program is free software; you can redistribute it and/or modify it under
7 :     # the terms of either: (a) the GNU General Public License as published by the
8 :     # Free Software Foundation; either version 2, or (at your option) any later
9 :     # version, or (b) the "Artistic License" which comes with this package.
10 :     #
11 :     # This program is distributed in the hope that it will be useful, but WITHOUT
12 :     # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
13 :     # FOR A PARTICULAR PURPOSE. See either the GNU General Public License or the
14 :     # Artistic License for more details.
15 :     ################################################################################
16 :    
17 :    
18 :     package WeBWorK::ContentGenerator::Instructor::SetMaker2;
19 :     use base qw(WeBWorK::ContentGenerator::Instructor);
20 :    
21 :     =head1 NAME
22 :    
23 :     WeBWorK::ContentGenerator::Instructor::SetMaker2 - Make homework sets.
24 :    
25 :     =cut
26 :    
27 :     use strict;
28 :     use warnings;
29 :    
30 :    
31 :     #use CGI qw(-nosticky);
32 :     use WeBWorK::CGI;
33 :     use WeBWorK::Debug;
34 :     use WeBWorK::Form;
35 :     use WeBWorK::Utils qw(readDirectory max sortByName);
36 :     use WeBWorK::Utils::Tasks qw(renderProblems);
37 :     use File::Find;
38 :    
39 :     require WeBWorK::Utils::ListingDB;
40 :    
41 :     use constant SHOW_HINTS_DEFAULT => 0;
42 :     use constant SHOW_SOLUTIONS_DEFAULT => 0;
43 :     use constant MAX_SHOW_DEFAULT => 20;
44 :     use constant NO_LOCAL_SET_STRING => 'No sets in this course yet';
45 :     use constant SELECT_SET_STRING => 'Select a Set from this Course';
46 :     use constant SELECT_LOCAL_STRING => 'Select a Problem Collection';
47 :     use constant MY_PROBLEMS => ' My Problems ';
48 :     use constant MAIN_PROBLEMS => ' Unclassified Problems ';
49 :     use constant CREATE_SET_BUTTON => 'Create New Set';
50 :     use constant ALL_CHAPTERS => 'All Chapters';
51 :     use constant ALL_SUBJECTS => 'All Subjects';
52 :     use constant ALL_SECTIONS => 'All Sections';
53 :     use constant ALL_TEXTBOOKS => 'All Textbooks';
54 :    
55 :     use constant LIB2_DATA => {
56 :     'dbchapter' => {name => 'library_chapters', all => 'All Chapters'},
57 :     'dbsection' => {name => 'library_sections', all =>'All Sections' },
58 :     'dbsubject' => {name => 'library_subjects', all => 'All Subjects' },
59 :     'textbook' => {name => 'library_textbook', all => 'All Textbooks'},
60 :     'textchapter' => {name => 'library_textchapter', all => 'All Chapters'},
61 :     'textsection' => {name => 'library_textsection', all => 'All Sections'},
62 :     'keywords' => {name => 'library_keywords', all => '' },
63 :     };
64 :    
65 :    
66 :     ## for additional problib buttons
67 :     my %problib; ## filled in in global.conf
68 :     my %ignoredir = (
69 :     '.' => 1, '..' => 1, 'Library' => 1, 'CVS' => 1, 'tmpEdit' => 1,
70 :     'headers' => 1, 'macros' => 1, 'email' => 1, '.svn' => 1,
71 :     );
72 :    
73 : david gage 7083 # template method
74 :     sub templateName {
75 :     return "lbtwo";
76 :     }
77 :    
78 : david gage 6487 sub prepare_activity_entry {
79 :     my $self=shift;
80 :     my $r = $self->r;
81 :     my $user = $self->r->param('user') || 'NO_USER';
82 : david gage 6724 return("In SetMaker2 as user $user");
83 : david gage 6487 }
84 :    
85 :    
86 :    
87 :     sub title {
88 :     return "Library Browser v2";
89 :     }
90 :    
91 :     # hide view options panel since it distracts from SetMaker's built-in view options
92 :     sub options {
93 :     return "";
94 :     }
95 :    
96 :     sub head {
97 : david gage 7086 print '<script src="/webwork2_files/js/jquery-1.7.min.js"></script>';
98 :     print '<script src="/webwork2_files/js/jquery-ui-1.8.16.custom.min.js"></script>';
99 : david gage 7083 print '<script src="/webwork2_files/js/ui.tabs.closable.min.js"></script>';
100 :    
101 :     #print '<script src="/webwork2_files/js/dnd.js"></script>';
102 :     #print '<script src="/webwork2_files/js/problem_grid.js"></script>';
103 :     #print '<script src="/webwork2_files/js/form_builder.js"></script>';
104 :     print '<script src="/webwork2_files/js/library_browser.js"></script>';
105 :     print '<script src="/webwork2_files/js/modernizr-2.0.6.js"></script>';
106 : david gage 6691 #my ($self) = @_;
107 :     #my $r = $self->r;
108 :     #start a timer to save people's stuff idk if people want this
109 :     #print "<script> setInterval('saveChanges(\"mainform\", \"".$r->uri."\")', 680000); </script>";
110 : david gage 7083 #print '<link rel="stylesheet" type="text/css" href="/webwork2_files/css/setmaker2.css" />';
111 : david gage 7086 print '<link href="/webwork2_files/css/ui-lightness/jquery-ui-1.8.16.custom.css" rel="stylesheet" type="text/css"/>';
112 : david gage 7083 print '<link rel="stylesheet" type="text/css" href="/webwork2_files/css/library_browser.css" />';
113 :     #print '<script>window.addEventListener("load", setup, false);</script>';
114 : david gage 6487 return "";
115 :     }
116 :    
117 :     sub body {
118 :     my ($self) = @_;
119 :    
120 :     my $r = $self->r;
121 :    
122 : david gage 6680 ########## Loading Screen
123 :     print '<div id="loading"></div>';
124 : david gage 7094
125 : david gage 7083 #big wrapper div that will hopefully fix theme issues
126 :     print '<div id="app_box">';
127 : david gage 6487 ########## Top part
128 : david gage 7085 #print '<button onclick="fullWindowMode();">Full Screen</button>';
129 :     #print '<button id="gridifyButton" onclick="gridify();">Gridify!!</button>';
130 :     #print '<span>Hover Magnification: <button type="button" onclick="increaseMagnification();">+</button><span id="magnification">1</span><button type="button" onclick="decreaseMagnification();">-</button></span></span>';
131 :     #print '<button type="button" onclick="toggleHelp(this);" value="false">?</button>';
132 :     #print '<div id="help" style="display:none;position:absolute;z-index:1500;background:white;" class="shadowed">',
133 :     # '<h1>What can you do?</h1>',
134 :     # '<p>Drag a problem from the library to the target set to add.</p>',
135 :     # '<p>Drag a problem set off the target set to remove.</p>',
136 :     # '<p>If you have a local problem set in the library<br/>you can shift drag to move a problem from there to the target set.<br/>This will remove the problem from one set and add it to the other</p>',
137 :     # '<h1>Legend</h1>',
138 :     # '<p><div class="problem" style="width:16px;height:16px;border:solid 1px;"></div><span>Normal problem</span></p>',
139 :     # '<p><div class="used" style="width:16px;height:16px;border:solid 1px;"></div><span>Problem already in set</span></p>',
140 :     # '<p><div class="libProblem" style="width:16px;height:16px;border:solid 1px;"></div><span>Problem will be added to target on next update</span></p>',
141 :     # '<p><div class="removedProblem" style="width:16px;height:16px;border:solid 1px;"></div><span>Problem will be deleted from target on next update</span></p>',
142 :     # '<p><div class="ResultsWithError" style="width:16px;height:16px;border:solid 1px;"></div><span>Errors</span></p>',
143 :     #'</div>';
144 : david gage 6621 #'<p>In the target set you can drag problems to reorder them.<br/>The problem will be placed in front of the one you drop it on,<br/>or at the end of the list if you drop it on an empty space in the table.</p>',
145 : david gage 7085 print '<span>
146 : david gage 7083 <button type="button" id="delete_problem">Remove Selected</button>
147 : david gage 7086 <button type="button" id="undo_button">Undo</button>
148 :     <button type="button" id="redo_button">Redo</button>
149 : gage 6849 </span>';
150 : david gage 7083 print '<div class="break"></div>';
151 : david gage 7085 print '<b>Libraries:</b><div id="library_list_box"></div>';
152 : david gage 7083 ###########################################
153 : david gage 6726 # Library repository controls
154 : david gage 7083 ###########################################
155 : david gage 7085 #print '<span class="js_action_span" onclick="selectAll();">all</span>',
156 :     # '<span style="margin-left:10px;" class="js_action_span" onclick="selectNone();">none</span>';
157 : david gage 6726 ###########################################
158 : david gage 7083
159 :     print '<div id="problem_container">';
160 :     print '<div id="dialog">',
161 :     '<input type="text" id="dialog_text"></input>',
162 :     '<button type="button" id="create_set">Create Set</button>',
163 :     '</div>';
164 :     print '<div id="problem_sets_container">';
165 :     print '<h1>Target Sets</h1>';
166 :     print '<ul id="my_sets_list">';
167 :     print '<li id="new_problem_set">New Problem Set</li>';
168 :     print '</ul>';
169 :     print '</div>';
170 :     print '<div id="problems_container">';
171 :     #List of tabs
172 :     print '<ul>',
173 :     '<li id="library_link"><a href="#library_tab"><span>Library</span></a></li>',
174 :     '</ul>';
175 :     print '<div id="library_tab">';
176 :     print '<h1>Problems</h1>';
177 :     ########## Now print problems
178 :     print '<ul id="library_list">';
179 :    
180 :     print '</ul>';
181 : david gage 7085 #<button type="button" onclick="increaseLibAcross();">+</button><span id="libAcross">4</span><button type="button" onclick="decreaseLibAcross();">-</button><span> problems across</span>
182 :     print '<p><select id="prob_per_page"><option value=10>10</option><option value=20>20</option><option value=30>30</option><option value=40>40</option><option value=50>50</option></select><button type="button" id="prevList">Previous</button><button type="button" id="nextList">Next</button></p>';#might be a better way to do the perpage
183 : david gage 7083 print '</div>';
184 : david gage 6555 print '</div>';
185 : david gage 7083 ########## Finish things off
186 :     print '</div>';
187 : david gage 6492 print '<div style="clear:both;"></div>';
188 : david gage 6738 print '</div>';
189 : david gage 7094 print $self->hidden_authen_fields;
190 : david gage 6487 return "";
191 :     }
192 :    
193 :     =head1 AUTHOR
194 :    
195 :     Written by John Jones, jj (at) asu.edu.
196 :     Edited by David Gage
197 :    
198 :     =cut
199 :    
200 :     1;

aubreyja at gmail dot com
ViewVC Help
Powered by ViewVC 1.0.9