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

Diff of /trunk/webwork/system/cgi/cgi-scripts/processProblem8.pl

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

Revision 2 Revision 6
1#!/usr/bin/perl 1#!/usr/local/bin/perl
2 2
3# This file is processProblem8.pl 3# This file is processProblem8.pl
4# This is a special version of processProblem.pl 4# This is a special version of processProblem.pl
5# made to be used as an editor 5# made to be used as an editor
6 6
24# 'Submit Answers' or 'Preview Answers' or 'Preview Again' 24# 'Submit Answers' or 'Preview Answers' or 'Preview Again'
25# 'probFileName' 25# 'probFileName'
26# 'languageType' 26# 'languageType'
27 27
28use strict; 28use strict;
29use lib '/ww/webwork/development/'; # mainWeBWorKDirectory; 29use lib '/ww/webwork/gage_system/webwork/system/lib/'; # mainWeBWorKDirectory
30 30
31use CGI qw(:standard); 31use CGI qw(:standard);
32use Net::SMTP; 32use Net::SMTP;
33use Global; 33use Global;
34use Auth; 34use Auth;
134 134
135 135
136 136
137 require "${courseScriptsDirectory}$Global::displayMacros_pl"; 137 require "${courseScriptsDirectory}$Global::displayMacros_pl";
138 require "${scriptDirectory}$Global::DBglue_pl"; 138 require "${scriptDirectory}$Global::DBglue_pl";
139 require "${scriptDirectory}$Global::classlist_DBglue_pl";
139 require "${scriptDirectory}$Global::HTMLglue_pl"; 140 require "${scriptDirectory}$Global::HTMLglue_pl";
140 require "${scriptDirectory}$Global::FILE_pl"; 141 require "${scriptDirectory}$Global::FILE_pl";
141 142
142 my $permissionsFile = &Global::getCoursePermissionsFile($Course); 143 my $permissionsFile = &Global::getCoursePermissionsFile($Course);
143 my $permissions = &get_permissions($User,$permissionsFile); 144 my $permissions = &get_permissions($User,$permissionsFile);
491 else {#this is the default set by the translator and used if no flag is set. 492 else {#this is the default set by the translator and used if no flag is set.
492 #$pt->rf_problem_grader($pt->rf_std_problem_grader); } 493 #$pt->rf_problem_grader($pt->rf_std_problem_grader); }
493 } 494 }
494 495
495# creates and stores a hash of answer results: $rh_answer_results 496# creates and stores a hash of answer results: $rh_answer_results
497 if ($answers_submitted == 1) {
496 $pt -> process_answers(\%inputs); 498 $pt -> process_answers(\%inputs);
497 499 }
498 #################################################################### 500 ####################################################################
499 # If preview mode has been selected, build the preview page and exit 501 # If preview mode has been selected, build the preview page and exit
500 #################################################################### 502 ####################################################################
501 503
502 if (($preview_mode ==1) and ($answers_submitted ==1)) { 504 if (($preview_mode ==1) and ($answers_submitted ==1)) {
1415} 1417}
1416 1418
1417sub defineProblemEnvir { 1419sub defineProblemEnvir {
1418 my ($mode,$probNum,$psvn,$courseName) = @_; 1420 my ($mode,$probNum,$psvn,$courseName) = @_;
1419 my %envir=(); 1421 my %envir=();
1422 my $loginName = &getStudentLogin($psvn);
1420 ##how to put an array submittedAnswers in a hash?? 1423 ##how to put an array submittedAnswers in a hash??
1421# $envir{'refSubmittedAnswers'} = $refSubmittedAnswers if defined($refSubmittedAnswers); 1424# $envir{'refSubmittedAnswers'} = $refSubmittedAnswers if defined($refSubmittedAnswers);
1422 $envir{'psvnNumber'} = $psvn; 1425 $envir{'psvnNumber'} = $psvn;
1423 $envir{'psvn'} = $psvn; 1426 $envir{'psvn'} = $psvn;
1424 $envir{'studentName'} = &getStudentName($psvn); 1427 $envir{'studentName'} = &CL_getStudentName($loginName);
1425 $envir{'studentLogin'} = &getStudentLogin($psvn); 1428 $envir{'studentLogin'} = &getStudentLogin($psvn);
1426 $envir{'sectionName'} = &getClassSection($psvn); 1429 $envir{'sectionName'} = &CL_getClassSection($loginName);
1427 $envir{'sectionNumber'} = &getClassSection($psvn); 1430 $envir{'sectionNumber'} = &CL_getClassSection($loginName);
1428 $envir{'recitationName'} = &getClassRecitation($psvn); 1431 $envir{'recitationName'} = &CL_getClassRecitation($loginName);
1429 $envir{'recitationNumber'} = &getClassRecitation($psvn); 1432 $envir{'recitationNumber'} = &CL_getClassRecitation($loginName);
1430 $envir{'setNumber'} = &getSetNumber($psvn); 1433 $envir{'setNumber'} = &getSetNumber($psvn);
1431 $envir{'questionNumber'} = $probNum; 1434 $envir{'questionNumber'} = $probNum;
1432 $envir{'probNum'} = $probNum; 1435 $envir{'probNum'} = $probNum;
1433 $envir{'openDate'} = &getOpenDate($psvn); 1436 $envir{'openDate'} = &getOpenDate($psvn);
1434 $envir{'formattedOpenDate'} = &formatDateAndTime(&getOpenDate($psvn)); 1437 $envir{'formattedOpenDate'} = &formatDateAndTime(&getOpenDate($psvn));

Legend:
Removed from v.2  
changed lines
  Added in v.6

aubreyja at gmail dot com
ViewVC Help
Powered by ViewVC 1.0.9