version 1.375, 2023/04/02 03:16:28
|
version 1.377, 2023/06/04 05:27:28
|
Line 371 sub check_slot_access {
|
Line 371 sub check_slot_access {
|
my $probstatus = &Apache::structuretags::get_problem_status($part); |
my $probstatus = &Apache::structuretags::get_problem_status($part); |
my $earlyout; |
my $earlyout; |
unless (($probstatus eq 'no') || |
unless (($probstatus eq 'no') || |
($probstatus eq 'no_feedback_ever')) { |
($probstatus eq 'no_feedback_ever')) { |
if ($Apache::lonhomework::history{"resource.$part.solved"} =~/^correct_/) { |
if ($Apache::lonhomework::history{"resource.$part.solved"} =~/^correct_/) { |
$numcorrect ++; |
$numcorrect ++; |
} else { |
} else { |
Line 380 sub check_slot_access {
|
Line 380 sub check_slot_access {
|
} |
} |
if ($currtries == $maxtries) { |
if ($currtries == $maxtries) { |
$earlyout = 1; |
$earlyout = 1; |
} else { |
} else { |
$numgraded ++; |
$numgraded ++; |
} |
} |
last if ($earlyout); |
last if ($earlyout); |
Line 1211 sub editxmlmode {
|
Line 1211 sub editxmlmode {
|
|
|
unless ($env{'environment.nocodemirror'}) { |
unless ($env{'environment.nocodemirror'}) { |
# dropdown menus |
# dropdown menus |
$result .= Apache::lonmenu::create_submenu("#", "", |
$result .= Apache::lonmenu::create_submenu("#", "", |
&mt("Problem Templates"), template_dropdown_datastructure()); |
&mt("Problem Templates"), template_dropdown_datastructure()); |
|
|
$result .= Apache::lonmenu::create_submenu("#", "", |
$result .= Apache::lonmenu::create_submenu("#", "", |
&mt("Response Types"), responseblock_dropdown_datastructure()); |
&mt("Response Types"), responseblock_dropdown_datastructure()); |
|
|
$result .= Apache::lonmenu::create_submenu("#", "", |
$result .= Apache::lonmenu::create_submenu("#", "", |
&mt("Conditional Blocks"), conditional_scripting_datastructure()); |
&mt("Conditional Blocks"), conditional_scripting_datastructure()); |
|
|
$result .= Apache::lonmenu::create_submenu("#", "", |
$result .= Apache::lonmenu::create_submenu("#", "", |
&mt("Miscellaneous"), misc_datastructure()); |
&mt("Miscellaneous"), misc_datastructure()); |
} |
} |
|
|
$result .= Apache::lonmenu::create_submenu("#", "", |
$result .= Apache::lonmenu::create_submenu("#", "", |
&mt("Help") . ' <img src="/adm/help/help.png" alt="' . &mt("Help") . |
&mt("Help") . ' <img src="/adm/help/help.png" alt="' . &mt("Help") . |
'" style="vertical-align:text-bottom; height: auto; margin:0; "/>', |
'" style="vertical-align:text-bottom; height: auto; margin:0; "/>', |
helpmenu_datastructure(),""); |
helpmenu_datastructure(),""); |
|
|
$result.="</ol></div>"; |
$result.="</ol></div>"; |
|
|
$result .= '</div></div>' . |
$result .= '</div></div>' . |
&Apache::lonxml::message_location() . |
&Apache::lonxml::message_location() . |
&Apache::loncommon::xmleditor_js() . |
&Apache::loncommon::xmleditor_js() . |
'<textarea ' . &Apache::edit::element_change_detection() . |
'<textarea ' . &Apache::edit::element_change_detection() . |
Line 1267 sub editxmlmode {
|
Line 1267 sub editxmlmode {
|
autoCloseBrackets: true, |
autoCloseBrackets: true, |
height: "auto", |
height: "auto", |
styleActiveLine: true, |
styleActiveLine: true, |
|
|
extraKeys: { |
extraKeys: { |
"Tab": "indentMore", |
"Tab": "indentMore", |
"Shift-Tab": "indentLess", |
"Shift-Tab": "indentLess", |
Line 1393 sub finished_parsing {
|
Line 1393 sub finished_parsing {
|
# value 3: name of help topic ??? |
# value 3: name of help topic ??? |
sub get_template_list{ |
sub get_template_list{ |
my ($extension) = @_; |
my ($extension) = @_; |
|
|
my @files = glob($Apache::lonnet::perlvar{'lonIncludes'}. |
my @files = glob($Apache::lonnet::perlvar{'lonIncludes'}. |
'/templates/*.'.$extension); |
'/templates/*.'.$extension); |
@files = map {[$_,&mt(&Apache::lonnet::metadata($_, 'title')), |
@files = map {[$_,&mt(&Apache::lonnet::metadata($_, 'title')), |
Line 1573 sub update_construct_style {
|
Line 1573 sub update_construct_style {
|
} |
} |
|
|
# |
# |
# Sets interval for current user so time left will be zero, either for the entire folder |
# Sets interval for current user so time left will be zero, either for the entire folder |
# containing the current resource, or just the resource, depending on value of first item |
# containing the current resource, or just the resource, depending on value of first item |
# in interval array retrieved from EXT("resource.0.interval"); |
# in interval array retrieved from EXT("resource.0.interval"); |
# |
# |
Line 1597 sub zero_timer {
|
Line 1597 sub zero_timer {
|
$key =~ s/\s+$//; |
$key =~ s/\s+$//; |
if ($env{'form.LC_interval_done_proctorpass'} ne $secret) { |
if ($env{'form.LC_interval_done_proctorpass'} ne $secret) { |
return ('fail', |
return ('fail', |
&mt('Incorrect key entered by proctor')); |
&mt('Incorrect key entered by proctor')); |
} |
} |
} |
} |
if ($first_access+$timelimit > $now) { |
if ($first_access+$timelimit > $now) { |
Line 1620 sub zero_timer {
|
Line 1620 sub zero_timer {
|
return ('ok'); |
return ('ok'); |
} else { |
} else { |
return ('fail',&mt('Error ending timed event: [_1]',$result)); |
return ('fail',&mt('Error ending timed event: [_1]',$result)); |
} |
} |
} else { |
} else { |
return ('fail',&mt('Timed event already ended')); |
return ('fail',&mt('Timed event already ended')); |
} |
} |
Line 1651 sub handler {
|
Line 1651 sub handler {
|
#check if we know where we are |
#check if we know where we are |
if ($env{'request.course.fn'} && !&Apache::lonnet::symbread('','',1,1)) { |
if ($env{'request.course.fn'} && !&Apache::lonnet::symbread('','',1,1)) { |
# if we are browsing we might not be able to know where we are |
# if we are browsing we might not be able to know where we are |
if ($Apache::lonhomework::browse ne 'F' && |
if ($Apache::lonhomework::browse ne 'F' && |
$env{'request.state'} ne "construct") { |
$env{'request.state'} ne "construct") { |
#should know where we are, so ask |
#should know where we are, so ask |
&unset_permissions(); |
&unset_permissions(); |
Line 1930 sub do_ltipassback {
|
Line 1930 sub do_ltipassback {
|
if (ref($item) eq 'HASH') { |
if (ref($item) eq 'HASH') { |
if ((ref($item->{'lti'}) eq 'HASH') && ($item->{'cid'} =~ /^($match_domain)_($match_courseid)$/)) { |
if ((ref($item->{'lti'}) eq 'HASH') && ($item->{'cid'} =~ /^($match_domain)_($match_courseid)$/)) { |
my ($cdom,$cnum) = ($1,$2); |
my ($cdom,$cnum) = ($1,$2); |
my $ckey = $item->{'lti'}->{'key'}; |
|
my $secret = $item->{'lti'}->{'secret'}; |
|
my $msgformat = $item->{'lti'}->{'passbackformat'}; |
my $msgformat = $item->{'lti'}->{'passbackformat'}; |
my $sigmethod = 'HMAC-SHA1'; |
my $sigmethod = 'HMAC-SHA1'; |
|
my $ltinum = $item->{'ltinum'}; |
my $id = $item->{'pbid'}; |
my $id = $item->{'pbid'}; |
my $url = $item->{'pburl'}; |
my $url = $item->{'pburl'}; |
|
my $type = $item->{'pbtype'}; |
my $scope = $item->{'scope'}; |
my $scope = $item->{'scope'}; |
my $map = $item->{'ltimap'}; |
my $map = $item->{'ltimap'}; |
my $symb = $item->{'ltisymb'}; |
my $symb = $item->{'ltisymb'}; |
my $uname = $item->{'uname'}; |
my $uname = $item->{'uname'}; |
my $udom = $item->{'udom'}; |
my $udom = $item->{'udom'}; |
|
my $keynum = $item->{'lti'}->{'cipher'}; |
|
my $crsdef = $item->{'crsdef'}; |
my $scoretype = $item->{'format'}; |
my $scoretype = $item->{'format'}; |
my ($total,$possible); |
my ($total,$possible); |
if ($scope eq 'resource') { |
if ($scope eq 'resource') { |
Line 1951 sub do_ltipassback {
|
Line 1953 sub do_ltipassback {
|
} elsif ($scope eq 'course') { |
} elsif ($scope eq 'course') { |
($total,$possible) = &get_lti_score($uname,$udom); |
($total,$possible) = &get_lti_score($uname,$udom); |
} |
} |
if (($ckey ne '') && ($secret ne '') && ($id ne '') && ($url ne '') && ($possible)) { |
if (($id ne '') && ($url ne '') && ($possible)) { |
&LONCAPA::ltiutils::send_grade($id,$url,$ckey,$secret,$scoretype,$sigmethod, |
&LONCAPA::ltiutils::send_grade($cdom,$cnum,$crsdef,$type,$ltinum,$keynum,$id,$url,$scoretype,$sigmethod,$msgformat,$total,$possible); |
$msgformat,$total,$possible); |
|
} |
} |
} |
} |
} |
} |