- ';
+ '.
+ &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.= ' ;
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";
@@ -517,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') &&
@@ -969,15 +1022,17 @@ sub start_part {
$result.='\noindent \end{minipage}\vskip 0 mm \noindent \begin{minipage}{\textwidth}\noindent';
}
my $weight = &Apache::lonnet::EXT("resource.$id.weight");
- my $allkeys=&Apache::lonnet::metadata($ENV{'request.uri'},'keys');
+ my $allkeys=&Apache::lonnet::metadata($ENV{'request.uri'},'packages');
my @allkeys = split /,/,$allkeys;
my $allow_print_points = 0;
foreach my $partial_key (@allkeys) {
- if ($partial_key=~m/\_(\d*)\_weight/) {
+ if ($partial_key=~m/^part_(.*)$/) {
if ($1 ne '0') {$allow_print_points=1;}
}
}
if (($Apache::lonhomework::type eq 'exam') && ($allow_print_points)) { $result .= '\fbox{\textit{'.$weight.' pt}}';}
+ } elsif ($target eq 'web') {
+ $result.=' ';
}
}
}
@@ -1009,7 +1064,9 @@ sub end_part {
my $result='';
if ( $target eq 'meta' ) {
$result='';
- } elsif ( $target eq 'grade' && $status eq 'CAN_ANSWER' && !$hidden) {
+ } elsif ($target eq 'grade' &&
+ ($status eq 'CAN_ANSWER' || $Apache::lonhomework::scantronmode) &&
+ !$hidden) {
$result=&Apache::inputtags::grade;
} elsif (($target eq 'web' || $target eq 'tex') && !$hidden ) {
my $gradestatus=&Apache::inputtags::gradestatus($Apache::inputtags::part,
@@ -1029,9 +1086,10 @@ sub end_part {
sub start_preduedate {
my ($target,$token,$tagstack,$parstack,$parser,$safeeval)=@_;
if ($target eq 'web' || $target eq 'grade' || $target eq 'answer' || $target eq 'tex') {
+ &Apache::lonxml::debug("State in preduedate is ". $Apache::inputtags::status['-1']);
if ($Apache::inputtags::status['-1'] ne 'CAN_ANSWER' &&
- $Apache::inputtags::status['-1'] ne 'CANNOT_ANSWER' &&
- $Apache::inputtags::status['-1'] ne 'SHOW_ANSWER') {
+ $Apache::inputtags::status['-1'] ne 'CANNOT_ANSWER') {
+ &Apache::lonxml::debug("Wha? ". ($Apache::inputtags::status['-1'] ne 'SHOW_ANSWER'));
&Apache::lonxml::get_all_text("/preduedate",$parser);
}
}
@@ -1044,12 +1102,12 @@ sub end_preduedate {
sub start_postanswerdate {
my ($target,$token,$tagstack,$parstack,$parser,$safeeval)=@_;
- if ($target eq 'web' || $target eq 'grade' || $target eq 'tex') {
+ if ($target eq 'web' || $target eq 'grade') {
if ($Apache::inputtags::status['-1'] ne 'SHOW_ANSWER') {
&Apache::lonxml::get_all_text("/postanswerdate",$parser);
}
} elsif ($target eq 'tex') {
- return '\vskip 0 mm \noindent';
+ &Apache::lonxml::get_all_text("/postanswerdate",$parser);
}
return '';
}