• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

source-academy / backend / e0330f2cf38b2d8af12bffd20f4cac2158d607fc-PR-1236

31 Mar 2025 09:12AM UTC coverage: 19.982% (-73.6%) from 93.607%
e0330f2cf38b2d8af12bffd20f4cac2158d607fc-PR-1236

Pull #1236

github

RichDom2185
Redate migrations to maintain total ordering
Pull Request #1236: Added Exam mode

12 of 57 new or added lines in 8 files covered. (21.05%)

2430 existing lines in 97 files now uncovered.

671 of 3358 relevant lines covered (19.98%)

3.03 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

62.5
/lib/cadet_web/controllers/stories_controller.ex
1
defmodule CadetWeb.StoriesController do
2
  use CadetWeb, :controller
3
  use PhoenixSwagger
4

5
  alias Cadet.Stories.Stories
6

7
  def index(conn, %{"course_id" => course_id}) do
UNCOV
8
    list_all = conn.assigns.course_reg.role in [:admin, :staff]
×
UNCOV
9
    stories = Stories.list_stories(course_id, list_all)
×
UNCOV
10
    render(conn, "index.json", stories: stories)
×
11
  end
12

13
  swagger_path :index do
1✔
14
    get("/courses/{course_id}/stories")
15

16
    summary("Get a list of all stories")
17

18
    security([%{JWT: []}])
19

20
    response(200, "OK", Schema.array(:Story))
21
  end
22

23
  @spec swagger_definitions :: %{Story: any}
24
  def swagger_definitions do
25
    %{
1✔
26
      Story:
27
        swagger_schema do
1✔
28
          properties do
1✔
29
            filenames(schema_array(:string), "Filenames of txt files", required: true)
30
            title(:string, "Title shown in Chapter Select Screen", required: true)
31
            imageUrl(:string, "Path to image shown in Chapter Select Screen", required: false)
32
            openAt(:string, "The opening date", format: "date-time", required: true)
33
            closeAt(:string, "The closing date", format: "date-time", required: true)
34
            isPublished(:boolean, "Whether or not is published", required: false)
35
            course_id(:integer, "The id of the course that this story belongs to", required: true)
1✔
36
          end
37
        end
38
    }
39
  end
40
end
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc