[system] / trunk / webwork / system / cgi / cgi-scripts / profProbSet.pl Repository:
ViewVC logotype

Annotation of /trunk/webwork/system/cgi/cgi-scripts/profProbSet.pl

Parent Directory Parent Directory | Revision Log Revision Log


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

1 : sam 2 #!/usr/bin/perl
2 :    
3 :     use lib '/ww/webwork/development/'; # mainWeBWorKDirectory;
4 :    
5 :     use CGI_Lite;
6 :     use Global;
7 :     use Auth;
8 :    
9 :     local($cgi) = new CGI_Lite() unless $ARGV[0];
10 :     local(%inputs) = $cgi->parse_form_data()unless $ARGV[0];
11 :    
12 :     &Global::getCourseEnvironment($inputs{'course'});
13 :     $scriptDirectory = $Global::scriptDirectory;
14 :     $databaseDirectory = $Global::databaseDirectory;
15 :     $templateDirectory = $Global::templateDirectory;
16 :    
17 :     require "${scriptDirectory}$Global::DBglue_pl";
18 :     require "${scriptDirectory}$Global::FILE_pl";
19 :     require "${scriptDirectory}$Global::HTMLglue_pl";
20 :    
21 :     my $keyFile = &Global::getCourseKeyFile($inputs{'course'});
22 :     &verify_key($inputs{'user'}, $inputs{'key'}, "$keyFile", $inputs{'course'});
23 :     my $permissionsFile = &Global::getCoursePermissionsFile($inputs{'course'});
24 :     my $permissions = &get_permissions($inputs{'user'}, $permissionsFile);
25 :     if ($permissions != $Global::instructor_permissions ) {
26 :     print "permissions = $permissions instructor_permissions = $instructor_permissions\n";
27 :     print &html_NO_PERMISSION;
28 :    
29 :     exit(0);
30 :     }
31 :     ####################################Page 1####################################
32 :     unless ($inputs{'pPS'}) {
33 :     print &htmlTOP("Test a Problem Set");
34 :     print "<HR><h3 align=\"center\">Welcome to the Test a Problem Set Page</h3>";
35 :    
36 :     print "<form action=\"${cgiURL}profProbSet.pl\">\n";
37 :    
38 :     print "Enter as student: <input type=\"text\" name=\"login\" VALUE=\"\" SIZE=11 MAXLENGTH=11> (use login name)<BR>\n";
39 :     print "<input type=\"hidden\" name=\"pPS\" value=1>\n";
40 :     print &sessionKeyInputs;
41 :     print "<br><input type=\"submit\" value=\"Continue\"></form>";
42 :     }
43 :     ###############################PAGE 2####################################
44 :     elsif ($inputs{'pPS'}==1) {
45 :     print &htmlTOP("Test a Problem Set: Page 2");
46 :    
47 :     @keys=&getAllProbSetKeysForStudentLogin($inputs{'login'});
48 :     print "@keys\n";
49 :    
50 :    
51 :     ############################################ START HERE
52 :     foreach $key (@keys) {
53 :     $setNumber=&getSetNumber($key);
54 :     }
55 :     ############################################
56 :     }

aubreyja at gmail dot com
ViewVC Help
Powered by ViewVC 1.0.9