- ';
+ '.
+ &Apache::loncommon::help_open_topic('Problem_Editor_XML_Index',
+ 'Problem Editing Help').' '.
+ &Apache::loncommon::help_open_faq(5).
+ &Apache::loncommon::help_open_bug('Authoring').'
'.
+ '';
}
sub problem_edit_footer {
@@ -195,6 +200,16 @@ sub problem_edit_footer {
';
}
+sub option {
+ my ($value,$name) = @_;
+ my $result ="';
+ return $result;
+}
+
sub problem_web_to_edit_header {
my ($rndseed)=@_;
my $result.='
@@ -208,8 +223,40 @@ sub problem_web_to_edit_header {
onChange="javascript:document.lonhomework.changerandseed.click()" />
'.&mt(' Show All Foils').'
- ';
+ $result.= ' />'.&mt(' Show All Foils').
+ &Apache::loncommon::help_open_topic('Problem_Editor_Testing_Area','Testing Problems').
+ ' ';
+ $result.="
+
+Problem Status:
+
+
+ ".&option('CLOSED' ,'problemstate').&mt("Closed")."
+ ".&option('CAN_ANSWER' ,'problemstate').&mt("Answerable")."
+ ".&option('CANNOT_ANSWER_tries' ,'problemstate').&mt("Open with full tries")."
+ ".&option('CANNOT_ANSWER_correct','problemstate').&mt("Open and correct")."
+ ".&option('SHOW_ANSWER' ,'problemstate').&mt("Show Answer")."
+
+
+
+Problem Type:
+
+
+ ".&option('exam' ,'problemtype')."Exam Problem
+ ".&option('problem','problemtype')."Homework problem
+ ".&option('survey' ,'problemtype')."Survey Question
+
+
+
+Feedback Mode:
+
+
+ ".&option('yes','problemstatus')."Show Feedback
+ ".&option('no', 'problemstatus')."Don\'t Show Feedback
+
+
+
+ ";
my $numtoanalyze=$ENV{'form.numtoanalyze'};
if (!$numtoanalyze) { $numtoanalyze=20; }
$result.= ' $name
+ $result.="$head_tag_start$name
$body_tag_start \n $form_tag_start".
- ' ';
- if ($ENV{'request.state'} eq "construct") {
- $result.= &problem_web_to_edit_header($ENV{'form.rndseed'});
- }
- # if we are viewing someone else preserve that info
- if (defined $ENV{'form.grade_symb'}) {
- foreach my $field ('symb','courseid','domain','username') {
- $result .= ' '."\n";
- }
+ ' ';
+ # create a page header and exit
+ if ($ENV{'request.state'} eq "construct") {
+ $result.= &problem_web_to_edit_header($ENV{'form.rndseed'});
+ }
+ # if we are viewing someone else preserve that info
+ if (defined $ENV{'form.grade_symb'}) {
+ foreach my $field ('symb','courseid','domain','username') {
+ $result .= ' '."\n";
}
- } elsif ($status eq 'SHOW_ANSWER' || $status eq 'CANNOT_ANSWER'
- || $status eq 'CLOSED' || $status eq 'UNAVALAILABLE' ||
- $status eq 'INVALID_ACCESS') {
- $result.=$head_tag_start.
- "$name \n$body_tag_start\n";
}
} elsif ($target eq 'tex') {
my $startminipage = '';
@@ -457,12 +503,12 @@ sub start_problem {
}
my $id = $Apache::inputtags::part;
my $weight = &Apache::lonnet::EXT("resource.$id.weight");
- my $allkeys=&Apache::lonnet::metadata($ENV{'request.uri'},'keys');
- my @allkeys = split /,/,$allkeys;
- my $allow_print_points = 1;
- foreach my $partial_key (@allkeys) {
- if ($partial_key=~m/\_(\d*)\_weight/) {
- if ($1 ne '0') {$allow_print_points=0;}
+ my $packages=&Apache::lonnet::metadata($ENV{'request.uri'},'packages');
+ my @packages = split /,/,$packages;
+ my $allow_print_points = 0;
+ foreach my $partial_key (@packages) {
+ if ($partial_key=~m/^part_0$/) {
+ $allow_print_points=1;
}
}
my $duedate = &Apache::lonnet::EXT("resource.$id.duedate");
@@ -477,7 +523,7 @@ sub start_problem {
my @due_file_content = <$temp_file>;
my $due_file_content = $due_file_content[$#due_file_content];
chomp $due_file_content;
- my $name_of_resourse= &get_resource_name($parstack,$safeeval);
+ my $name_of_resourse= &Apache::lonxml::latex_special_symbols(&get_resource_name($parstack,$safeeval));
if ($due_file_content ne $duedate) {
$temp_file = Apache::File->new('>'.$filename);
print $temp_file "$duedate\n";
@@ -503,6 +549,8 @@ sub start_problem {
} elsif ($target eq 'edit') {
$result.=$head_tag_start."".$body_tag_start.$form_tag_start.
&problem_edit_header();
+ $Apache::lonxml::warnings_error_header=
+ &mt("Editor Errors - these errors might not effect the running of the problem, but they will likely cause problems with further use of the Edit mode. Please use the EditXML mode to fix these errors.")." ";
my $temp=&Apache::edit::insertlist($target,$token);
$result.=$temp;
} elsif ($target eq 'modified') {
@@ -522,7 +570,7 @@ sub end_problem {
if ($target eq 'grade' || $target eq 'web' || $target eq 'answer' ||
$target eq 'tex') {
if ( $target eq 'grade' && $Apache::inputtags::part eq '0' &&
- $status eq 'CAN_ANSWER' ) {
+ ($status eq 'CAN_ANSWER' || $Apache::lonhomework::scantronmode)) {
# if part is zero, no s existed, so we need to the grading
&Apache::inputtags::grade;
} elsif ( ($target eq 'web' || $target eq 'tex') &&
@@ -537,17 +585,9 @@ sub end_problem {
(($target eq 'web') && ($ENV{'request.state'} ne 'construct')) ||
($target eq 'answer') || ($target eq 'tex')
) {
- if ($status eq 'CAN_ANSWER') {
- if ($target ne 'tex' &&
- $ENV{'form.answer_output_mode'} ne 'tex') {
- $result.="