Index: openacs-4/packages/xowf/xowf.info =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowf/xowf.info,v diff -u -r1.12.2.82 -r1.12.2.83 --- openacs-4/packages/xowf/xowf.info 25 Mar 2022 19:28:16 -0000 1.12.2.82 +++ openacs-4/packages/xowf/xowf.info 4 Apr 2022 13:47:41 -0000 1.12.2.83 @@ -10,16 +10,16 @@ t xowf - + Gustaf Neumann XoWiki Content Flow - an XoWiki based workflow system implementing state-based behavior of wiki pages and forms 2021-09-15 WU Vienna BSD-Style 2 - - + + Index: openacs-4/packages/xowf/lib/inclass-exam.wf =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowf/lib/inclass-exam.wf,v diff -u -r1.1.2.93 -r1.1.2.94 --- openacs-4/packages/xowf/lib/inclass-exam.wf 20 Mar 2022 19:47:19 -0000 1.1.2.93 +++ openacs-4/packages/xowf/lib/inclass-exam.wf 4 Apr 2022 13:47:41 -0000 1.1.2.94 @@ -221,23 +221,16 @@ # - append text [subst { - - - - #xowf.exam_summary# - [:QM exam_configuration_popup $obj] - - - [:QM exam_info_block -combined_form_info $combined_form_info $obj] - - - - }] + append text \ + "" \ + [::xowiki::bootstrap::card \ + -title "#xowf.exam_summary# [:QM exam_configuration_popup $obj]" \ + -body [:QM exam_info_block -combined_form_info $combined_form_info $obj]] \ + "" set detail_link [$obj pretty_link -query m=question-summary] append text [subst { - #xowf.question_summary# + #xowf.question_summary# }] @@ -303,7 +296,7 @@ "created" { append extraAction "" \ "#xowf.online-exam-try_out# " \ - "#xowf.testrun#" + "#xowf.testrun#" } "published" { append extraAction "" \ @@ -346,11 +339,11 @@ #ns_log notice ALL=$text append text [subst { - + $answerStatus $qrCode $countdownHTML - + }] } @@ -488,7 +481,7 @@ set HTML "#xowf.online-exam-results-table#$HTML" } set return_url [[$wf package_id] query_parameter local_return_url:localurl [:pretty_link]] - append HTML "#xowiki.back#\n" + append HTML "#xowiki.back#\n" xo::Page requireCSS /resources/xowf/test-item.css :www-view $HTML @@ -522,7 +515,7 @@ set HTML "#xowf.Participants#$HTML" } set return_url [[$wf package_id] query_parameter local_return_url:localurl [:pretty_link]] - append HTML "#xowiki.back#\n" + append HTML "#xowiki.back#\n" :www-view $HTML @@ -597,7 +590,7 @@ if {!$as_student} { set return_url [:query_parameter local_return_url:localurl [:pretty_link]] - append HTML "#xowiki.back#\n" + append HTML "#xowiki.back#\n" } if {$do_stream} { @@ -785,7 +778,7 @@ set HTML "#xowiki.no_data#" } set return_url [:query_parameter local_return_url:localurl [:pretty_link]] - append HTML "#xowiki.back#\n" + append HTML "#xowiki.back#\n" :www-view $HTML } Index: openacs-4/packages/xowf/tcl/test-item-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowf/tcl/test-item-procs.tcl,v diff -u -r1.7.2.230 -r1.7.2.231 --- openacs-4/packages/xowf/tcl/test-item-procs.tcl 29 Mar 2022 14:58:01 -0000 1.7.2.230 +++ openacs-4/packages/xowf/tcl/test-item-procs.tcl 4 Apr 2022 13:47:41 -0000 1.7.2.231 @@ -2541,13 +2541,38 @@ }); }] + return [::xowiki::bootstrap::modal_dialog \ + -id grading-modal \ + -title "#xowf.Grading#: " \ + -subtitle "#xowf.question#: " \ + -body [ns_trim -delimiter | { + | + | + | #xowf.Points#: + | + | + | + | + | + | + | #xowf.feedback#: + | + | + | + | + | + }] \ + ] + return [ns_trim -delimiter | { | | | | - | + | | × | | #xowf.Grading#: @@ -3043,7 +3068,7 @@ return [ns_trim -delimiter | [subst { | - | print + |[::xowiki::bootstrap::icon -name print] print | |[template::collect_body_scripts] }]] @@ -3344,7 +3369,11 @@ set percentage "" if {$achieved eq ""} { :dom node replace $grading_box {span[@class='points']} { - ::html::span -class "glyphicon glyphicon-alert text-warn" -aria-hidden "true" {} + if {[::xowiki::CSS toolkit] eq "bootstrap5"} { + ::html::i -class "bi bi-exclamation-triangle-fill text-warning" -aria-hidden "true" {} + } else { + ::html::span -class "glyphicon glyphicon-alert text-warn" -aria-hidden "true" {} + } } } else { :dom node replace $grading_box {span[@class='points']} {::html::t $achieved} @@ -3682,6 +3711,7 @@ # # @return dict containing "do_stream" and "HTML" # + ns_log notice "RENDER ANSWERS 0" set combined_form_info [:QM combined_question_form $examWf] set autograde [dict get $combined_form_info autograde] set totalPoints [:QM total_points \ @@ -3754,6 +3784,7 @@ } } append HTML [:grading_dialog_setup $examWf] + ns_log notice "RENDER ANSWERS 1" if {$do_stream} { # ns_log notice STREAM-[info level]-$::template::parse_level @@ -3784,6 +3815,7 @@ } else { set recutil "" } + ns_log notice "RENDER ANSWERS 2" # # Create zip file from file submissions @@ -3808,6 +3840,7 @@ } else { set zipFile "" } + ns_log notice "RENDER ANSWERS 3 (submissions: [llength [$items children]])" set file_submission_exists 0 @@ -3840,6 +3873,8 @@ -with_signature $withSignature] set html [:dict_value $d HTML] + ns_log notice "RENDER ANSWERS setting result" + dict set results [$submission set creation_user] [:dict_value $d results] if {$do_stream && $html ne ""} { @@ -3859,6 +3894,7 @@ } } + ns_log notice "RENDER ANSWERS 4" if {$export} { $recutil destroy @@ -3903,10 +3939,11 @@ }]] append HTML [ns_trim -delimiter | [subst { | - | + |[::xowiki::bootstrap::icon -name download -CSSclass download-submissions] |#xowf.Download_file_submissions# }]] } + ns_log notice "RENDER ANSWERS 5" # # Store statistics only in autograding cases, and only, when it @@ -4510,15 +4547,10 @@ } set nrAnswered [llength $answered] - set answerStatus [subst { - - $heading - - $nrAnswered/$nrParticipants $submission_msg - - $extra_text - - }] + set answerStatus [::xowiki::bootstrap::card \ + -title $heading \ + -body [subst {$nrAnswered/$nrParticipants + $submission_msg$extra_text}]] if {$polling} { # @@ -4696,25 +4728,35 @@ # when the user does a full reload, then the user has to # activate the audio alarm again. # - # The state is symbolized using bootstrap 3 glyphicons. The - # code is tested primarily with chrome. + # The state is symbolized using bootstrap 3 glyphicons or + # bootstrap icons. The code is tested primarily with chrome. # template::add_body_script -script [subst { var audioContext = new AudioContext(); var audioContext_setSate = (function (targetState) { var container = document.getElementById('$id').parentNode; //console.log('--- state = ' + audioContext.state + ' want ' + targetState); if (targetState == 'active') { - var span = container.getElementsByTagName('span')\[0\]; - span.classList.remove('glyphicon-volume-off'); - span.classList.add('glyphicon-volume-up'); + var elements = container.getElementsByTagName('i')\[0\]; + var prefix = 'bi'; + if (elements.length == 0) { + elements = container.getElementsByTagName('span')\[0\]; + prefix = 'glyphicon'; + } + elements.classList.remove(prefix + '-volume-off'); + elements.classList.add(prefix + '-volume-up'); container.dataset.alarm = 'active'; document.cookie = '$audio_alarm_cookie=active; sameSite=strict'; audioContext.resume().then(() => {console.log('Playback resumed successfully ' + targetState);}); } else { - var span = container.getElementsByTagName('span')\[0\]; - span.classList.remove('glyphicon-volume-up'); - span.classList.add('glyphicon-volume-off'); + var elements = container.getElementsByTagName('i')\[0\]; + var prefix = 'bi'; + if (elements.length == 0) { + elements = container.getElementsByTagName('span')\[0\]; + prefix = 'glyphicon'; + } + elements.classList.remove(prefix + '-volume-up'); + elements.classList.add(prefix + '-volume-off'); container.dataset.alarm = 'inactive'; document.cookie = '$audio_alarm_cookie=inactive; sameSite=strict'; audioContext.suspend().then(() => {console.log('Playback suspended successfully ' + targetState);}); @@ -4764,16 +4806,16 @@ if {[ns_conn isconnected]} { set alarmState [ns_getcookie $audio_alarm_cookie "inactive"] - set glypphIcon [expr {$alarmState eq "inactive" ? "glyphicon-volume-off":"glyphicon-volume-up"}] + set glypphIcon [expr {$alarmState eq "inactive" ? "volume-off":"volume-up"}] } else { set alarmState "inactive" - set glypphIcon "glyphicon-volume-off" + set glypphIcon "volume-off" } #ns_log notice "C=$alarmState" return [subst { - + [::xowiki::bootstrap::icon -name $glypphIcon] }] @@ -5349,7 +5391,8 @@ for {set count 1} {$count <= $question_count} {incr count} { set visited_css [expr {($count - 1) in $visited ? "visited" : ""}] set flag_label [expr {($count - 1) in $flagged - ? " " : ""}] + ? " [::xowiki::bootstrap::icon -name flag -CSSclass text-danger]" + : ""}] set extra_css [:pagination_button_css \ -CSSclass "$CSSclass $visited_css" \ -cond [expr {$current_position == $count - 1 }] \ @@ -5972,15 +6015,16 @@ if {$with_grading_box eq "hidden"} { set question_name answer_$question_name } + set data_attribute [expr {[::xowiki::CSS toolkit] eq "bootstrap5" ? "data-bs" : "bs"}] append full_form [subst [ns_trim -delimiter | { | | #xowf.Points#: | | #xowf.feedback#: - | - | + | + | [::xowiki::bootstrap::icon -name pencil] | | }]] @@ -6443,9 +6487,11 @@ set fields [$obj create_form_fields_from_names -lookup -set_values \ -form_constraints $form_constraints \ $field_names] + set data_attribute [expr {[::xowiki::CSS toolkit] eq "bootstrap5" ? "data-bs" : "bs"}] return [subst { - - $label + + [::xowiki::bootstrap::icon -name chevron-down] $label [:exam_configuration_render_fields -modifiable $modifiable $fields] @@ -6554,42 +6600,19 @@ |}); }]] - $obj content_header_append [ns_trim -delimiter | [subst { - | - | - | - | - | - | × - | - | #xowf.Configuration#: - | - | - | - | - | $content - | - | - | - | - | - | - }]] - return [ns_trim -delimiter | [subst { - | - | - | - }]] + $obj content_header_append \ + [::xowiki::bootstrap::modal_dialog \ + -id configuration-modal \ + -title "#xowf.Configuration#: " \ + -body $content] + + return \ + [::xowiki::bootstrap::modal_dialog_popup_button \ + -target configuration-modal \ + -label [::xowiki::bootstrap::icon -name cog -style "float: right;"] \ + -title #xowf.Configuration_button_title# \ + -CSSclass configuration-button] } #---------------------------------------------------------------------- @@ -6605,7 +6628,7 @@ set href [$obj pretty_link -query m=exam-results] set results_summary [subst { #xowf.export_results#: - CSV + CSV [xowiki::boostrap::icon -name download] }] } else { set results_summary "" @@ -6615,7 +6638,7 @@ return [ns_trim -delimiter | [subst { | [:question_info_block $obj] | $results_summary - | #xowiki.back# + | #xowiki.back# }]] } @@ -6664,6 +6687,7 @@ lappend chunks $chunk } + append HTML [subst { #xowf.question_summary#
-
#xowf.question_summary# +
#xowf.question_summary#
#xowiki.back#
$nrAnswered/$nrParticipants + $submission_msg
$extra_text}]] if {$polling} { # @@ -4696,25 +4728,35 @@ # when the user does a full reload, then the user has to # activate the audio alarm again. # - # The state is symbolized using bootstrap 3 glyphicons. The - # code is tested primarily with chrome. + # The state is symbolized using bootstrap 3 glyphicons or + # bootstrap icons. The code is tested primarily with chrome. # template::add_body_script -script [subst { var audioContext = new AudioContext(); var audioContext_setSate = (function (targetState) { var container = document.getElementById('$id').parentNode; //console.log('--- state = ' + audioContext.state + ' want ' + targetState); if (targetState == 'active') { - var span = container.getElementsByTagName('span')\[0\]; - span.classList.remove('glyphicon-volume-off'); - span.classList.add('glyphicon-volume-up'); + var elements = container.getElementsByTagName('i')\[0\]; + var prefix = 'bi'; + if (elements.length == 0) { + elements = container.getElementsByTagName('span')\[0\]; + prefix = 'glyphicon'; + } + elements.classList.remove(prefix + '-volume-off'); + elements.classList.add(prefix + '-volume-up'); container.dataset.alarm = 'active'; document.cookie = '$audio_alarm_cookie=active; sameSite=strict'; audioContext.resume().then(() => {console.log('Playback resumed successfully ' + targetState);}); } else { - var span = container.getElementsByTagName('span')\[0\]; - span.classList.remove('glyphicon-volume-up'); - span.classList.add('glyphicon-volume-off'); + var elements = container.getElementsByTagName('i')\[0\]; + var prefix = 'bi'; + if (elements.length == 0) { + elements = container.getElementsByTagName('span')\[0\]; + prefix = 'glyphicon'; + } + elements.classList.remove(prefix + '-volume-up'); + elements.classList.add(prefix + '-volume-off'); container.dataset.alarm = 'inactive'; document.cookie = '$audio_alarm_cookie=inactive; sameSite=strict'; audioContext.suspend().then(() => {console.log('Playback suspended successfully ' + targetState);}); @@ -4764,16 +4806,16 @@ if {[ns_conn isconnected]} { set alarmState [ns_getcookie $audio_alarm_cookie "inactive"] - set glypphIcon [expr {$alarmState eq "inactive" ? "glyphicon-volume-off":"glyphicon-volume-up"}] + set glypphIcon [expr {$alarmState eq "inactive" ? "volume-off":"volume-up"}] } else { set alarmState "inactive" - set glypphIcon "glyphicon-volume-off" + set glypphIcon "volume-off" } #ns_log notice "C=$alarmState" return [subst {
- $label +
+ [::xowiki::bootstrap::icon -name chevron-down] $label
#xowf.export_results#: - CSV + CSV [xowiki::boostrap::icon -name download] }] } else { set results_summary "" @@ -6615,7 +6638,7 @@ return [ns_trim -delimiter | [subst { | [:question_info_block $obj] | $results_summary - |