Hello, dear friend, you can consult us at any time if you have any questions, add WeChat: daixieit

Assignment

Introduction

Overview

The assignment is an individual assessment. It contributes 30% of your Ònal marks.

The due date for the programming exercises is on 26 October 2023, 11.59 pm (Sydney time).

This is an assignment, and sta× are not permitted to give guidance on your code or how to solve the speciÒc problem. That is the purpose of the assessment that you are required to perform to achieve the grade.

You may ask clariÒcation questions about the assignment description. This is often necessary to implement functionality that is otherwise ambiguous.

If you have a question to ask on Ed please search before asking. However, remember that you should not be posting any assignment code publicly, as this would constitute academic dishonesty. Also, do not wait too long before starting. This assignment needs time and sustained e×ort.

Late submissions are not accepted unless an approved special consideration is granted.

Task Introduction and Summary

You are writing a program that allows students such as yourself to complete an online exam. The exam can contain multiple-choice questions (single or multiple answers) and short answer questions (numerical or text). The user interface of the program is text-based. In short, students     have to type in commands into the terminal instead of'point and click'. You can see the rest of the description here: https://edstem.org/au/courses/12106/lessons/38968/slides/293370

Programming Exercises

All submissions must be made via Ed, including any supporting documentation that is produced during the planning of the program design such as Óowcharts, pseudocodes, and UML class diagrams.

To make a submission, you will need to press the "Mark" button. You may submit as many times as you wish before the due date.

Your submission will be marked using an auto-grader that checks the correctness of the program with the given speciÒcation. The marking system will automatically check your code against the public test cases after you make a submission by pressing the  Mark button. If you attempt to deceive the auto-grader or do not answer the questions, 0 marks will be awarded for the question. After each submission, you will be able to view all the previous submissions and your Òles in the code submission section

The following rules apply to your submission:

Your submission must be able to compile and run within the Ed environment provided. Only the Ò les given in the sca×old codes will be started by the auto-marker.

Ensure that you have submitted your codes with the correct Òle name as given in the questions' sca×old. The auto-marker will only start the Ò les that are speciÒed in the given sca×old.

The Python version that is presently being used on the Ed system:

$ python3 --version

Python 3.11.3

Restrictions

The following must be read, as it says what you can and can't use.

Keywords

The following is not allowed:

for

in ( __contains__() )

global

lambda

nonlocal

Built-in Functions

The following is not allowed:

all()

any()

dir()

eval()

enumerate()

filter()

globals()

locals()

map()

Imports

Only the following modules are allowed:

import math

import datetime

import sys

import time

import os

import shutil

import random

import unittest

import io

any module you have written, e.g.  import shop

Everything else is restricted.

Size restrictions

A submission containing a Òle longer than 3000 lines or larger than 500kB will not be accepted. To check the Ò le sizes of your Òles, use the bash command  ls -s --block-size=KB

Help and feedback

You are encouraged to ask questions about the assignment during the Helpdesk and on the Ed

discussion board; however, remember that you should not be posting any assignment code

publicly, as this would constitute academic dishonesty. Also, you should not disclose your code or talk about your solutions in any of the PASS sessions.

Marking Criteria

Your marks for the assignment will be determined based on the number of test cases passed for    each question as well as manual grading by your tutor. We will use the latest submission received before the due date for marking.

Automatic tests - 20/30

Your marks for this component will be the ratio of the number of test cases passed to the sum of all the test cases administered. There will be public (and hidden) testcases that are available for feedback purposes - to allow you to test the conformance of your program with respect to  the description but these do not test all the functionalities described in the assignment. It is

important that you thoroughly test your own code. The private test cases will only be applied after the deadline and will be di×erent from the examples given.

Manual grading - 10/30

The manual grading from your tutor will consider the style, layout, and comments you provide in your  test_program.py and your answers in  test_plan.md . During marking, your tutor will not be debugging your code and will only run  test_program.py according to the directions

you have given in the docstring of the Ò le. The marks for this component will be reported to this Canvas Assignment link:

https://canvas.sydney.edu.au/courses/51815/assignments/475131

The latest submission before the due date will be used for marking. Marks will only be reported based on this single submission. Request to grade Ò les and derive marks from a combination of di×erent submissions will not be accepted. It is your responsibility to check that your latest submission is complete, and that you pressed the "Mark" button!

Friendly note

Sometimes we Ònd typos or other errors in speciÒcations. Sometimes the speciÒcation could be clearer. Students and tutors often make great suggestions for improving the speciÒcation.

Therefore, this assignment speciÒcation may be clariÒed up to Week 10, 12th of October. No major changes will be made. Revised versions will be clearly marked in the Log of Changes slide and the     most recent version will be in here.

Academic Declaration

By submitting this assignment, you declare the following:

I declare that I have read and understood the University of Sydney Student Plagiarism: Coursework Policy and Procedure, and except where speciÒcally acknowledged, the work contained in this assignment is my own work and has not been copied from other sources or been previously submitted for award or

assessment. I also did not use any generative AI tools (including ChatGPT) to assist in writing this assignment.

I understand that failure to comply with the Student Plagiarism: Coursework Policy and Procedure can lead to severe penalties as outlined under Chapter 8 of the University of Sydney By-Law 1999 (as amended). These penalties maybe imposed in cases where any signiÒcant portion of my submitted work has been copied without proper acknowledgment from other sources, including published works, the

Internet, existing programs, the work of other students, or work previously submitted for other awards or assessments.

I realize that I maybe asked to identify those portions of the work contributed by me and required to

demonstrate my knowledge of the relevant material by answering oral questions or by undertaking

supplementary work, either written or in the laboratory, in order to arrive at the Ònal assessment mark.

I acknowledge that the School of Computer Science, in assessing this assignment, may reproduce it entirely, may provide a copy to another member of faculty, and/or communicate a copy of this

assignment to a plagiarism checking service or in-house computer program, and that a copy of the

assignment maybe maintained by the service or the School of Computer Science for the purpose of future plagiarism checking.

Exam Program

At the end of this assignment, you should have a program allowing students like yourself to

complete an online exam. The exam can contain multiple-choice questions (single or multiple

answers) and short answer questions (numerical or text). The user interface of the program is text- based. In short, students have to type in commands into the terminal instead of'point and click'.

Command Line Arguments

The program expects the administrator to provide the details of the exam to the program, in the order of appearance, as command line arguments:

An absolute path to the directory containing two Òles - an exam contents and a student list Ò le. The Òles in this directory must be correctly labeled. See below for File Formats.

A number indicating the duration of the exam in minutes (as an integer).

[optional] A Óag  -r to indicate that the answers are to be shuÖed. If this is not provided, the answers are displayed as-is.

If more command line arguments are supplied than needed, the program will ignore the remaining

arguments. If users do not provide suÕcient arguments during the running of the program, the program will display the message  Check command line arguments to the terminal and it

terminates.

The content of Week 6 is required for this part of the assignment.

File Formats

The program expects the exam contents and student list to be provided by the administrator in Ò les labeled as follows:

questions.txt to denote this as the Ò le containing the exam contents.

students.csv to denote this as the Ò le containing the list of students registered for the exam.

Additional Òles found in the directory are ignored. If any of these two Òles are not found, the program displays the message  Missing files to the terminal and it terminates.

questions.txt

The program must parse the Ò le to extract these Òelds for each question:

Type : data representing the question type. This is case-insensitive and can take on these three values:  short ,  single or  multiple .

Question : data representing the question itself.

Possible Answers : data representing the answer options that candidates can choose from    when it is a multiple-choice question. It is restricted to the choice of  A ,  B ,  C , and  D . The Òeld

should be set to  None for short answer questions and must not be  None for multiple-choice questions. Multiple answers must be separated by a comma.

Expected answer : data representing the correct answer. This will be used by the auto-grader for marking.

Marks : data representing the total marks awarded for a question.

To aid the program in parsing, administrators are advised to prepare each question in the Ò le in this format:

Question - 

Possible Answers:

A. 

B. 

C. 

D. 

Expected Answer: 

Marks: 

The contents presentation must match the speciÒed question type. These conditions must be fulÒ lled:

If a question is a multiple choice question, either single or multiple answers, the Òeld Possible Answers: must exist. The expected answer must be  A ,  B ,  C , or  D .

If the question is of type multiple choice questions with a single answer, there must only be  one expected answer. For those with multiple answers, the answers must be separated by a comma ( , )

Short-answer questions must not have  Possible Answers following the  Question Òeld.

These are examples of content presentation for each question type:

Single type question - single answer

Question - Single

Which of the following Python statements will display this message in the terminal? *********************************

Terminal output:

I love INFO1110

*********************************

Possible Answers:

A. print(I love INFO1110)

B. print("I" "love" "INFO1110")

C. print("I love" "INFO1110")

D. print("I love INFO1110")

Expected Answer: D

Marks: 1

Multiple choice questions - multiple answers

Question - Multiple

Select all the animals that are mammals:

Possible Answers:

A. whale

B. dog

C. fish

D. frog

Expected Answer: A, B

Marks: 2

Short answer

Question - Short

This question is based on the program below:

*********************************

# Start

name = input("What 's your name?: ")

# End

*********************************

After running the program, you have keyed in "Bob" followed by the Enter key. What is the value stored in variable name?

Expected Answer: "Bob"

Marks: 1

The administrator may opt to prepare the Ò le to contain a mixture of question types or all of the same type. The program must be able to di×erentiate this. The question numbering will be

dependent on the presentation sequence of the question itself in the Ò le. For example, the

questions parsed from the Ò le  sample_types.txt will be viewed in the terminal in the following sequence by a candidate during the exam:

Question 1 - Single Answer[1]

Which of the following Python statements will display this message in the terminal? *********************************

Terminal output:

I love INFO1110

*********************************

A. print(I love INFO1110)

B. print("I" "love" "INFO1110")

C. print("I love" "INFO1110")

D. print("I love INFO1110")

Expected Answer: D

Question 2 - Multiple Answers[2]

Select all the animals that are mammals:

A. whale

B. dog

C. fish

D. frog

Expected Answer: A, B

Question 3 - Short Answer[1]

This question is based on the program below:

*********************************

# Start

name = input("What 's your name?: ")

# End

*********************************

After running the program, you have keyed in "Bob" followed by the Enter key. What is the value stored in variable name?

The list of students who will be sitting for the exam must be saved in a  csv Ò le with the following details:

SID : represent the student'sidentiÒcation number

Name : represents the student's full name

Extra Time : represents additional time, in minutes, granted to the candidate. If additional time is granted, it must be a whole number. Else, it can be left as blank or  0 .

The Òrst row is the header. Each row after that represents a candidate that will be doing the exam.

For example, this is the data in  sample_shortlist.csv which contains the details for  5 candidates with  1 candidate is given an extra  10 minutes of time while the rest are not given additional time    for the exam.

SID,Name,Extra Time

500010347,Damian Carroll,

500594412,Morgan Valencia,10

500622656,Tom Goldfinch,

500685031,Lisbeth Todd,

500498361,Todd Werner,

The contents from Week 7 is required for this part of the assignment.

Exam Process

The program must support the entire examination process which covers these stages:

Set up the exam.

Assign the exam to candidates.

Administer the exam and auto-marking.

Your job is to write Python codes to support both administrators and candidates for each stage.

If Òles are not in this format, the program should terminate as it is not able to successfully complete process 1. Set up the exam. In other words, the other processes must not load.

This part of the assignment requires all contents from Week 1 to Week 10.

1. Setup the exam

How do we setup the exam?

The exam contents must be loaded into the program using specially formatted Ò les. See Exam

Program - File Formats - questions.txt , for more information on this. At this stage, the program parses the question Ò le to extract all the exam contents. An exam can only be set up if all questions in the Ò le are complete i.e. all requested information as speciÒed in Exam Program - File Formats for each question are present and successfully extracted by the program.

Once the exam is setup, administrators should can opt to preview the exam or continue on with the next stage of the process. The program will continue prompting user with this message  Do you

want to preview the exam [Y |N]? until they enter  N or  n . If a response other than  y / Y or  n

/ N is given, the program will display  Invalid command. before prompting for another input. If the   exam is not setup correctly, the program must warn administrators of the problem and terminate     with the error message  Error setting up exam . See Program Execution below for an example of an unsuccessful setup.

The module  setup.py contains functions that will be used by the program to setup the exam, but we will get to that later.

Let's begin to code...

Question

A class called  Question should be implemented to represent a single question extracted from the Ò le. This class must be written in  question.py . A  Question object must have the following

attributes:

qtype : A string representing the type of question. It will always be one of these values:

single ,  multiple ,  short and  end which represent questions of type multiple choice

questions with single answer, multiple choice questions with multiple answers, short answer questions and the end of the exam respectively.

description : A string representing the question description. This is what someone would read to be able to answer the question.

answer_options : A list representing the possible answers for the questions of type  single or multiple . A  short question would have this attribute as an empty list.

correct_answer : A string representing the expected answer response for the question description resulting in the response being marked correct.

For questions of type  single , it will be a single option value (either  A ,  B ,  C or  D ). For questions of type  multiple , it will be one of the following:

A single option value ( A ,  B ,  C or  D ).