-
-
Notifications
You must be signed in to change notification settings - Fork 170
Expand file tree
/
Copy pathProblem.html.ep
More file actions
125 lines (125 loc) · 5.22 KB
/
Problem.html.ep
File metadata and controls
125 lines (125 loc) · 5.22 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
% use WeBWorK::Utils qw(getAssetURL);
%
% content_for css => begin
% # Output css for jquery-ui for problems to use.
<%= stylesheet getAssetURL($ce, 'node_modules/jquery-ui-dist/jquery-ui.min.css') =%>
%
<%= stylesheet getAssetURL($ce, 'js/Achievements/achievements.css') =%>
%
% # Add CSS files requested by problems via ADD_CSS_FILE() in the PG file
% # or via a setting of $ce->{pg}{specialPGEnvironmentVars}{extra_css_files}
% # which can be set in course.conf (the value should be an anonomous array).
% my @cssFiles;
% if (ref($ce->{pg}{specialPGEnvironmentVars}{extra_css_files}) eq 'ARRAY') {
% push(@cssFiles, { file => $_, external => 0 }) for @{ $ce->{pg}{specialPGEnvironmentVars}{extra_css_files} };
% }
% if (ref($c->{pg}{flags}{extra_css_files}) eq 'ARRAY') {
% push @cssFiles, @{ $c->{pg}{flags}{extra_css_files} };
% }
% my %cssFilesAdded; # Used to avoid duplicates
% for (@cssFiles) {
% next if $cssFilesAdded{ $_->{file} };
% $cssFilesAdded{ $_->{file} } = 1;
% if ($_->{external}) {
<%= stylesheet $_->{file} =%>
% } else {
<%= stylesheet getAssetURL($ce, $_->{file}) =%>
% }
% }
% end
%
% content_for js => begin
% # Output javascript for jquery-ui for problems to use.
<%= javascript getAssetURL($ce, 'node_modules/jquery-ui-dist/jquery-ui.min.js') =%>
%
% # This is for tagging menus (if allowed)
% if ($authz->hasPermissions(param('user'), 'modify_tags')) {
<%= javascript getAssetURL($ce, 'js/TagWidget/tagwidget.js'), id => 'tag-widget-script', defer => undef,
data => { taxonomy => "$ce->{webworkURLs}{htdocs}/DATA/tagging-taxonomy.json" } =%>
% }
%
% # This is for any page specific js. Right now its just used for achievement popups
<%= javascript getAssetURL($ce, 'js/Problem/problem.js'), defer => undef =%>
%
% # Add JS files requested by problems via ADD_JS_FILE() in the PG file.
% if (ref($c->{pg}{flags}{extra_js_files}) eq 'ARRAY') {
% my %jsFiles;
% for (@{ $c->{pg}{flags}{extra_js_files} }) {
% next if $jsFiles{ $_->{file} };
% $jsFiles{ $_->{file} } = 1;
% my %attributes = ref($_->{attributes}) eq 'HASH' ? %{ $_->{attributes} } : ();
% if ($_->{external}) {
<%= javascript $_->{file}, %attributes =%>
% } else {
<%= javascript getAssetURL($ce, $_->{file}), %attributes =%>
% }
% }
% }
% end
%
% if ($c->{invalidProblem} || !$c->{set}) {
<div class="alert alert-danger p-1 my-3"><%= maketext('This problem is not valid.') %></div>
% last;
% }
%
% stash->{footerWidthClass} = 'col-lg-10';
%
<%== $c->post_header_text =%>
% if ($c->{pg}{warnings} || @{ $c->{pgwarning} // [] }) {
<div class="row g-0 mb-2">
<div class="col-12 alert alert-danger m-0">
<%== maketext('<strong>Warning</strong>: There may be something wrong with this question. '
. 'Please inform your instructor including the warning messages below.') =%>
</div>
</div>
% }
% if (ref $c->{pg}{debug_messages} eq 'ARRAY' && @{ $c->{pg}{debug_messages} }) {
<div class="row g-0 mb-2">
<div class="col-12 alert alert-info m-0"><%== maketext('Debugging information is shown below.') %></div>
</div>
% }
<div id="custom_edit_message" class="row"><div class="col-lg-10"><%= $c->output_custom_edit_message %></div></div>
<div class="row"><div id="output_summary" class="col-lg-10"><%= $c->output_summary %></div></div>
<div class="row">
<div id="output_achievement_message" class="col-lg-10"><%= $c->output_achievement_message %></div>
</div>
<div class="row"><div id="output_comments" class="col-lg-10"><%= $c->output_comments %></div></div>
% if ($c->{pg}{render_fail}) {
<div class="row g-0 mb-2">
<div class="col-10 alert alert-danger m-0">
<h2 style="color:red"><%= maketext('PG question failed to render') %></h2>
<p class="m-0"><%= maketext('Processing of this PG problem was not completed. Probably because of a '
. 'syntax error. The translator died prematurely and no PG warning messages were transmitted.') %></p>
</div>
</div>
% }
<div class="row">
<div class="col-lg-10">
<%= form_for current_route, method => 'POST', name => 'problemMainForm',
id => 'problemMainForm', class => 'problem-main-form', begin =%>
<%= $c->hidden_authen_fields =%>
<%= hidden_field(startTime => param('startTime') || time) =%>
<%= hidden_field(courseID => $c->ce->{courseName}) =%>
<div id="problem_body" class="problem-content"
<%== $c->output_problem_lang_and_dir %>>
<%= $c->output_problem_body =%>
</div>
<%= $c->output_message =%>
<%= $c->output_grader %>
<%= $c->output_checkboxes %>
<div class="submit-buttons-container col-12 my-2"><%= $c->output_submit_buttons %></div>
<%= include 'ContentGenerator/Problem/instructor_buttons' %>
<div id="score_summary" class="scoreSummary"><%= $c->output_score_summary %></div>
<%= $c->output_misc =%>
<% end =%>
</div>
</div>
<%= $c->output_past_answer_button =%>
% my $emailInstructorButton = $c->output_email_instructor;
% if ($emailInstructorButton) {
<div class="mb-3"><%= $emailInstructorButton =%></div>
% }
<%= include 'ContentGenerator/Base/problem_warning_and_debug_output',
warnings => $c->{pg}{warnings},
warning_messages => ref $c->{pg}{warning_messages} eq 'ARRAY' ? $c->{pg}{warning_messages} : [],
debug_messages => ref $c->{pg}{debug_messages} eq 'ARRAY' ? $c->{pg}{debug_messages} : [] =%>