Skip to content

Commit

Permalink
Merge pull request UCL-INGI#992 from AlexandreDoneux/pre-release_fixes
Browse files Browse the repository at this point in the history
Several bugfixes
  • Loading branch information
anthonygego authored Feb 9, 2024
2 parents 7d7048b + a8b282a commit 3453688
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 14 deletions.
2 changes: 1 addition & 1 deletion inginious/frontend/pages/course_admin/submissions.py
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ def get_selected_submissions(self, course,
d["best"] = d["_id"] in best_submissions_list # mark best submissions

if limit is not None:
number_of_pages = submissions_count // limit + (submissions_count % limit > 0)
number_of_pages = max(submissions_count // limit + (submissions_count % limit > 0), 1)
return out, submissions_count, number_of_pages
else:
return out
2 changes: 1 addition & 1 deletion inginious/frontend/static/js/common.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ function registerCodeEditor(textarea, lang, lines, firstline=1)

var editor = CodeMirror.fromTextArea(textarea, {
lineNumbers: true,
firstLineNumber: firstline,
firstLineNumber: parseInt(firstline),
mode: mode["mime"],
foldGutter: true,
styleActiveLine: true,
Expand Down
4 changes: 0 additions & 4 deletions inginious/frontend/static/js/task_dispensers.js
Original file line number Diff line number Diff line change
Expand Up @@ -437,10 +437,6 @@ function dispenser_util_get_task_config() {
tasks_config[elem] = {};
});

for(const config_func of task_config_funcs) {
config_func(tasks_config);
}

return tasks_config;
}

Expand Down
12 changes: 6 additions & 6 deletions inginious/frontend/task_dispensers/combinatory_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,14 +50,14 @@ def render_edit(self, template_helper, element, task_data, task_errors):
taskset = element if isinstance(element, inginious.frontend.tasksets.Taskset) else None
course = element if isinstance(element, inginious.frontend.courses.Course) else None

return template_helper.render("task_dispensers_admin/combinatory_test.html", element=element, course=course, taskset=taskset,
dispenser_structure=self._toc, tasks=task_data, task_errors=task_errors, config_fields=config_fields,
config_items_funcs=["dispenser_util_get_" + config_item.get_id() for config_item in self.config_items])
return template_helper.render("task_dispensers_admin/combinatory_test.html", element=element, course=course,
taskset=taskset, dispenser_structure=self._toc, dispenser_config=self._task_config,
tasks=task_data, task_errors=task_errors, config_fields=config_fields)

def render(self, template_helper, element, tasks_data, tag_list, username):
def render(self, template_helper, course, tasks_data, tag_list, username):
""" Returns the formatted task list"""
accessibilities = element.get_task_dispenser().get_accessibilities(self._task_list_func(), [username])
return template_helper.render("task_dispensers/toc.html", element=element, tasks=self._task_list_func(),
accessibilities = course.get_task_dispenser().get_accessibilities(self._task_list_func(), [username])
return template_helper.render("task_dispensers/toc.html", course=course, tasks=self._task_list_func(),
tasks_data=tasks_data, tag_filter_list=tag_list, sections=self._toc,
accessibilities=accessibilities)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,6 @@ <h4 class="alert-heading">{{ _("Combinatory tests") }}</h4>

<script>
$(function() {
task_config_funcs = [ {{ config_items_funcs | join(",")}} ];
dispenser_config = JSON.parse('{{ dispenser_config | tojson }}');
});
</script>
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,5 @@ <h5 class="modal-title">{{_("Edit task {}").format('<span class="taskid"></span>
var taskid = button.data('taskid');
$(this).data("taskid", taskid);
$(this).find(".taskid").text(taskid);
console.log(taskid);
});
</script>

0 comments on commit 3453688

Please sign in to comment.